azure.mgmt.dns.operations module

class azure.mgmt.dns.operations.RecordSetsOperations(client, config, serializer, deserializer)[source]

Bases: object

RecordSetsOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An objec model deserializer.
Variables:

api_version – Specifies the API version. Constant value: “2016-04-01”.

create_or_update(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match=None, if_none_match=None, custom_headers=None, raw=False, **operation_config)[source]

Creates or updates a record set within a DNS zone.

Parameters:
  • resource_group_name (str) – The name of the resource group.
  • zone_name (str) – The name of the DNS zone (without a terminating dot).
  • relative_record_set_name (str) – The name of the record set, relative to the name of the zone.
  • record_type (str or RecordType) – The type of DNS record in this record set. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created). Possible values include: ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’
  • parameters (RecordSet) – Parameters supplied to the CreateOrUpdate operation.
  • if_match (str) – The etag of the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag value to prevent accidentally overwritting any concurrent changes.
  • if_none_match (str) – Set to ‘*’ to allow a new record set to be created, but to prevent updating an existing record set. Other values will be ignored.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

RecordSet

Return type:

ClientRawResponse if raw=true

Raises:

CloudError

delete(resource_group_name, zone_name, relative_record_set_name, record_type, if_match=None, custom_headers=None, raw=False, **operation_config)[source]

Deletes a record set from a DNS zone. This operation cannot be undone.

Parameters:
  • resource_group_name (str) – The name of the resource group.
  • zone_name (str) – The name of the DNS zone (without a terminating dot).
  • relative_record_set_name (str) – The name of the record set, relative to the name of the zone.
  • record_type (str or RecordType) – The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted). Possible values include: ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’
  • if_match (str) – The etag of the record set. Omit this value to always delete the current record set. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

CloudError

get(resource_group_name, zone_name, relative_record_set_name, record_type, custom_headers=None, raw=False, **operation_config)[source]

Gets a record set.

Parameters:
  • resource_group_name (str) – The name of the resource group.
  • zone_name (str) – The name of the DNS zone (without a terminating dot).
  • relative_record_set_name (str) – The name of the record set, relative to the name of the zone.
  • record_type (str or RecordType) – The type of DNS record in this record set. Possible values include: ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

RecordSet

Return type:

ClientRawResponse if raw=true

Raises:

CloudError

list_by_dns_zone(resource_group_name, zone_name, top=None, custom_headers=None, raw=False, **operation_config)[source]

Lists all record sets in a DNS zone.

Parameters:
  • resource_group_name (str) – The name of the resource group.
  • zone_name (str) – The name of the DNS zone (without a terminating dot).
  • top (int) – The maximum number of record sets to return. If not specified, returns up to 100 record sets.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

RecordSetPaged

Raises:

CloudError

list_by_type(resource_group_name, zone_name, record_type, top=None, custom_headers=None, raw=False, **operation_config)[source]

Lists the record sets of a specified type in a DNS zone.

Parameters:
  • resource_group_name (str) – The name of the resource group.
  • zone_name (str) – The name of the DNS zone (without a terminating dot).
  • record_type (str or RecordType) – The type of record sets to enumerate. Possible values include: ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’
  • top (int) – The maximum number of record sets to return. If not specified, returns up to 100 record sets.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

RecordSetPaged

Raises:

CloudError

update(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match=None, custom_headers=None, raw=False, **operation_config)[source]

Updates a record set within a DNS zone.

Parameters:
  • resource_group_name (str) – The name of the resource group.
  • zone_name (str) – The name of the DNS zone (without a terminating dot).
  • relative_record_set_name (str) – The name of the record set, relative to the name of the zone.
  • record_type (str or RecordType) – The type of DNS record in this record set. Possible values include: ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘PTR’, ‘SOA’, ‘SRV’, ‘TXT’
  • parameters (RecordSet) – Parameters supplied to the Update operation.
  • if_match (str) – The etag of the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag value to prevent accidentally overwritting concurrent changes.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

RecordSet

Return type:

ClientRawResponse if raw=true

Raises:

CloudError

class azure.mgmt.dns.operations.ZonesOperations(client, config, serializer, deserializer)[source]

Bases: object

ZonesOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An objec model deserializer.
Variables:

api_version – Specifies the API version. Constant value: “2016-04-01”.

create_or_update(resource_group_name, zone_name, parameters, if_match=None, if_none_match=None, custom_headers=None, raw=False, **operation_config)[source]

Creates or updates a DNS zone. Does not modify DNS records within the zone.

Parameters:
  • resource_group_name (str) – The name of the resource group.
  • zone_name (str) – The name of the DNS zone (without a terminating dot).
  • parameters (Zone) – Parameters supplied to the CreateOrUpdate operation.
  • if_match (str) – The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the last-seen etag value to prevent accidentally overwritting any concurrent changes.
  • if_none_match (str) – Set to ‘*’ to allow a new DNS zone to be created, but to prevent updating an existing zone. Other values will be ignored.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

Zone

Return type:

ClientRawResponse if raw=true

Raises:

CloudError

delete(resource_group_name, zone_name, if_match=None, custom_headers=None, raw=False, **operation_config)[source]

Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone.

Parameters:
  • resource_group_name (str) – The name of the resource group.
  • zone_name (str) – The name of the DNS zone (without a terminating dot).
  • if_match (str) – The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
Return type:

AzureOperationPoller instance that returns ZoneDeleteResult

Return type:

ClientRawResponse if raw=true

Raises:

CloudError

get(resource_group_name, zone_name, custom_headers=None, raw=False, **operation_config)[source]

Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone.

Parameters:
  • resource_group_name (str) – The name of the resource group.
  • zone_name (str) – The name of the DNS zone (without a terminating dot).
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

Zone

Return type:

ClientRawResponse if raw=true

Raises:

CloudError

list(top=None, custom_headers=None, raw=False, **operation_config)[source]

Lists the DNS zones in all resource groups in a subscription.

Parameters:
  • top (int) – The maximum number of DNS zones to return. If not specified, returns up to 100 zones.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

ZonePaged

Raises:

CloudError

list_by_resource_group(resource_group_name, top=None, custom_headers=None, raw=False, **operation_config)[source]

Lists the DNS zones within a resource group.

Parameters:
  • resource_group_name (str) – The name of the resource group.
  • top (int) – The maximum number of record sets to return. If not specified, returns up to 100 record sets.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Return type:

ZonePaged

Raises:

CloudError