Skip to content

Latest commit

 

History

History
446 lines (312 loc) · 13.5 KB

File metadata and controls

446 lines (312 loc) · 13.5 KB

plesk_client.DNSApi

All URIs are relative to /api/v2

Method HTTP request Description
dns_records_get GET /dns/records Get domain or domain alias DNS records
dns_records_id_delete DELETE /dns/records/{id} Delete DNS record
dns_records_id_get GET /dns/records/{id} Get DNS record
dns_records_id_put PUT /dns/records/{id} Update DNS record
dns_records_post POST /dns/records Create domain or domain alias DNS record

dns_records_get

List[DnsRecord] dns_records_get(domain)

Get domain or domain alias DNS records

Example

  • Api Key Authentication (APIKeyHeader):
  • Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.dns_record import DnsRecord
from plesk_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /api/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = plesk_client.Configuration(
    host = "/api/v2"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'

# Configure HTTP basic authorization: BasicAuth
configuration = plesk_client.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with plesk_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = plesk_client.DNSApi(api_client)
    domain = 'example.com' # str | Filter by domain or domain alias name

    try:
        # Get domain or domain alias DNS records
        api_response = api_instance.dns_records_get(domain)
        print("The response of DNSApi->dns_records_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DNSApi->dns_records_get: %s\n" % e)

Parameters

Name Type Description Notes
domain str Filter by domain or domain alias name

Return type

List[DnsRecord]

Authorization

APIKeyHeader, BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

dns_records_id_delete

StatusResponse dns_records_id_delete(id)

Delete DNS record

Example

  • Api Key Authentication (APIKeyHeader):
  • Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.status_response import StatusResponse
from plesk_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /api/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = plesk_client.Configuration(
    host = "/api/v2"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'

# Configure HTTP basic authorization: BasicAuth
configuration = plesk_client.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with plesk_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = plesk_client.DNSApi(api_client)
    id = 123 # int | DNS record ID

    try:
        # Delete DNS record
        api_response = api_instance.dns_records_id_delete(id)
        print("The response of DNSApi->dns_records_id_delete:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DNSApi->dns_records_id_delete: %s\n" % e)

Parameters

Name Type Description Notes
id int DNS record ID

Return type

StatusResponse

Authorization

APIKeyHeader, BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
404 DNS record is not found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

dns_records_id_get

DnsRecord dns_records_id_get(id)

Get DNS record

Example

  • Api Key Authentication (APIKeyHeader):
  • Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.dns_record import DnsRecord
from plesk_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /api/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = plesk_client.Configuration(
    host = "/api/v2"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'

# Configure HTTP basic authorization: BasicAuth
configuration = plesk_client.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with plesk_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = plesk_client.DNSApi(api_client)
    id = 123 # int | DNS record ID

    try:
        # Get DNS record
        api_response = api_instance.dns_records_id_get(id)
        print("The response of DNSApi->dns_records_id_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DNSApi->dns_records_id_get: %s\n" % e)

Parameters

Name Type Description Notes
id int DNS record ID

Return type

DnsRecord

Authorization

APIKeyHeader, BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Invalid request data -
404 DNS record is not found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

dns_records_id_put

StatusResponse dns_records_id_put(id, body)

Update DNS record

Example

  • Api Key Authentication (APIKeyHeader):
  • Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.dns_record import DnsRecord
from plesk_client.models.status_response import StatusResponse
from plesk_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /api/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = plesk_client.Configuration(
    host = "/api/v2"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'

# Configure HTTP basic authorization: BasicAuth
configuration = plesk_client.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with plesk_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = plesk_client.DNSApi(api_client)
    id = 123 # int | DNS record ID
    body = plesk_client.DnsRecord() # DnsRecord | DNS record data

    try:
        # Update DNS record
        api_response = api_instance.dns_records_id_put(id, body)
        print("The response of DNSApi->dns_records_id_put:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DNSApi->dns_records_id_put: %s\n" % e)

Parameters

Name Type Description Notes
id int DNS record ID
body DnsRecord DNS record data

Return type

StatusResponse

Authorization

APIKeyHeader, BasicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Invalid request data -
404 DNS record is not found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

dns_records_post

DnsRecord dns_records_post(domain, body)

Create domain or domain alias DNS record

Example

  • Api Key Authentication (APIKeyHeader):
  • Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.dns_record import DnsRecord
from plesk_client.models.dns_record_request import DnsRecordRequest
from plesk_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /api/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = plesk_client.Configuration(
    host = "/api/v2"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'

# Configure HTTP basic authorization: BasicAuth
configuration = plesk_client.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with plesk_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = plesk_client.DNSApi(api_client)
    domain = 'example.com' # str | Filter by domain or domain alias name
    body = plesk_client.DnsRecordRequest() # DnsRecordRequest | DNS record data

    try:
        # Create domain or domain alias DNS record
        api_response = api_instance.dns_records_post(domain, body)
        print("The response of DNSApi->dns_records_post:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DNSApi->dns_records_post: %s\n" % e)

Parameters

Name Type Description Notes
domain str Filter by domain or domain alias name
body DnsRecordRequest DNS record data

Return type

DnsRecord

Authorization

APIKeyHeader, BasicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Invalid request data -
404 Domain or Domain Alias is not found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]