All URIs are relative to http://localhost:8081/api/v1
Method | HTTP request | Description |
---|---|---|
axfr_export_zone | GET /servers/{server_id}/zones/{zone_id}/export | Returns the zone in AXFR format. |
axfr_retrieve_zone | PUT /servers/{server_id}/zones/{zone_id}/axfr-retrieve | Send a DNS NOTIFY to all slaves. |
check_zone | GET /servers/{server_id}/zones/{zone_id}/check | Verify zone contents/configuration. |
create_zone | POST /servers/{server_id}/zones | Creates a new domain, returns the Zone on creation. |
delete_zone | DELETE /servers/{server_id}/zones/{zone_id} | Deletes this zone, all attached metadata and rrsets. |
list_zone | GET /servers/{server_id}/zones/{zone_id} | zone managed by a server |
list_zones | GET /servers/{server_id}/zones | List all Zones in a server |
notify_zone | PUT /servers/{server_id}/zones/{zone_id}/notify | Send a DNS NOTIFY to all slaves. |
patch_zone | PATCH /servers/{server_id}/zones/{zone_id} | Modifies present RRsets and comments. Returns 204 No Content on success. |
put_zone | PUT /servers/{server_id}/zones/{zone_id} | Modifies basic zone data (metadata). |
rectify_zone | PUT /servers/{server_id}/zones/{zone_id}/rectify | Rectify the zone data. |
str axfr_export_zone(server_id, zone_id)
Returns the zone in AXFR format.
from __future__ import print_function
import time
import pdns_api_client
from pdns_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: APIKeyHeader
pdns_api_client.configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# pdns_api_client.configuration.api_key_prefix['X-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = pdns_api_client.ZonesApi()
server_id = 'server_id_example' # str | The id of the server to retrieve
zone_id = 'zone_id_example' # str | The id of the zone to retrieve
try:
# Returns the zone in AXFR format.
api_response = api_instance.axfr_export_zone(server_id, zone_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling ZonesApi->axfr_export_zone: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
server_id | str | The id of the server to retrieve | |
zone_id | str | The id of the zone to retrieve |
str
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
axfr_retrieve_zone(server_id, zone_id)
Send a DNS NOTIFY to all slaves.
Fails when zone kind is not Master or Slave, or master and slave are disabled in the configuration. Only works for Slave if renotify is on. Clients MUST NOT send a body.
from __future__ import print_function
import time
import pdns_api_client
from pdns_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: APIKeyHeader
pdns_api_client.configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# pdns_api_client.configuration.api_key_prefix['X-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = pdns_api_client.ZonesApi()
server_id = 'server_id_example' # str | The id of the server to retrieve
zone_id = 'zone_id_example' # str | The id of the zone to retrieve
try:
# Send a DNS NOTIFY to all slaves.
api_instance.axfr_retrieve_zone(server_id, zone_id)
except ApiException as e:
print("Exception when calling ZonesApi->axfr_retrieve_zone: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
server_id | str | The id of the server to retrieve | |
zone_id | str | The id of the zone to retrieve |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str check_zone(server_id, zone_id)
Verify zone contents/configuration.
from __future__ import print_function
import time
import pdns_api_client
from pdns_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: APIKeyHeader
pdns_api_client.configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# pdns_api_client.configuration.api_key_prefix['X-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = pdns_api_client.ZonesApi()
server_id = 'server_id_example' # str | The id of the server to retrieve
zone_id = 'zone_id_example' # str | The id of the zone to retrieve
try:
# Verify zone contents/configuration.
api_response = api_instance.check_zone(server_id, zone_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling ZonesApi->check_zone: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
server_id | str | The id of the server to retrieve | |
zone_id | str | The id of the zone to retrieve |
str
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Zone create_zone(server_id, rrsets=rrsets)
Creates a new domain, returns the Zone on creation.
from __future__ import print_function
import time
import pdns_api_client
from pdns_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: APIKeyHeader
pdns_api_client.configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# pdns_api_client.configuration.api_key_prefix['X-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = pdns_api_client.ZonesApi()
server_id = 'server_id_example' # str | The id of the server to retrieve
rrsets = true # bool | “true” (default) or “false”, whether to include the “rrsets” in the response Zone object. (optional) (default to true)
try:
# Creates a new domain, returns the Zone on creation.
api_response = api_instance.create_zone(server_id, rrsets=rrsets)
pprint(api_response)
except ApiException as e:
print("Exception when calling ZonesApi->create_zone: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
server_id | str | The id of the server to retrieve | |
rrsets | bool | “true” (default) or “false”, whether to include the “rrsets” in the response Zone object. | [optional] [default to true] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_zone(server_id, zone_id)
Deletes this zone, all attached metadata and rrsets.
from __future__ import print_function
import time
import pdns_api_client
from pdns_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: APIKeyHeader
pdns_api_client.configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# pdns_api_client.configuration.api_key_prefix['X-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = pdns_api_client.ZonesApi()
server_id = 'server_id_example' # str | The id of the server to retrieve
zone_id = 'zone_id_example' # str | The id of the zone to retrieve
try:
# Deletes this zone, all attached metadata and rrsets.
api_instance.delete_zone(server_id, zone_id)
except ApiException as e:
print("Exception when calling ZonesApi->delete_zone: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
server_id | str | The id of the server to retrieve | |
zone_id | str | The id of the zone to retrieve |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Zone list_zone(server_id, zone_id)
zone managed by a server
from __future__ import print_function
import time
import pdns_api_client
from pdns_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: APIKeyHeader
pdns_api_client.configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# pdns_api_client.configuration.api_key_prefix['X-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = pdns_api_client.ZonesApi()
server_id = 'server_id_example' # str | The id of the server to retrieve
zone_id = 'zone_id_example' # str | The id of the zone to retrieve
try:
# zone managed by a server
api_response = api_instance.list_zone(server_id, zone_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling ZonesApi->list_zone: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
server_id | str | The id of the server to retrieve | |
zone_id | str | The id of the zone to retrieve |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[Zone] list_zones(server_id)
List all Zones in a server
from __future__ import print_function
import time
import pdns_api_client
from pdns_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: APIKeyHeader
pdns_api_client.configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# pdns_api_client.configuration.api_key_prefix['X-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = pdns_api_client.ZonesApi()
server_id = 'server_id_example' # str | The id of the server to retrieve
try:
# List all Zones in a server
api_response = api_instance.list_zones(server_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling ZonesApi->list_zones: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
server_id | str | The id of the server to retrieve |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
notify_zone(server_id, zone_id)
Send a DNS NOTIFY to all slaves.
Fails when zone kind is not Master or Slave, or master and slave are disabled in the configuration. Only works for Slave if renotify is on. Clients MUST NOT send a body.
from __future__ import print_function
import time
import pdns_api_client
from pdns_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: APIKeyHeader
pdns_api_client.configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# pdns_api_client.configuration.api_key_prefix['X-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = pdns_api_client.ZonesApi()
server_id = 'server_id_example' # str | The id of the server to retrieve
zone_id = 'zone_id_example' # str | The id of the zone to retrieve
try:
# Send a DNS NOTIFY to all slaves.
api_instance.notify_zone(server_id, zone_id)
except ApiException as e:
print("Exception when calling ZonesApi->notify_zone: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
server_id | str | The id of the server to retrieve | |
zone_id | str | The id of the zone to retrieve |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
patch_zone(server_id, zone_id, zone_struct)
Modifies present RRsets and comments. Returns 204 No Content on success.
from __future__ import print_function
import time
import pdns_api_client
from pdns_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: APIKeyHeader
pdns_api_client.configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# pdns_api_client.configuration.api_key_prefix['X-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = pdns_api_client.ZonesApi()
server_id = 'server_id_example' # str | The id of the server to retrieve
zone_id = 'zone_id_example' # str |
zone_struct = pdns_api_client.Zone() # Zone | The zone struct to patch with
try:
# Modifies present RRsets and comments. Returns 204 No Content on success.
api_instance.patch_zone(server_id, zone_id, zone_struct)
except ApiException as e:
print("Exception when calling ZonesApi->patch_zone: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
server_id | str | The id of the server to retrieve | |
zone_id | str | ||
zone_struct | Zone | The zone struct to patch with |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
put_zone(server_id, zone_id, zone_struct)
Modifies basic zone data (metadata).
Allowed fields in client body: all except id, url and name. Returns 204 No Content on success.
from __future__ import print_function
import time
import pdns_api_client
from pdns_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: APIKeyHeader
pdns_api_client.configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# pdns_api_client.configuration.api_key_prefix['X-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = pdns_api_client.ZonesApi()
server_id = 'server_id_example' # str | The id of the server to retrieve
zone_id = 'zone_id_example' # str |
zone_struct = pdns_api_client.Zone() # Zone | The zone struct to patch with
try:
# Modifies basic zone data (metadata).
api_instance.put_zone(server_id, zone_id, zone_struct)
except ApiException as e:
print("Exception when calling ZonesApi->put_zone: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
server_id | str | The id of the server to retrieve | |
zone_id | str | ||
zone_struct | Zone | The zone struct to patch with |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str rectify_zone(server_id, zone_id)
Rectify the zone data.
This does not take into account the API-RECTIFY metadata. Fails on slave zones and zones that do not have DNSSEC.
from __future__ import print_function
import time
import pdns_api_client
from pdns_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: APIKeyHeader
pdns_api_client.configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# pdns_api_client.configuration.api_key_prefix['X-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = pdns_api_client.ZonesApi()
server_id = 'server_id_example' # str | The id of the server to retrieve
zone_id = 'zone_id_example' # str | The id of the zone to retrieve
try:
# Rectify the zone data.
api_response = api_instance.rectify_zone(server_id, zone_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling ZonesApi->rectify_zone: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
server_id | str | The id of the server to retrieve | |
zone_id | str | The id of the zone to retrieve |
str
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]