Skip to content

Latest commit

 

History

History
295 lines (214 loc) · 10.3 KB

ZonemetadataApi.md

File metadata and controls

295 lines (214 loc) · 10.3 KB

powerdns_client.ZonemetadataApi

All URIs are relative to https://localhost/api/v1

Method HTTP request Description
create_metadata POST /servers/{server_id}/zones/{zone_id}/metadata Creates a set of metadata entries
delete_metadata DELETE /servers/{server_id}/zones/{zone_id}/metadata/{metadata_kind} Delete all items of a single kind of domain metadata.
get_metadata GET /servers/{server_id}/zones/{zone_id}/metadata/{metadata_kind} Get the content of a single kind of domain metadata as a Metadata object.
list_metadata GET /servers/{server_id}/zones/{zone_id}/metadata Get all the Metadata associated with the zone.
modify_metadata PUT /servers/{server_id}/zones/{zone_id}/metadata/{metadata_kind} Replace the content of a single kind of domain metadata.

create_metadata

create_metadata(server_id, zone_id, metadata)

Creates a set of metadata entries

Creates a set of metadata entries of given kind for the zone. Existing metadata entries for the zone with the same kind are not overwritten.

Example

from __future__ import print_function
import time
import powerdns_client
from powerdns_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: APIKeyHeader
configuration = powerdns_client.Configuration()
configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'

# create an instance of the API class
api_instance = powerdns_client.ZonemetadataApi(powerdns_client.ApiClient(configuration))
server_id = 'server_id_example' # str | The id of the server to retrieve
zone_id = 'zone_id_example' # str | 
metadata = powerdns_client.Metadata() # Metadata | Metadata object with list of values to create

try:
    # Creates a set of metadata entries
    api_instance.create_metadata(server_id, zone_id, metadata)
except ApiException as e:
    print("Exception when calling ZonemetadataApi->create_metadata: %s\n" % e)

Parameters

Name Type Description Notes
server_id str The id of the server to retrieve
zone_id str
metadata Metadata Metadata object with list of values to create

Return type

void (empty response body)

Authorization

APIKeyHeader

HTTP request headers

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

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

delete_metadata

delete_metadata(server_id, zone_id, metadata_kind)

Delete all items of a single kind of domain metadata.

Example

from __future__ import print_function
import time
import powerdns_client
from powerdns_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: APIKeyHeader
configuration = powerdns_client.Configuration()
configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'

# create an instance of the API class
api_instance = powerdns_client.ZonemetadataApi(powerdns_client.ApiClient(configuration))
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
metadata_kind = 'metadata_kind_example' # str | The kind of metadata

try:
    # Delete all items of a single kind of domain metadata.
    api_instance.delete_metadata(server_id, zone_id, metadata_kind)
except ApiException as e:
    print("Exception when calling ZonemetadataApi->delete_metadata: %s\n" % e)

Parameters

Name Type Description Notes
server_id str The id of the server to retrieve
zone_id str The id of the zone to retrieve
metadata_kind str The kind of metadata

Return type

void (empty response body)

Authorization

APIKeyHeader

HTTP request headers

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

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

get_metadata

Metadata get_metadata(server_id, zone_id, metadata_kind)

Get the content of a single kind of domain metadata as a Metadata object.

Example

from __future__ import print_function
import time
import powerdns_client
from powerdns_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: APIKeyHeader
configuration = powerdns_client.Configuration()
configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'

# create an instance of the API class
api_instance = powerdns_client.ZonemetadataApi(powerdns_client.ApiClient(configuration))
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
metadata_kind = 'metadata_kind_example' # str | The kind of metadata

try:
    # Get the content of a single kind of domain metadata as a Metadata object.
    api_response = api_instance.get_metadata(server_id, zone_id, metadata_kind)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ZonemetadataApi->get_metadata: %s\n" % e)

Parameters

Name Type Description Notes
server_id str The id of the server to retrieve
zone_id str The id of the zone to retrieve
metadata_kind str The kind of metadata

Return type

Metadata

Authorization

APIKeyHeader

HTTP request headers

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

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

list_metadata

list[Metadata] list_metadata(server_id, zone_id)

Get all the Metadata associated with the zone.

Example

from __future__ import print_function
import time
import powerdns_client
from powerdns_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: APIKeyHeader
configuration = powerdns_client.Configuration()
configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'

# create an instance of the API class
api_instance = powerdns_client.ZonemetadataApi(powerdns_client.ApiClient(configuration))
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:
    # Get all the Metadata associated with the zone.
    api_response = api_instance.list_metadata(server_id, zone_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ZonemetadataApi->list_metadata: %s\n" % e)

Parameters

Name Type Description Notes
server_id str The id of the server to retrieve
zone_id str The id of the zone to retrieve

Return type

list[Metadata]

Authorization

APIKeyHeader

HTTP request headers

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

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

modify_metadata

Metadata modify_metadata(server_id, zone_id, metadata_kind, metadata)

Replace the content of a single kind of domain metadata.

Creates a set of metadata entries of given kind for the zone. Existing metadata entries for the zone with the same kind are removed.

Example

from __future__ import print_function
import time
import powerdns_client
from powerdns_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: APIKeyHeader
configuration = powerdns_client.Configuration()
configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'

# create an instance of the API class
api_instance = powerdns_client.ZonemetadataApi(powerdns_client.ApiClient(configuration))
server_id = 'server_id_example' # str | The id of the server to retrieve
zone_id = 'zone_id_example' # str | 
metadata_kind = 'metadata_kind_example' # str | The kind of metadata
metadata = powerdns_client.Metadata() # Metadata | metadata to add/create

try:
    # Replace the content of a single kind of domain metadata.
    api_response = api_instance.modify_metadata(server_id, zone_id, metadata_kind, metadata)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ZonemetadataApi->modify_metadata: %s\n" % e)

Parameters

Name Type Description Notes
server_id str The id of the server to retrieve
zone_id str
metadata_kind str The kind of metadata
metadata Metadata metadata to add/create

Return type

Metadata

Authorization

APIKeyHeader

HTTP request headers

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

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