diff --git a/azure-mgmt-dns/HISTORY.rst b/azure-mgmt-dns/HISTORY.rst index 9c32cc76c133..83faff32158a 100644 --- a/azure-mgmt-dns/HISTORY.rst +++ b/azure-mgmt-dns/HISTORY.rst @@ -3,6 +3,42 @@ Release History =============== +2.0.0rc2 (2018-07-05) ++++++++++++++++++++++ + +**Features** + +- Client class can be used as a context manager to keep the underlying HTTP session open for performance + +**General Breaking changes** + +This version uses a next-generation code generator that *might* introduce breaking changes. + +- Model signatures now use only keyword-argument syntax. All positional arguments must be re-written as keyword-arguments. + To keep auto-completion in most cases, models are now generated for Python 2 and Python 3. Python 3 uses the "*" syntax for keyword-only arguments. +- Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to improve the behavior when unrecognized enum values are encountered. + While this is not a breaking change, the distinctions are important, and are documented here: + https://docs.python.org/3/library/enum.html#others + At a glance: + + - "is" should not be used at all. + - "format" will return the string value, where "%s" string formatting will return `NameOfEnum.stringvalue`. Format syntax should be prefered. + +- New Long Running Operation: + + - Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same. + - Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used. + - The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`, + without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`. + - New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`, + the response of the initial call will be returned without polling. + - `polling` parameter accepts instances of subclasses of `msrest.polling.PollingMethod`. + - `add_done_callback` will no longer raise if called after polling is finished, but will instead execute the callback right away. + +**Bugfixes** + +- Compatibility of the sdist with wheel 0.31.0 + 2.0.0rc1 (2018-03-14) +++++++++++++++++++++ diff --git a/azure-mgmt-dns/azure/mgmt/dns/dns_management_client.py b/azure-mgmt-dns/azure/mgmt/dns/dns_management_client.py index e058dc4f77f8..5bcc6182a53a 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/dns_management_client.py +++ b/azure-mgmt-dns/azure/mgmt/dns/dns_management_client.py @@ -9,13 +9,13 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration + +from azure.profiles import KnownProfiles, ProfileDefinition +from azure.profiles.multiapiclient import MultiApiClientMixin from .version import VERSION -from .operations.record_sets_operations import RecordSetsOperations -from .operations.zones_operations import ZonesOperations -from . import models class DnsManagementClientConfiguration(AzureConfiguration): @@ -26,8 +26,7 @@ class DnsManagementClientConfiguration(AzureConfiguration): :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object` - :param subscription_id: Specifies the Azure subscription ID, which - uniquely identifies the Microsoft Azure subscription. + :param subscription_id: The Microsoft Azure subscription ID. :type subscription_id: str :param str base_url: Service URL """ @@ -51,38 +50,99 @@ def __init__( self.subscription_id = subscription_id -class DnsManagementClient(object): +class DnsManagementClient(MultiApiClientMixin, SDKClient): """The DNS Management Client. + This ready contains multiple API versions, to help you deal with all Azure clouds + (Azure Stack, Azure Government, Azure China, etc.). + By default, uses latest API version available on public Azure. + For production, you should stick a particular api-version and/or profile. + The profile sets a mapping between the operation group and an API version. + The api-version parameter sets the default API version if the operation + group is not described in the profile. + :ivar config: Configuration for client. :vartype config: DnsManagementClientConfiguration - :ivar record_sets: RecordSets operations - :vartype record_sets: azure.mgmt.dns.operations.RecordSetsOperations - :ivar zones: Zones operations - :vartype zones: azure.mgmt.dns.operations.ZonesOperations - :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object` - :param subscription_id: Specifies the Azure subscription ID, which - uniquely identifies the Microsoft Azure subscription. + :param subscription_id: The Microsoft Azure subscription ID. :type subscription_id: str + :param str api_version: API version to use if no profile is provided, or if + missing in profile. :param str base_url: Service URL + :param profile: A profile definition, from KnownProfiles to dict. + :type profile: azure.profiles.KnownProfiles """ - def __init__( - self, credentials, subscription_id, base_url=None): + DEFAULT_API_VERSION = '2018-03-01-preview' + _PROFILE_TAG = "azure.mgmt.dns.DnsManagementClient" + LATEST_PROFILE = ProfileDefinition({ + _PROFILE_TAG: { + None: DEFAULT_API_VERSION + }}, + _PROFILE_TAG + " latest" + ) + def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default): self.config = DnsManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2018-03-01-preview' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.record_sets = RecordSetsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.zones = ZonesOperations( - self._client, self.config, self._serialize, self._deserialize) + super(DnsManagementClient, self).__init__( + credentials, + self.config, + api_version=api_version, + profile=profile + ) + +############ Generated from here ############ + + @classmethod + def _models_dict(cls, api_version): + return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} + + @classmethod + def models(cls, api_version=DEFAULT_API_VERSION): + """Module depends on the API version: + + * 2016-04-01: :mod:`v2016_04_01.models` + * 2018-03-01-preview: :mod:`v2018_03_01_preview.models` + """ + if api_version == '2016-04-01': + from .v2016_04_01 import models + return models + elif api_version == '2018-03-01-preview': + from .v2018_03_01_preview import models + return models + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + + @property + def record_sets(self): + """Instance depends on the API version: + + * 2016-04-01: :class:`RecordSetsOperations` + * 2018-03-01-preview: :class:`RecordSetsOperations` + """ + api_version = self._get_api_version('record_sets') + if api_version == '2016-04-01': + from .v2016_04_01.operations import RecordSetsOperations as OperationClass + elif api_version == '2018-03-01-preview': + from .v2018_03_01_preview.operations import RecordSetsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def zones(self): + """Instance depends on the API version: + + * 2016-04-01: :class:`ZonesOperations` + * 2018-03-01-preview: :class:`ZonesOperations` + """ + api_version = self._get_api_version('zones') + if api_version == '2016-04-01': + from .v2016_04_01.operations import ZonesOperations as OperationClass + elif api_version == '2018-03-01-preview': + from .v2018_03_01_preview.operations import ZonesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/azure-mgmt-dns/azure/mgmt/dns/models.py b/azure-mgmt-dns/azure/mgmt/dns/models.py new file mode 100644 index 000000000000..c5c348397de9 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/models.py @@ -0,0 +1,7 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +from .v2018_03_01_preview.models import * \ No newline at end of file diff --git a/azure-mgmt-dns/azure/mgmt/dns/models/__init__.py b/azure-mgmt-dns/azure/mgmt/dns/models/__init__.py deleted file mode 100644 index 43d1fc220079..000000000000 --- a/azure-mgmt-dns/azure/mgmt/dns/models/__init__.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .arecord import ARecord -from .aaaa_record import AaaaRecord -from .mx_record import MxRecord -from .ns_record import NsRecord -from .ptr_record import PtrRecord -from .srv_record import SrvRecord -from .txt_record import TxtRecord -from .cname_record import CnameRecord -from .soa_record import SoaRecord -from .caa_record import CaaRecord -from .record_set import RecordSet -from .record_set_update_parameters import RecordSetUpdateParameters -from .sub_resource import SubResource -from .zone import Zone -from .zone_update import ZoneUpdate -from .resource import Resource -from .record_set_paged import RecordSetPaged -from .zone_paged import ZonePaged -from .dns_management_client_enums import ( - ZoneType, - RecordType, -) - -__all__ = [ - 'ARecord', - 'AaaaRecord', - 'MxRecord', - 'NsRecord', - 'PtrRecord', - 'SrvRecord', - 'TxtRecord', - 'CnameRecord', - 'SoaRecord', - 'CaaRecord', - 'RecordSet', - 'RecordSetUpdateParameters', - 'SubResource', - 'Zone', - 'ZoneUpdate', - 'Resource', - 'RecordSetPaged', - 'ZonePaged', - 'ZoneType', - 'RecordType', -] diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/__init__.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/__init__.py new file mode 100644 index 000000000000..07ed3e0ff7ee --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .dns_management_client import DnsManagementClient +from .version import VERSION + +__all__ = ['DnsManagementClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/dns_management_client.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/dns_management_client.py new file mode 100644 index 000000000000..e32b6110e1f0 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/dns_management_client.py @@ -0,0 +1,88 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.record_sets_operations import RecordSetsOperations +from .operations.zones_operations import ZonesOperations +from . import models + + +class DnsManagementClientConfiguration(AzureConfiguration): + """Configuration for DnsManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Specifies the Azure subscription ID, which + uniquely identifies the Microsoft Azure subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(DnsManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-dns/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class DnsManagementClient(SDKClient): + """The DNS Management Client. + + :ivar config: Configuration for client. + :vartype config: DnsManagementClientConfiguration + + :ivar record_sets: RecordSets operations + :vartype record_sets: azure.mgmt.dns.v2016_04_01.operations.RecordSetsOperations + :ivar zones: Zones operations + :vartype zones: azure.mgmt.dns.v2016_04_01.operations.ZonesOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Specifies the Azure subscription ID, which + uniquely identifies the Microsoft Azure subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = DnsManagementClientConfiguration(credentials, subscription_id, base_url) + super(DnsManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2016-04-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.record_sets = RecordSetsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.zones = ZonesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/__init__.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/__init__.py new file mode 100644 index 000000000000..71ed2203d818 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/__init__.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from .arecord_py3 import ARecord + from .aaaa_record_py3 import AaaaRecord + from .mx_record_py3 import MxRecord + from .ns_record_py3 import NsRecord + from .ptr_record_py3 import PtrRecord + from .srv_record_py3 import SrvRecord + from .txt_record_py3 import TxtRecord + from .cname_record_py3 import CnameRecord + from .soa_record_py3 import SoaRecord + from .record_set_py3 import RecordSet + from .record_set_update_parameters_py3 import RecordSetUpdateParameters + from .zone_py3 import Zone + from .zone_delete_result_py3 import ZoneDeleteResult + from .resource_py3 import Resource +except (SyntaxError, ImportError): + from .arecord import ARecord + from .aaaa_record import AaaaRecord + from .mx_record import MxRecord + from .ns_record import NsRecord + from .ptr_record import PtrRecord + from .srv_record import SrvRecord + from .txt_record import TxtRecord + from .cname_record import CnameRecord + from .soa_record import SoaRecord + from .record_set import RecordSet + from .record_set_update_parameters import RecordSetUpdateParameters + from .zone import Zone + from .zone_delete_result import ZoneDeleteResult + from .resource import Resource +from .record_set_paged import RecordSetPaged +from .zone_paged import ZonePaged +from .dns_management_client_enums import ( + OperationStatus, + HttpStatusCode, + RecordType, +) + +__all__ = [ + 'ARecord', + 'AaaaRecord', + 'MxRecord', + 'NsRecord', + 'PtrRecord', + 'SrvRecord', + 'TxtRecord', + 'CnameRecord', + 'SoaRecord', + 'RecordSet', + 'RecordSetUpdateParameters', + 'Zone', + 'ZoneDeleteResult', + 'Resource', + 'RecordSetPaged', + 'ZonePaged', + 'OperationStatus', + 'HttpStatusCode', + 'RecordType', +] diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/aaaa_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/aaaa_record.py new file mode 100644 index 000000000000..4f4b45183a80 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/aaaa_record.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AaaaRecord(Model): + """An AAAA record. + + :param ipv6_address: The IPv6 address of this AAAA record. + :type ipv6_address: str + """ + + _attribute_map = { + 'ipv6_address': {'key': 'ipv6Address', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AaaaRecord, self).__init__(**kwargs) + self.ipv6_address = kwargs.get('ipv6_address', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/models/aaaa_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/aaaa_record_py3.py similarity index 86% rename from azure-mgmt-dns/azure/mgmt/dns/models/aaaa_record.py rename to azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/aaaa_record_py3.py index 69167abed968..2cd662761ff9 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/models/aaaa_record.py +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/aaaa_record_py3.py @@ -23,6 +23,6 @@ class AaaaRecord(Model): 'ipv6_address': {'key': 'ipv6Address', 'type': 'str'}, } - def __init__(self, ipv6_address=None): - super(AaaaRecord, self).__init__() + def __init__(self, *, ipv6_address: str=None, **kwargs) -> None: + super(AaaaRecord, self).__init__(**kwargs) self.ipv6_address = ipv6_address diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/arecord.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/arecord.py new file mode 100644 index 000000000000..7172ccbb9011 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/arecord.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ARecord(Model): + """An A record. + + :param ipv4_address: The IPv4 address of this A record. + :type ipv4_address: str + """ + + _attribute_map = { + 'ipv4_address': {'key': 'ipv4Address', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ARecord, self).__init__(**kwargs) + self.ipv4_address = kwargs.get('ipv4_address', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/models/arecord.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/arecord_py3.py similarity index 87% rename from azure-mgmt-dns/azure/mgmt/dns/models/arecord.py rename to azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/arecord_py3.py index 430dd1b8cbfa..d38c7f033aae 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/models/arecord.py +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/arecord_py3.py @@ -23,6 +23,6 @@ class ARecord(Model): 'ipv4_address': {'key': 'ipv4Address', 'type': 'str'}, } - def __init__(self, ipv4_address=None): - super(ARecord, self).__init__() + def __init__(self, *, ipv4_address: str=None, **kwargs) -> None: + super(ARecord, self).__init__(**kwargs) self.ipv4_address = ipv4_address diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/cname_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/cname_record.py new file mode 100644 index 000000000000..3812539e3504 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/cname_record.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CnameRecord(Model): + """A CNAME record. + + :param cname: The canonical name for this CNAME record. + :type cname: str + """ + + _attribute_map = { + 'cname': {'key': 'cname', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CnameRecord, self).__init__(**kwargs) + self.cname = kwargs.get('cname', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/models/cname_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/cname_record_py3.py similarity index 86% rename from azure-mgmt-dns/azure/mgmt/dns/models/cname_record.py rename to azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/cname_record_py3.py index ddabfad14219..903f7071d615 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/models/cname_record.py +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/cname_record_py3.py @@ -23,6 +23,6 @@ class CnameRecord(Model): 'cname': {'key': 'cname', 'type': 'str'}, } - def __init__(self, cname=None): - super(CnameRecord, self).__init__() + def __init__(self, *, cname: str=None, **kwargs) -> None: + super(CnameRecord, self).__init__(**kwargs) self.cname = cname diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/dns_management_client_enums.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/dns_management_client_enums.py new file mode 100644 index 000000000000..8417b67339b5 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/dns_management_client_enums.py @@ -0,0 +1,83 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class OperationStatus(str, Enum): + + in_progress = "InProgress" + succeeded = "Succeeded" + failed = "Failed" + + +class HttpStatusCode(str, Enum): + + continue_enum = "Continue" + switching_protocols = "SwitchingProtocols" + ok = "OK" + created = "Created" + accepted = "Accepted" + non_authoritative_information = "NonAuthoritativeInformation" + no_content = "NoContent" + reset_content = "ResetContent" + partial_content = "PartialContent" + multiple_choices = "MultipleChoices" + ambiguous = "Ambiguous" + moved_permanently = "MovedPermanently" + moved = "Moved" + found = "Found" + redirect = "Redirect" + see_other = "SeeOther" + redirect_method = "RedirectMethod" + not_modified = "NotModified" + use_proxy = "UseProxy" + unused = "Unused" + temporary_redirect = "TemporaryRedirect" + redirect_keep_verb = "RedirectKeepVerb" + bad_request = "BadRequest" + unauthorized = "Unauthorized" + payment_required = "PaymentRequired" + forbidden = "Forbidden" + not_found = "NotFound" + method_not_allowed = "MethodNotAllowed" + not_acceptable = "NotAcceptable" + proxy_authentication_required = "ProxyAuthenticationRequired" + request_timeout = "RequestTimeout" + conflict = "Conflict" + gone = "Gone" + length_required = "LengthRequired" + precondition_failed = "PreconditionFailed" + request_entity_too_large = "RequestEntityTooLarge" + request_uri_too_long = "RequestUriTooLong" + unsupported_media_type = "UnsupportedMediaType" + requested_range_not_satisfiable = "RequestedRangeNotSatisfiable" + expectation_failed = "ExpectationFailed" + upgrade_required = "UpgradeRequired" + internal_server_error = "InternalServerError" + not_implemented = "NotImplemented" + bad_gateway = "BadGateway" + service_unavailable = "ServiceUnavailable" + gateway_timeout = "GatewayTimeout" + http_version_not_supported = "HttpVersionNotSupported" + + +class RecordType(str, Enum): + + a = "A" + aaaa = "AAAA" + cname = "CNAME" + mx = "MX" + ns = "NS" + ptr = "PTR" + soa = "SOA" + srv = "SRV" + txt = "TXT" diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/mx_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/mx_record.py new file mode 100644 index 000000000000..8027663c4de5 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/mx_record.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MxRecord(Model): + """An MX record. + + :param preference: The preference value for this MX record. + :type preference: int + :param exchange: The domain name of the mail host for this MX record. + :type exchange: str + """ + + _attribute_map = { + 'preference': {'key': 'preference', 'type': 'int'}, + 'exchange': {'key': 'exchange', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MxRecord, self).__init__(**kwargs) + self.preference = kwargs.get('preference', None) + self.exchange = kwargs.get('exchange', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/models/mx_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/mx_record_py3.py similarity index 87% rename from azure-mgmt-dns/azure/mgmt/dns/models/mx_record.py rename to azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/mx_record_py3.py index 6484a057c797..6476cd65eb3a 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/models/mx_record.py +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/mx_record_py3.py @@ -26,7 +26,7 @@ class MxRecord(Model): 'exchange': {'key': 'exchange', 'type': 'str'}, } - def __init__(self, preference=None, exchange=None): - super(MxRecord, self).__init__() + def __init__(self, *, preference: int=None, exchange: str=None, **kwargs) -> None: + super(MxRecord, self).__init__(**kwargs) self.preference = preference self.exchange = exchange diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/ns_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/ns_record.py new file mode 100644 index 000000000000..ecef3918a591 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/ns_record.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NsRecord(Model): + """An NS record. + + :param nsdname: The name server name for this NS record. + :type nsdname: str + """ + + _attribute_map = { + 'nsdname': {'key': 'nsdname', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NsRecord, self).__init__(**kwargs) + self.nsdname = kwargs.get('nsdname', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/models/ns_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/ns_record_py3.py similarity index 87% rename from azure-mgmt-dns/azure/mgmt/dns/models/ns_record.py rename to azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/ns_record_py3.py index ccfa7d0ab809..c13d10f102e1 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/models/ns_record.py +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/ns_record_py3.py @@ -23,6 +23,6 @@ class NsRecord(Model): 'nsdname': {'key': 'nsdname', 'type': 'str'}, } - def __init__(self, nsdname=None): - super(NsRecord, self).__init__() + def __init__(self, *, nsdname: str=None, **kwargs) -> None: + super(NsRecord, self).__init__(**kwargs) self.nsdname = nsdname diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/ptr_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/ptr_record.py new file mode 100644 index 000000000000..1b14721c9855 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/ptr_record.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PtrRecord(Model): + """A PTR record. + + :param ptrdname: The PTR target domain name for this PTR record. + :type ptrdname: str + """ + + _attribute_map = { + 'ptrdname': {'key': 'ptrdname', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PtrRecord, self).__init__(**kwargs) + self.ptrdname = kwargs.get('ptrdname', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/models/ptr_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/ptr_record_py3.py similarity index 87% rename from azure-mgmt-dns/azure/mgmt/dns/models/ptr_record.py rename to azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/ptr_record_py3.py index ea9404669788..523afce05a26 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/models/ptr_record.py +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/ptr_record_py3.py @@ -23,6 +23,6 @@ class PtrRecord(Model): 'ptrdname': {'key': 'ptrdname', 'type': 'str'}, } - def __init__(self, ptrdname=None): - super(PtrRecord, self).__init__() + def __init__(self, *, ptrdname: str=None, **kwargs) -> None: + super(PtrRecord, self).__init__(**kwargs) self.ptrdname = ptrdname diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/record_set.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/record_set.py new file mode 100644 index 000000000000..077b7075a41e --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/record_set.py @@ -0,0 +1,85 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RecordSet(Model): + """Describes a DNS record set (a collection of DNS records with the same name + and type). + + :param id: The ID of the record set. + :type id: str + :param name: The name of the record set. + :type name: str + :param type: The type of the record set. + :type type: str + :param etag: The etag of the record set. + :type etag: str + :param metadata: The metadata attached to the record set. + :type metadata: dict[str, str] + :param ttl: The TTL (time-to-live) of the records in the record set. + :type ttl: long + :param arecords: The list of A records in the record set. + :type arecords: list[~azure.mgmt.dns.v2016_04_01.models.ARecord] + :param aaaa_records: The list of AAAA records in the record set. + :type aaaa_records: list[~azure.mgmt.dns.v2016_04_01.models.AaaaRecord] + :param mx_records: The list of MX records in the record set. + :type mx_records: list[~azure.mgmt.dns.v2016_04_01.models.MxRecord] + :param ns_records: The list of NS records in the record set. + :type ns_records: list[~azure.mgmt.dns.v2016_04_01.models.NsRecord] + :param ptr_records: The list of PTR records in the record set. + :type ptr_records: list[~azure.mgmt.dns.v2016_04_01.models.PtrRecord] + :param srv_records: The list of SRV records in the record set. + :type srv_records: list[~azure.mgmt.dns.v2016_04_01.models.SrvRecord] + :param txt_records: The list of TXT records in the record set. + :type txt_records: list[~azure.mgmt.dns.v2016_04_01.models.TxtRecord] + :param cname_record: The CNAME record in the record set. + :type cname_record: ~azure.mgmt.dns.v2016_04_01.models.CnameRecord + :param soa_record: The SOA record in the record set. + :type soa_record: ~azure.mgmt.dns.v2016_04_01.models.SoaRecord + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'ttl': {'key': 'properties.TTL', 'type': 'long'}, + 'arecords': {'key': 'properties.ARecords', 'type': '[ARecord]'}, + 'aaaa_records': {'key': 'properties.AAAARecords', 'type': '[AaaaRecord]'}, + 'mx_records': {'key': 'properties.MXRecords', 'type': '[MxRecord]'}, + 'ns_records': {'key': 'properties.NSRecords', 'type': '[NsRecord]'}, + 'ptr_records': {'key': 'properties.PTRRecords', 'type': '[PtrRecord]'}, + 'srv_records': {'key': 'properties.SRVRecords', 'type': '[SrvRecord]'}, + 'txt_records': {'key': 'properties.TXTRecords', 'type': '[TxtRecord]'}, + 'cname_record': {'key': 'properties.CNAMERecord', 'type': 'CnameRecord'}, + 'soa_record': {'key': 'properties.SOARecord', 'type': 'SoaRecord'}, + } + + def __init__(self, **kwargs): + super(RecordSet, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.etag = kwargs.get('etag', None) + self.metadata = kwargs.get('metadata', None) + self.ttl = kwargs.get('ttl', None) + self.arecords = kwargs.get('arecords', None) + self.aaaa_records = kwargs.get('aaaa_records', None) + self.mx_records = kwargs.get('mx_records', None) + self.ns_records = kwargs.get('ns_records', None) + self.ptr_records = kwargs.get('ptr_records', None) + self.srv_records = kwargs.get('srv_records', None) + self.txt_records = kwargs.get('txt_records', None) + self.cname_record = kwargs.get('cname_record', None) + self.soa_record = kwargs.get('soa_record', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/models/record_set_paged.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/record_set_paged.py similarity index 93% rename from azure-mgmt-dns/azure/mgmt/dns/models/record_set_paged.py rename to azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/record_set_paged.py index a4ba99f0e823..cd52f860d274 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/models/record_set_paged.py +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/record_set_paged.py @@ -14,7 +14,7 @@ class RecordSetPaged(Paged): """ - A paging container for iterating over a list of :class:`RecordSet ` object + A paging container for iterating over a list of :class:`RecordSet ` object """ _attribute_map = { diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/record_set_py3.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/record_set_py3.py new file mode 100644 index 000000000000..883409893449 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/record_set_py3.py @@ -0,0 +1,85 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RecordSet(Model): + """Describes a DNS record set (a collection of DNS records with the same name + and type). + + :param id: The ID of the record set. + :type id: str + :param name: The name of the record set. + :type name: str + :param type: The type of the record set. + :type type: str + :param etag: The etag of the record set. + :type etag: str + :param metadata: The metadata attached to the record set. + :type metadata: dict[str, str] + :param ttl: The TTL (time-to-live) of the records in the record set. + :type ttl: long + :param arecords: The list of A records in the record set. + :type arecords: list[~azure.mgmt.dns.v2016_04_01.models.ARecord] + :param aaaa_records: The list of AAAA records in the record set. + :type aaaa_records: list[~azure.mgmt.dns.v2016_04_01.models.AaaaRecord] + :param mx_records: The list of MX records in the record set. + :type mx_records: list[~azure.mgmt.dns.v2016_04_01.models.MxRecord] + :param ns_records: The list of NS records in the record set. + :type ns_records: list[~azure.mgmt.dns.v2016_04_01.models.NsRecord] + :param ptr_records: The list of PTR records in the record set. + :type ptr_records: list[~azure.mgmt.dns.v2016_04_01.models.PtrRecord] + :param srv_records: The list of SRV records in the record set. + :type srv_records: list[~azure.mgmt.dns.v2016_04_01.models.SrvRecord] + :param txt_records: The list of TXT records in the record set. + :type txt_records: list[~azure.mgmt.dns.v2016_04_01.models.TxtRecord] + :param cname_record: The CNAME record in the record set. + :type cname_record: ~azure.mgmt.dns.v2016_04_01.models.CnameRecord + :param soa_record: The SOA record in the record set. + :type soa_record: ~azure.mgmt.dns.v2016_04_01.models.SoaRecord + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'ttl': {'key': 'properties.TTL', 'type': 'long'}, + 'arecords': {'key': 'properties.ARecords', 'type': '[ARecord]'}, + 'aaaa_records': {'key': 'properties.AAAARecords', 'type': '[AaaaRecord]'}, + 'mx_records': {'key': 'properties.MXRecords', 'type': '[MxRecord]'}, + 'ns_records': {'key': 'properties.NSRecords', 'type': '[NsRecord]'}, + 'ptr_records': {'key': 'properties.PTRRecords', 'type': '[PtrRecord]'}, + 'srv_records': {'key': 'properties.SRVRecords', 'type': '[SrvRecord]'}, + 'txt_records': {'key': 'properties.TXTRecords', 'type': '[TxtRecord]'}, + 'cname_record': {'key': 'properties.CNAMERecord', 'type': 'CnameRecord'}, + 'soa_record': {'key': 'properties.SOARecord', 'type': 'SoaRecord'}, + } + + def __init__(self, *, id: str=None, name: str=None, type: str=None, etag: str=None, metadata=None, ttl: int=None, arecords=None, aaaa_records=None, mx_records=None, ns_records=None, ptr_records=None, srv_records=None, txt_records=None, cname_record=None, soa_record=None, **kwargs) -> None: + super(RecordSet, self).__init__(**kwargs) + self.id = id + self.name = name + self.type = type + self.etag = etag + self.metadata = metadata + self.ttl = ttl + self.arecords = arecords + self.aaaa_records = aaaa_records + self.mx_records = mx_records + self.ns_records = ns_records + self.ptr_records = ptr_records + self.srv_records = srv_records + self.txt_records = txt_records + self.cname_record = cname_record + self.soa_record = soa_record diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/record_set_update_parameters.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/record_set_update_parameters.py new file mode 100644 index 000000000000..09979a9eae58 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/record_set_update_parameters.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RecordSetUpdateParameters(Model): + """Parameters supplied to update a record set. + + :param record_set: Specifies information about the record set being + updated. + :type record_set: ~azure.mgmt.dns.v2016_04_01.models.RecordSet + """ + + _attribute_map = { + 'record_set': {'key': 'RecordSet', 'type': 'RecordSet'}, + } + + def __init__(self, **kwargs): + super(RecordSetUpdateParameters, self).__init__(**kwargs) + self.record_set = kwargs.get('record_set', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/models/record_set_update_parameters.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/record_set_update_parameters_py3.py similarity index 81% rename from azure-mgmt-dns/azure/mgmt/dns/models/record_set_update_parameters.py rename to azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/record_set_update_parameters_py3.py index 7cefe40b9e3d..c61dde58eb8c 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/models/record_set_update_parameters.py +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/record_set_update_parameters_py3.py @@ -17,13 +17,13 @@ class RecordSetUpdateParameters(Model): :param record_set: Specifies information about the record set being updated. - :type record_set: ~azure.mgmt.dns.models.RecordSet + :type record_set: ~azure.mgmt.dns.v2016_04_01.models.RecordSet """ _attribute_map = { 'record_set': {'key': 'RecordSet', 'type': 'RecordSet'}, } - def __init__(self, record_set=None): - super(RecordSetUpdateParameters, self).__init__() + def __init__(self, *, record_set=None, **kwargs) -> None: + super(RecordSetUpdateParameters, self).__init__(**kwargs) self.record_set = record_set diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/resource.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/resource.py new file mode 100644 index 000000000000..86932cffa525 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/resource.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/resource_py3.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/resource_py3.py new file mode 100644 index 000000000000..01bf8dd86a28 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/resource_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/soa_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/soa_record.py new file mode 100644 index 000000000000..c38fcd00789c --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/soa_record.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SoaRecord(Model): + """An SOA record. + + :param host: The domain name of the authoritative name server for this SOA + record. + :type host: str + :param email: The email contact for this SOA record. + :type email: str + :param serial_number: The serial number for this SOA record. + :type serial_number: long + :param refresh_time: The refresh value for this SOA record. + :type refresh_time: long + :param retry_time: The retry time for this SOA record. + :type retry_time: long + :param expire_time: The expire time for this SOA record. + :type expire_time: long + :param minimum_ttl: The minimum value for this SOA record. By convention + this is used to determine the negative caching duration. + :type minimum_ttl: long + """ + + _attribute_map = { + 'host': {'key': 'host', 'type': 'str'}, + 'email': {'key': 'email', 'type': 'str'}, + 'serial_number': {'key': 'serialNumber', 'type': 'long'}, + 'refresh_time': {'key': 'refreshTime', 'type': 'long'}, + 'retry_time': {'key': 'retryTime', 'type': 'long'}, + 'expire_time': {'key': 'expireTime', 'type': 'long'}, + 'minimum_ttl': {'key': 'minimumTTL', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(SoaRecord, self).__init__(**kwargs) + self.host = kwargs.get('host', None) + self.email = kwargs.get('email', None) + self.serial_number = kwargs.get('serial_number', None) + self.refresh_time = kwargs.get('refresh_time', None) + self.retry_time = kwargs.get('retry_time', None) + self.expire_time = kwargs.get('expire_time', None) + self.minimum_ttl = kwargs.get('minimum_ttl', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/models/soa_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/soa_record_py3.py similarity index 89% rename from azure-mgmt-dns/azure/mgmt/dns/models/soa_record.py rename to azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/soa_record_py3.py index e96c7ac113bc..a9143fa2359b 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/models/soa_record.py +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/soa_record_py3.py @@ -43,8 +43,8 @@ class SoaRecord(Model): 'minimum_ttl': {'key': 'minimumTTL', 'type': 'long'}, } - def __init__(self, host=None, email=None, serial_number=None, refresh_time=None, retry_time=None, expire_time=None, minimum_ttl=None): - super(SoaRecord, self).__init__() + def __init__(self, *, host: str=None, email: str=None, serial_number: int=None, refresh_time: int=None, retry_time: int=None, expire_time: int=None, minimum_ttl: int=None, **kwargs) -> None: + super(SoaRecord, self).__init__(**kwargs) self.host = host self.email = email self.serial_number = serial_number diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/srv_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/srv_record.py new file mode 100644 index 000000000000..c7dc5fcdcbbd --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/srv_record.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SrvRecord(Model): + """An SRV record. + + :param priority: The priority value for this SRV record. + :type priority: int + :param weight: The weight value for this SRV record. + :type weight: int + :param port: The port value for this SRV record. + :type port: int + :param target: The target domain name for this SRV record. + :type target: str + """ + + _attribute_map = { + 'priority': {'key': 'priority', 'type': 'int'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'port': {'key': 'port', 'type': 'int'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SrvRecord, self).__init__(**kwargs) + self.priority = kwargs.get('priority', None) + self.weight = kwargs.get('weight', None) + self.port = kwargs.get('port', None) + self.target = kwargs.get('target', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/models/srv_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/srv_record_py3.py similarity index 88% rename from azure-mgmt-dns/azure/mgmt/dns/models/srv_record.py rename to azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/srv_record_py3.py index 5ed7d4b25f8e..9a464f27cb09 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/models/srv_record.py +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/srv_record_py3.py @@ -32,8 +32,8 @@ class SrvRecord(Model): 'target': {'key': 'target', 'type': 'str'}, } - def __init__(self, priority=None, weight=None, port=None, target=None): - super(SrvRecord, self).__init__() + def __init__(self, *, priority: int=None, weight: int=None, port: int=None, target: str=None, **kwargs) -> None: + super(SrvRecord, self).__init__(**kwargs) self.priority = priority self.weight = weight self.port = port diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/txt_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/txt_record.py new file mode 100644 index 000000000000..472f1f22b5d3 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/txt_record.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TxtRecord(Model): + """A TXT record. + + :param value: The text value of this TXT record. + :type value: list[str] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(TxtRecord, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/models/txt_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/txt_record_py3.py similarity index 87% rename from azure-mgmt-dns/azure/mgmt/dns/models/txt_record.py rename to azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/txt_record_py3.py index 5d1e5adfcf0d..4faef766e859 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/models/txt_record.py +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/txt_record_py3.py @@ -23,6 +23,6 @@ class TxtRecord(Model): 'value': {'key': 'value', 'type': '[str]'}, } - def __init__(self, value=None): - super(TxtRecord, self).__init__() + def __init__(self, *, value=None, **kwargs) -> None: + super(TxtRecord, self).__init__(**kwargs) self.value = value diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/zone.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/zone.py new file mode 100644 index 000000000000..d21f41c504e3 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/zone.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Zone(Resource): + """Describes a DNS zone. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param etag: The etag of the zone. + :type etag: str + :param max_number_of_record_sets: The maximum number of record sets that + can be created in this DNS zone. This is a read-only property and any + attempt to set this value will be ignored. + :type max_number_of_record_sets: long + :param number_of_record_sets: The current number of record sets in this + DNS zone. This is a read-only property and any attempt to set this value + will be ignored. + :type number_of_record_sets: long + :ivar name_servers: The name servers for this DNS zone. This is a + read-only property and any attempt to set this value will be ignored. + :vartype name_servers: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'name_servers': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'max_number_of_record_sets': {'key': 'properties.maxNumberOfRecordSets', 'type': 'long'}, + 'number_of_record_sets': {'key': 'properties.numberOfRecordSets', 'type': 'long'}, + 'name_servers': {'key': 'properties.nameServers', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(Zone, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) + self.max_number_of_record_sets = kwargs.get('max_number_of_record_sets', None) + self.number_of_record_sets = kwargs.get('number_of_record_sets', None) + self.name_servers = None diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/zone_delete_result.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/zone_delete_result.py new file mode 100644 index 000000000000..8db3553274b3 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/zone_delete_result.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ZoneDeleteResult(Model): + """The response to a Zone Delete operation. + + :param azure_async_operation: Users can perform a Get on + Azure-AsyncOperation to get the status of their delete Zone operations. + :type azure_async_operation: str + :param status: Possible values include: 'InProgress', 'Succeeded', + 'Failed' + :type status: str or ~azure.mgmt.dns.v2016_04_01.models.OperationStatus + :param status_code: Possible values include: 'Continue', + 'SwitchingProtocols', 'OK', 'Created', 'Accepted', + 'NonAuthoritativeInformation', 'NoContent', 'ResetContent', + 'PartialContent', 'MultipleChoices', 'Ambiguous', 'MovedPermanently', + 'Moved', 'Found', 'Redirect', 'SeeOther', 'RedirectMethod', 'NotModified', + 'UseProxy', 'Unused', 'TemporaryRedirect', 'RedirectKeepVerb', + 'BadRequest', 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', + 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', + 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', + 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestUriTooLong', + 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', + 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', + 'NotImplemented', 'BadGateway', 'ServiceUnavailable', 'GatewayTimeout', + 'HttpVersionNotSupported' + :type status_code: str or + ~azure.mgmt.dns.v2016_04_01.models.HttpStatusCode + :param request_id: + :type request_id: str + """ + + _attribute_map = { + 'azure_async_operation': {'key': 'azureAsyncOperation', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'OperationStatus'}, + 'status_code': {'key': 'statusCode', 'type': 'HttpStatusCode'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ZoneDeleteResult, self).__init__(**kwargs) + self.azure_async_operation = kwargs.get('azure_async_operation', None) + self.status = kwargs.get('status', None) + self.status_code = kwargs.get('status_code', None) + self.request_id = kwargs.get('request_id', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/zone_delete_result_py3.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/zone_delete_result_py3.py new file mode 100644 index 000000000000..8f6ef4e51c51 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/zone_delete_result_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ZoneDeleteResult(Model): + """The response to a Zone Delete operation. + + :param azure_async_operation: Users can perform a Get on + Azure-AsyncOperation to get the status of their delete Zone operations. + :type azure_async_operation: str + :param status: Possible values include: 'InProgress', 'Succeeded', + 'Failed' + :type status: str or ~azure.mgmt.dns.v2016_04_01.models.OperationStatus + :param status_code: Possible values include: 'Continue', + 'SwitchingProtocols', 'OK', 'Created', 'Accepted', + 'NonAuthoritativeInformation', 'NoContent', 'ResetContent', + 'PartialContent', 'MultipleChoices', 'Ambiguous', 'MovedPermanently', + 'Moved', 'Found', 'Redirect', 'SeeOther', 'RedirectMethod', 'NotModified', + 'UseProxy', 'Unused', 'TemporaryRedirect', 'RedirectKeepVerb', + 'BadRequest', 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', + 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', + 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', + 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestUriTooLong', + 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', + 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', + 'NotImplemented', 'BadGateway', 'ServiceUnavailable', 'GatewayTimeout', + 'HttpVersionNotSupported' + :type status_code: str or + ~azure.mgmt.dns.v2016_04_01.models.HttpStatusCode + :param request_id: + :type request_id: str + """ + + _attribute_map = { + 'azure_async_operation': {'key': 'azureAsyncOperation', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'OperationStatus'}, + 'status_code': {'key': 'statusCode', 'type': 'HttpStatusCode'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + } + + def __init__(self, *, azure_async_operation: str=None, status=None, status_code=None, request_id: str=None, **kwargs) -> None: + super(ZoneDeleteResult, self).__init__(**kwargs) + self.azure_async_operation = azure_async_operation + self.status = status + self.status_code = status_code + self.request_id = request_id diff --git a/azure-mgmt-dns/azure/mgmt/dns/models/zone_paged.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/zone_paged.py similarity index 94% rename from azure-mgmt-dns/azure/mgmt/dns/models/zone_paged.py rename to azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/zone_paged.py index d0f6a3635c22..7d910d1cd024 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/models/zone_paged.py +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/zone_paged.py @@ -14,7 +14,7 @@ class ZonePaged(Paged): """ - A paging container for iterating over a list of :class:`Zone ` object + A paging container for iterating over a list of :class:`Zone ` object """ _attribute_map = { diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/zone_py3.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/zone_py3.py new file mode 100644 index 000000000000..42a768f46026 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/models/zone_py3.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class Zone(Resource): + """Describes a DNS zone. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param etag: The etag of the zone. + :type etag: str + :param max_number_of_record_sets: The maximum number of record sets that + can be created in this DNS zone. This is a read-only property and any + attempt to set this value will be ignored. + :type max_number_of_record_sets: long + :param number_of_record_sets: The current number of record sets in this + DNS zone. This is a read-only property and any attempt to set this value + will be ignored. + :type number_of_record_sets: long + :ivar name_servers: The name servers for this DNS zone. This is a + read-only property and any attempt to set this value will be ignored. + :vartype name_servers: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'name_servers': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'max_number_of_record_sets': {'key': 'properties.maxNumberOfRecordSets', 'type': 'long'}, + 'number_of_record_sets': {'key': 'properties.numberOfRecordSets', 'type': 'long'}, + 'name_servers': {'key': 'properties.nameServers', 'type': '[str]'}, + } + + def __init__(self, *, location: str, tags=None, etag: str=None, max_number_of_record_sets: int=None, number_of_record_sets: int=None, **kwargs) -> None: + super(Zone, self).__init__(location=location, tags=tags, **kwargs) + self.etag = etag + self.max_number_of_record_sets = max_number_of_record_sets + self.number_of_record_sets = number_of_record_sets + self.name_servers = None diff --git a/azure-mgmt-dns/azure/mgmt/dns/operations/__init__.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/operations/__init__.py similarity index 100% rename from azure-mgmt-dns/azure/mgmt/dns/operations/__init__.py rename to azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/operations/__init__.py diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/operations/record_sets_operations.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/operations/record_sets_operations.py new file mode 100644 index 000000000000..5681d71aca33 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/operations/record_sets_operations.py @@ -0,0 +1,543 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class RecordSetsOperations(object): + """RecordSetsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Specifies the API version. Constant value: "2016-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-04-01" + + self.config = config + + def update( + self, resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): + """Updates a record set within a DNS zone. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param zone_name: The name of the DNS zone (without a terminating + dot). + :type zone_name: str + :param relative_record_set_name: The name of the record set, relative + to the name of the zone. + :type relative_record_set_name: str + :param record_type: The type of DNS record in this record set. + Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', + 'SOA', 'SRV', 'TXT' + :type record_type: str or + ~azure.mgmt.dns.v2016_04_01.models.RecordType + :param parameters: Parameters supplied to the Update operation. + :type parameters: ~azure.mgmt.dns.v2016_04_01.models.RecordSet + :param if_match: 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. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RecordSet or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.dns.v2016_04_01.models.RecordSet or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'zoneName': self._serialize.url("zone_name", zone_name, 'str'), + 'relativeRecordSetName': self._serialize.url("relative_record_set_name", relative_record_set_name, 'str', skip_quote=True), + 'recordType': self._serialize.url("record_type", record_type, 'RecordType'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'RecordSet') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RecordSet', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}'} + + def create_or_update( + self, 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): + """Creates or updates a record set within a DNS zone. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param zone_name: The name of the DNS zone (without a terminating + dot). + :type zone_name: str + :param relative_record_set_name: The name of the record set, relative + to the name of the zone. + :type relative_record_set_name: str + :param record_type: 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' + :type record_type: str or + ~azure.mgmt.dns.v2016_04_01.models.RecordType + :param parameters: Parameters supplied to the CreateOrUpdate + operation. + :type parameters: ~azure.mgmt.dns.v2016_04_01.models.RecordSet + :param if_match: 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. + :type if_match: str + :param if_none_match: Set to '*' to allow a new record set to be + created, but to prevent updating an existing record set. Other values + will be ignored. + :type if_none_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RecordSet or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.dns.v2016_04_01.models.RecordSet or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'zoneName': self._serialize.url("zone_name", zone_name, 'str'), + 'relativeRecordSetName': self._serialize.url("relative_record_set_name", relative_record_set_name, 'str', skip_quote=True), + 'recordType': self._serialize.url("record_type", record_type, 'RecordType'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'RecordSet') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RecordSet', response) + if response.status_code == 201: + deserialized = self._deserialize('RecordSet', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}'} + + def delete( + self, resource_group_name, zone_name, relative_record_set_name, record_type, if_match=None, custom_headers=None, raw=False, **operation_config): + """Deletes a record set from a DNS zone. This operation cannot be undone. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param zone_name: The name of the DNS zone (without a terminating + dot). + :type zone_name: str + :param relative_record_set_name: The name of the record set, relative + to the name of the zone. + :type relative_record_set_name: str + :param record_type: 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' + :type record_type: str or + ~azure.mgmt.dns.v2016_04_01.models.RecordType + :param if_match: 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. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'zoneName': self._serialize.url("zone_name", zone_name, 'str'), + 'relativeRecordSetName': self._serialize.url("relative_record_set_name", relative_record_set_name, 'str', skip_quote=True), + 'recordType': self._serialize.url("record_type", record_type, 'RecordType'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}'} + + def get( + self, resource_group_name, zone_name, relative_record_set_name, record_type, custom_headers=None, raw=False, **operation_config): + """Gets a record set. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param zone_name: The name of the DNS zone (without a terminating + dot). + :type zone_name: str + :param relative_record_set_name: The name of the record set, relative + to the name of the zone. + :type relative_record_set_name: str + :param record_type: The type of DNS record in this record set. + Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', + 'SOA', 'SRV', 'TXT' + :type record_type: str or + ~azure.mgmt.dns.v2016_04_01.models.RecordType + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RecordSet or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.dns.v2016_04_01.models.RecordSet or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'zoneName': self._serialize.url("zone_name", zone_name, 'str'), + 'relativeRecordSetName': self._serialize.url("relative_record_set_name", relative_record_set_name, 'str', skip_quote=True), + 'recordType': self._serialize.url("record_type", record_type, 'RecordType'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RecordSet', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}'} + + def list_by_type( + self, resource_group_name, zone_name, record_type, top=None, recordsetnamesuffix=None, custom_headers=None, raw=False, **operation_config): + """Lists the record sets of a specified type in a DNS zone. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param zone_name: The name of the DNS zone (without a terminating + dot). + :type zone_name: str + :param record_type: The type of record sets to enumerate. Possible + values include: 'A', 'AAAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', + 'TXT' + :type record_type: str or + ~azure.mgmt.dns.v2016_04_01.models.RecordType + :param top: The maximum number of record sets to return. If not + specified, returns up to 100 record sets. + :type top: int + :param recordsetnamesuffix: The suffix label of the record set name + that has to be used to filter the record set enumerations. If this + parameter is specified, Enumeration will return only records that end + with . + :type recordsetnamesuffix: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of RecordSet + :rtype: + ~azure.mgmt.dns.v2016_04_01.models.RecordSetPaged[~azure.mgmt.dns.v2016_04_01.models.RecordSet] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_type.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'zoneName': self._serialize.url("zone_name", zone_name, 'str'), + 'recordType': self._serialize.url("record_type", record_type, 'RecordType'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if recordsetnamesuffix is not None: + query_parameters['$recordsetnamesuffix'] = self._serialize.query("recordsetnamesuffix", recordsetnamesuffix, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.RecordSetPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RecordSetPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_type.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}'} + + def list_by_dns_zone( + self, resource_group_name, zone_name, top=None, recordsetnamesuffix=None, custom_headers=None, raw=False, **operation_config): + """Lists all record sets in a DNS zone. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param zone_name: The name of the DNS zone (without a terminating + dot). + :type zone_name: str + :param top: The maximum number of record sets to return. If not + specified, returns up to 100 record sets. + :type top: int + :param recordsetnamesuffix: The suffix label of the record set name + that has to be used to filter the record set enumerations. If this + parameter is specified, Enumeration will return only records that end + with . + :type recordsetnamesuffix: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of RecordSet + :rtype: + ~azure.mgmt.dns.v2016_04_01.models.RecordSetPaged[~azure.mgmt.dns.v2016_04_01.models.RecordSet] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_dns_zone.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'zoneName': self._serialize.url("zone_name", zone_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if recordsetnamesuffix is not None: + query_parameters['$recordsetnamesuffix'] = self._serialize.query("recordsetnamesuffix", recordsetnamesuffix, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.RecordSetPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RecordSetPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_dns_zone.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/recordsets'} diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/operations/zones_operations.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/operations/zones_operations.py new file mode 100644 index 000000000000..1c388c7ef1bc --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/operations/zones_operations.py @@ -0,0 +1,438 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ZonesOperations(object): + """ZonesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Specifies the API version. Constant value: "2016-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-04-01" + + self.config = config + + def create_or_update( + self, resource_group_name, zone_name, parameters, if_match=None, if_none_match=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates a DNS zone. Does not modify DNS records within the + zone. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param zone_name: The name of the DNS zone (without a terminating + dot). + :type zone_name: str + :param parameters: Parameters supplied to the CreateOrUpdate + operation. + :type parameters: ~azure.mgmt.dns.v2016_04_01.models.Zone + :param if_match: 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. + :type if_match: str + :param if_none_match: Set to '*' to allow a new DNS zone to be + created, but to prevent updating an existing zone. Other values will + be ignored. + :type if_none_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Zone or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.dns.v2016_04_01.models.Zone or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'zoneName': self._serialize.url("zone_name", zone_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'Zone') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Zone', response) + if response.status_code == 201: + deserialized = self._deserialize('Zone', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}'} + + + def _delete_initial( + self, resource_group_name, zone_name, if_match=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'zoneName': self._serialize.url("zone_name", zone_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ZoneDeleteResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def delete( + self, resource_group_name, zone_name, if_match=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a DNS zone. WARNING: All DNS records in the zone will also be + deleted. This operation cannot be undone. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param zone_name: The name of the DNS zone (without a terminating + dot). + :type zone_name: str + :param if_match: 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. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ZoneDeleteResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.dns.v2016_04_01.models.ZoneDeleteResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.dns.v2016_04_01.models.ZoneDeleteResult]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + zone_name=zone_name, + if_match=if_match, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ZoneDeleteResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}'} + + def get( + self, resource_group_name, zone_name, custom_headers=None, raw=False, **operation_config): + """Gets a DNS zone. Retrieves the zone properties, but not the record sets + within the zone. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param zone_name: The name of the DNS zone (without a terminating + dot). + :type zone_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Zone or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.dns.v2016_04_01.models.Zone or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'zoneName': self._serialize.url("zone_name", zone_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Zone', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}'} + + def list_by_resource_group( + self, resource_group_name, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the DNS zones within a resource group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param top: The maximum number of record sets to return. If not + specified, returns up to 100 record sets. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Zone + :rtype: + ~azure.mgmt.dns.v2016_04_01.models.ZonePaged[~azure.mgmt.dns.v2016_04_01.models.Zone] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ZonePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ZonePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones'} + + def list( + self, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the DNS zones in all resource groups in a subscription. + + :param top: The maximum number of DNS zones to return. If not + specified, returns up to 100 zones. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Zone + :rtype: + ~azure.mgmt.dns.v2016_04_01.models.ZonePaged[~azure.mgmt.dns.v2016_04_01.models.Zone] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ZonePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ZonePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/dnszones'} diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/version.py b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/version.py new file mode 100644 index 000000000000..5ddeb1e4b90a --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "2016-04-01" + diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/__init__.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/__init__.py new file mode 100644 index 000000000000..07ed3e0ff7ee --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .dns_management_client import DnsManagementClient +from .version import VERSION + +__all__ = ['DnsManagementClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/dns_management_client.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/dns_management_client.py new file mode 100644 index 000000000000..d3066a1806a2 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/dns_management_client.py @@ -0,0 +1,88 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.record_sets_operations import RecordSetsOperations +from .operations.zones_operations import ZonesOperations +from . import models + + +class DnsManagementClientConfiguration(AzureConfiguration): + """Configuration for DnsManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Specifies the Azure subscription ID, which + uniquely identifies the Microsoft Azure subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(DnsManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-dns/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class DnsManagementClient(SDKClient): + """The DNS Management Client. + + :ivar config: Configuration for client. + :vartype config: DnsManagementClientConfiguration + + :ivar record_sets: RecordSets operations + :vartype record_sets: azure.mgmt.dns.v2018_03_01_preview.operations.RecordSetsOperations + :ivar zones: Zones operations + :vartype zones: azure.mgmt.dns.v2018_03_01_preview.operations.ZonesOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Specifies the Azure subscription ID, which + uniquely identifies the Microsoft Azure subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = DnsManagementClientConfiguration(credentials, subscription_id, base_url) + super(DnsManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-03-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.record_sets = RecordSetsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.zones = ZonesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/__init__.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/__init__.py new file mode 100644 index 000000000000..d7e9bd678272 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/__init__.py @@ -0,0 +1,74 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from .arecord_py3 import ARecord + from .aaaa_record_py3 import AaaaRecord + from .mx_record_py3 import MxRecord + from .ns_record_py3 import NsRecord + from .ptr_record_py3 import PtrRecord + from .srv_record_py3 import SrvRecord + from .txt_record_py3 import TxtRecord + from .cname_record_py3 import CnameRecord + from .soa_record_py3 import SoaRecord + from .caa_record_py3 import CaaRecord + from .record_set_py3 import RecordSet + from .record_set_update_parameters_py3 import RecordSetUpdateParameters + from .sub_resource_py3 import SubResource + from .zone_py3 import Zone + from .zone_update_py3 import ZoneUpdate + from .resource_py3 import Resource +except (SyntaxError, ImportError): + from .arecord import ARecord + from .aaaa_record import AaaaRecord + from .mx_record import MxRecord + from .ns_record import NsRecord + from .ptr_record import PtrRecord + from .srv_record import SrvRecord + from .txt_record import TxtRecord + from .cname_record import CnameRecord + from .soa_record import SoaRecord + from .caa_record import CaaRecord + from .record_set import RecordSet + from .record_set_update_parameters import RecordSetUpdateParameters + from .sub_resource import SubResource + from .zone import Zone + from .zone_update import ZoneUpdate + from .resource import Resource +from .record_set_paged import RecordSetPaged +from .zone_paged import ZonePaged +from .dns_management_client_enums import ( + ZoneType, + RecordType, +) + +__all__ = [ + 'ARecord', + 'AaaaRecord', + 'MxRecord', + 'NsRecord', + 'PtrRecord', + 'SrvRecord', + 'TxtRecord', + 'CnameRecord', + 'SoaRecord', + 'CaaRecord', + 'RecordSet', + 'RecordSetUpdateParameters', + 'SubResource', + 'Zone', + 'ZoneUpdate', + 'Resource', + 'RecordSetPaged', + 'ZonePaged', + 'ZoneType', + 'RecordType', +] diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/aaaa_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/aaaa_record.py new file mode 100644 index 000000000000..4f4b45183a80 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/aaaa_record.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AaaaRecord(Model): + """An AAAA record. + + :param ipv6_address: The IPv6 address of this AAAA record. + :type ipv6_address: str + """ + + _attribute_map = { + 'ipv6_address': {'key': 'ipv6Address', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AaaaRecord, self).__init__(**kwargs) + self.ipv6_address = kwargs.get('ipv6_address', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/aaaa_record_py3.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/aaaa_record_py3.py new file mode 100644 index 000000000000..2cd662761ff9 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/aaaa_record_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AaaaRecord(Model): + """An AAAA record. + + :param ipv6_address: The IPv6 address of this AAAA record. + :type ipv6_address: str + """ + + _attribute_map = { + 'ipv6_address': {'key': 'ipv6Address', 'type': 'str'}, + } + + def __init__(self, *, ipv6_address: str=None, **kwargs) -> None: + super(AaaaRecord, self).__init__(**kwargs) + self.ipv6_address = ipv6_address diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/arecord.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/arecord.py new file mode 100644 index 000000000000..7172ccbb9011 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/arecord.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ARecord(Model): + """An A record. + + :param ipv4_address: The IPv4 address of this A record. + :type ipv4_address: str + """ + + _attribute_map = { + 'ipv4_address': {'key': 'ipv4Address', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ARecord, self).__init__(**kwargs) + self.ipv4_address = kwargs.get('ipv4_address', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/arecord_py3.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/arecord_py3.py new file mode 100644 index 000000000000..d38c7f033aae --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/arecord_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ARecord(Model): + """An A record. + + :param ipv4_address: The IPv4 address of this A record. + :type ipv4_address: str + """ + + _attribute_map = { + 'ipv4_address': {'key': 'ipv4Address', 'type': 'str'}, + } + + def __init__(self, *, ipv4_address: str=None, **kwargs) -> None: + super(ARecord, self).__init__(**kwargs) + self.ipv4_address = ipv4_address diff --git a/azure-mgmt-dns/azure/mgmt/dns/models/caa_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/caa_record.py similarity index 81% rename from azure-mgmt-dns/azure/mgmt/dns/models/caa_record.py rename to azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/caa_record.py index 2115ebba3862..e3672d03f6aa 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/models/caa_record.py +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/caa_record.py @@ -30,8 +30,8 @@ class CaaRecord(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, flags=None, tag=None, value=None): - super(CaaRecord, self).__init__() - self.flags = flags - self.tag = tag - self.value = value + def __init__(self, **kwargs): + super(CaaRecord, self).__init__(**kwargs) + self.flags = kwargs.get('flags', None) + self.tag = kwargs.get('tag', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/caa_record_py3.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/caa_record_py3.py new file mode 100644 index 000000000000..0a8b89b5e515 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/caa_record_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CaaRecord(Model): + """A CAA record. + + :param flags: The flags for this CAA record as an integer between 0 and + 255. + :type flags: int + :param tag: The tag for this CAA record. + :type tag: str + :param value: The value for this CAA record. + :type value: str + """ + + _attribute_map = { + 'flags': {'key': 'flags', 'type': 'int'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, flags: int=None, tag: str=None, value: str=None, **kwargs) -> None: + super(CaaRecord, self).__init__(**kwargs) + self.flags = flags + self.tag = tag + self.value = value diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/cname_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/cname_record.py new file mode 100644 index 000000000000..3812539e3504 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/cname_record.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CnameRecord(Model): + """A CNAME record. + + :param cname: The canonical name for this CNAME record. + :type cname: str + """ + + _attribute_map = { + 'cname': {'key': 'cname', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CnameRecord, self).__init__(**kwargs) + self.cname = kwargs.get('cname', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/cname_record_py3.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/cname_record_py3.py new file mode 100644 index 000000000000..903f7071d615 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/cname_record_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CnameRecord(Model): + """A CNAME record. + + :param cname: The canonical name for this CNAME record. + :type cname: str + """ + + _attribute_map = { + 'cname': {'key': 'cname', 'type': 'str'}, + } + + def __init__(self, *, cname: str=None, **kwargs) -> None: + super(CnameRecord, self).__init__(**kwargs) + self.cname = cname diff --git a/azure-mgmt-dns/azure/mgmt/dns/models/dns_management_client_enums.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/dns_management_client_enums.py similarity index 92% rename from azure-mgmt-dns/azure/mgmt/dns/models/dns_management_client_enums.py rename to azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/dns_management_client_enums.py index 890749d4c90e..05db7027d336 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/models/dns_management_client_enums.py +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/dns_management_client_enums.py @@ -12,13 +12,13 @@ from enum import Enum -class ZoneType(Enum): +class ZoneType(str, Enum): public = "Public" private = "Private" -class RecordType(Enum): +class RecordType(str, Enum): a = "A" aaaa = "AAAA" diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/mx_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/mx_record.py new file mode 100644 index 000000000000..8027663c4de5 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/mx_record.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MxRecord(Model): + """An MX record. + + :param preference: The preference value for this MX record. + :type preference: int + :param exchange: The domain name of the mail host for this MX record. + :type exchange: str + """ + + _attribute_map = { + 'preference': {'key': 'preference', 'type': 'int'}, + 'exchange': {'key': 'exchange', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MxRecord, self).__init__(**kwargs) + self.preference = kwargs.get('preference', None) + self.exchange = kwargs.get('exchange', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/mx_record_py3.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/mx_record_py3.py new file mode 100644 index 000000000000..6476cd65eb3a --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/mx_record_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MxRecord(Model): + """An MX record. + + :param preference: The preference value for this MX record. + :type preference: int + :param exchange: The domain name of the mail host for this MX record. + :type exchange: str + """ + + _attribute_map = { + 'preference': {'key': 'preference', 'type': 'int'}, + 'exchange': {'key': 'exchange', 'type': 'str'}, + } + + def __init__(self, *, preference: int=None, exchange: str=None, **kwargs) -> None: + super(MxRecord, self).__init__(**kwargs) + self.preference = preference + self.exchange = exchange diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/ns_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/ns_record.py new file mode 100644 index 000000000000..ecef3918a591 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/ns_record.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NsRecord(Model): + """An NS record. + + :param nsdname: The name server name for this NS record. + :type nsdname: str + """ + + _attribute_map = { + 'nsdname': {'key': 'nsdname', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NsRecord, self).__init__(**kwargs) + self.nsdname = kwargs.get('nsdname', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/ns_record_py3.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/ns_record_py3.py new file mode 100644 index 000000000000..c13d10f102e1 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/ns_record_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NsRecord(Model): + """An NS record. + + :param nsdname: The name server name for this NS record. + :type nsdname: str + """ + + _attribute_map = { + 'nsdname': {'key': 'nsdname', 'type': 'str'}, + } + + def __init__(self, *, nsdname: str=None, **kwargs) -> None: + super(NsRecord, self).__init__(**kwargs) + self.nsdname = nsdname diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/ptr_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/ptr_record.py new file mode 100644 index 000000000000..1b14721c9855 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/ptr_record.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PtrRecord(Model): + """A PTR record. + + :param ptrdname: The PTR target domain name for this PTR record. + :type ptrdname: str + """ + + _attribute_map = { + 'ptrdname': {'key': 'ptrdname', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PtrRecord, self).__init__(**kwargs) + self.ptrdname = kwargs.get('ptrdname', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/ptr_record_py3.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/ptr_record_py3.py new file mode 100644 index 000000000000..523afce05a26 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/ptr_record_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PtrRecord(Model): + """A PTR record. + + :param ptrdname: The PTR target domain name for this PTR record. + :type ptrdname: str + """ + + _attribute_map = { + 'ptrdname': {'key': 'ptrdname', 'type': 'str'}, + } + + def __init__(self, *, ptrdname: str=None, **kwargs) -> None: + super(PtrRecord, self).__init__(**kwargs) + self.ptrdname = ptrdname diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/record_set.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/record_set.py new file mode 100644 index 000000000000..91eebac6ffb4 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/record_set.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RecordSet(Model): + """Describes a DNS record set (a collection of DNS records with the same name + and type). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ID of the record set. + :vartype id: str + :ivar name: The name of the record set. + :vartype name: str + :ivar type: The type of the record set. + :vartype type: str + :param etag: The etag of the record set. + :type etag: str + :param metadata: The metadata attached to the record set. + :type metadata: dict[str, str] + :param ttl: The TTL (time-to-live) of the records in the record set. + :type ttl: long + :ivar fqdn: Fully qualified domain name of the record set. + :vartype fqdn: str + :param arecords: The list of A records in the record set. + :type arecords: list[~azure.mgmt.dns.v2018_03_01_preview.models.ARecord] + :param aaaa_records: The list of AAAA records in the record set. + :type aaaa_records: + list[~azure.mgmt.dns.v2018_03_01_preview.models.AaaaRecord] + :param mx_records: The list of MX records in the record set. + :type mx_records: + list[~azure.mgmt.dns.v2018_03_01_preview.models.MxRecord] + :param ns_records: The list of NS records in the record set. + :type ns_records: + list[~azure.mgmt.dns.v2018_03_01_preview.models.NsRecord] + :param ptr_records: The list of PTR records in the record set. + :type ptr_records: + list[~azure.mgmt.dns.v2018_03_01_preview.models.PtrRecord] + :param srv_records: The list of SRV records in the record set. + :type srv_records: + list[~azure.mgmt.dns.v2018_03_01_preview.models.SrvRecord] + :param txt_records: The list of TXT records in the record set. + :type txt_records: + list[~azure.mgmt.dns.v2018_03_01_preview.models.TxtRecord] + :param cname_record: The CNAME record in the record set. + :type cname_record: ~azure.mgmt.dns.v2018_03_01_preview.models.CnameRecord + :param soa_record: The SOA record in the record set. + :type soa_record: ~azure.mgmt.dns.v2018_03_01_preview.models.SoaRecord + :param caa_records: The list of CAA records in the record set. + :type caa_records: + list[~azure.mgmt.dns.v2018_03_01_preview.models.CaaRecord] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'fqdn': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'ttl': {'key': 'properties.TTL', 'type': 'long'}, + 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, + 'arecords': {'key': 'properties.ARecords', 'type': '[ARecord]'}, + 'aaaa_records': {'key': 'properties.AAAARecords', 'type': '[AaaaRecord]'}, + 'mx_records': {'key': 'properties.MXRecords', 'type': '[MxRecord]'}, + 'ns_records': {'key': 'properties.NSRecords', 'type': '[NsRecord]'}, + 'ptr_records': {'key': 'properties.PTRRecords', 'type': '[PtrRecord]'}, + 'srv_records': {'key': 'properties.SRVRecords', 'type': '[SrvRecord]'}, + 'txt_records': {'key': 'properties.TXTRecords', 'type': '[TxtRecord]'}, + 'cname_record': {'key': 'properties.CNAMERecord', 'type': 'CnameRecord'}, + 'soa_record': {'key': 'properties.SOARecord', 'type': 'SoaRecord'}, + 'caa_records': {'key': 'properties.caaRecords', 'type': '[CaaRecord]'}, + } + + def __init__(self, **kwargs): + super(RecordSet, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.etag = kwargs.get('etag', None) + self.metadata = kwargs.get('metadata', None) + self.ttl = kwargs.get('ttl', None) + self.fqdn = None + self.arecords = kwargs.get('arecords', None) + self.aaaa_records = kwargs.get('aaaa_records', None) + self.mx_records = kwargs.get('mx_records', None) + self.ns_records = kwargs.get('ns_records', None) + self.ptr_records = kwargs.get('ptr_records', None) + self.srv_records = kwargs.get('srv_records', None) + self.txt_records = kwargs.get('txt_records', None) + self.cname_record = kwargs.get('cname_record', None) + self.soa_record = kwargs.get('soa_record', None) + self.caa_records = kwargs.get('caa_records', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/record_set_paged.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/record_set_paged.py new file mode 100644 index 000000000000..9811ec3c75d4 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/record_set_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class RecordSetPaged(Paged): + """ + A paging container for iterating over a list of :class:`RecordSet ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RecordSet]'} + } + + def __init__(self, *args, **kwargs): + + super(RecordSetPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-dns/azure/mgmt/dns/models/record_set.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/record_set_py3.py similarity index 76% rename from azure-mgmt-dns/azure/mgmt/dns/models/record_set.py rename to azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/record_set_py3.py index f29c5f5bf8f0..86c2acebfff9 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/models/record_set.py +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/record_set_py3.py @@ -34,25 +34,32 @@ class RecordSet(Model): :ivar fqdn: Fully qualified domain name of the record set. :vartype fqdn: str :param arecords: The list of A records in the record set. - :type arecords: list[~azure.mgmt.dns.models.ARecord] + :type arecords: list[~azure.mgmt.dns.v2018_03_01_preview.models.ARecord] :param aaaa_records: The list of AAAA records in the record set. - :type aaaa_records: list[~azure.mgmt.dns.models.AaaaRecord] + :type aaaa_records: + list[~azure.mgmt.dns.v2018_03_01_preview.models.AaaaRecord] :param mx_records: The list of MX records in the record set. - :type mx_records: list[~azure.mgmt.dns.models.MxRecord] + :type mx_records: + list[~azure.mgmt.dns.v2018_03_01_preview.models.MxRecord] :param ns_records: The list of NS records in the record set. - :type ns_records: list[~azure.mgmt.dns.models.NsRecord] + :type ns_records: + list[~azure.mgmt.dns.v2018_03_01_preview.models.NsRecord] :param ptr_records: The list of PTR records in the record set. - :type ptr_records: list[~azure.mgmt.dns.models.PtrRecord] + :type ptr_records: + list[~azure.mgmt.dns.v2018_03_01_preview.models.PtrRecord] :param srv_records: The list of SRV records in the record set. - :type srv_records: list[~azure.mgmt.dns.models.SrvRecord] + :type srv_records: + list[~azure.mgmt.dns.v2018_03_01_preview.models.SrvRecord] :param txt_records: The list of TXT records in the record set. - :type txt_records: list[~azure.mgmt.dns.models.TxtRecord] + :type txt_records: + list[~azure.mgmt.dns.v2018_03_01_preview.models.TxtRecord] :param cname_record: The CNAME record in the record set. - :type cname_record: ~azure.mgmt.dns.models.CnameRecord + :type cname_record: ~azure.mgmt.dns.v2018_03_01_preview.models.CnameRecord :param soa_record: The SOA record in the record set. - :type soa_record: ~azure.mgmt.dns.models.SoaRecord + :type soa_record: ~azure.mgmt.dns.v2018_03_01_preview.models.SoaRecord :param caa_records: The list of CAA records in the record set. - :type caa_records: list[~azure.mgmt.dns.models.CaaRecord] + :type caa_records: + list[~azure.mgmt.dns.v2018_03_01_preview.models.CaaRecord] """ _validation = { @@ -82,8 +89,8 @@ class RecordSet(Model): 'caa_records': {'key': 'properties.caaRecords', 'type': '[CaaRecord]'}, } - def __init__(self, etag=None, metadata=None, ttl=None, arecords=None, aaaa_records=None, mx_records=None, ns_records=None, ptr_records=None, srv_records=None, txt_records=None, cname_record=None, soa_record=None, caa_records=None): - super(RecordSet, self).__init__() + def __init__(self, *, etag: str=None, metadata=None, ttl: int=None, arecords=None, aaaa_records=None, mx_records=None, ns_records=None, ptr_records=None, srv_records=None, txt_records=None, cname_record=None, soa_record=None, caa_records=None, **kwargs) -> None: + super(RecordSet, self).__init__(**kwargs) self.id = None self.name = None self.type = None diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/record_set_update_parameters.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/record_set_update_parameters.py new file mode 100644 index 000000000000..d13d379c0e21 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/record_set_update_parameters.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RecordSetUpdateParameters(Model): + """Parameters supplied to update a record set. + + :param record_set: Specifies information about the record set being + updated. + :type record_set: ~azure.mgmt.dns.v2018_03_01_preview.models.RecordSet + """ + + _attribute_map = { + 'record_set': {'key': 'RecordSet', 'type': 'RecordSet'}, + } + + def __init__(self, **kwargs): + super(RecordSetUpdateParameters, self).__init__(**kwargs) + self.record_set = kwargs.get('record_set', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/record_set_update_parameters_py3.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/record_set_update_parameters_py3.py new file mode 100644 index 000000000000..aefca64e600d --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/record_set_update_parameters_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RecordSetUpdateParameters(Model): + """Parameters supplied to update a record set. + + :param record_set: Specifies information about the record set being + updated. + :type record_set: ~azure.mgmt.dns.v2018_03_01_preview.models.RecordSet + """ + + _attribute_map = { + 'record_set': {'key': 'RecordSet', 'type': 'RecordSet'}, + } + + def __init__(self, *, record_set=None, **kwargs) -> None: + super(RecordSetUpdateParameters, self).__init__(**kwargs) + self.record_set = record_set diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/resource.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/resource.py new file mode 100644 index 000000000000..f552ada2093d --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/resource.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Common properties of an Azure Resource Manager resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/models/resource.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/resource_py3.py similarity index 86% rename from azure-mgmt-dns/azure/mgmt/dns/models/resource.py rename to azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/resource_py3.py index 6e4361306992..85e37d57f9d9 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/models/resource.py +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/resource_py3.py @@ -18,13 +18,15 @@ class Resource(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Resource location. + :param location: Required. Resource location. :type location: str :param tags: Resource tags. :type tags: dict[str, str] @@ -45,8 +47,8 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location, tags=None): - super(Resource, self).__init__() + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/soa_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/soa_record.py new file mode 100644 index 000000000000..c38fcd00789c --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/soa_record.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SoaRecord(Model): + """An SOA record. + + :param host: The domain name of the authoritative name server for this SOA + record. + :type host: str + :param email: The email contact for this SOA record. + :type email: str + :param serial_number: The serial number for this SOA record. + :type serial_number: long + :param refresh_time: The refresh value for this SOA record. + :type refresh_time: long + :param retry_time: The retry time for this SOA record. + :type retry_time: long + :param expire_time: The expire time for this SOA record. + :type expire_time: long + :param minimum_ttl: The minimum value for this SOA record. By convention + this is used to determine the negative caching duration. + :type minimum_ttl: long + """ + + _attribute_map = { + 'host': {'key': 'host', 'type': 'str'}, + 'email': {'key': 'email', 'type': 'str'}, + 'serial_number': {'key': 'serialNumber', 'type': 'long'}, + 'refresh_time': {'key': 'refreshTime', 'type': 'long'}, + 'retry_time': {'key': 'retryTime', 'type': 'long'}, + 'expire_time': {'key': 'expireTime', 'type': 'long'}, + 'minimum_ttl': {'key': 'minimumTTL', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(SoaRecord, self).__init__(**kwargs) + self.host = kwargs.get('host', None) + self.email = kwargs.get('email', None) + self.serial_number = kwargs.get('serial_number', None) + self.refresh_time = kwargs.get('refresh_time', None) + self.retry_time = kwargs.get('retry_time', None) + self.expire_time = kwargs.get('expire_time', None) + self.minimum_ttl = kwargs.get('minimum_ttl', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/soa_record_py3.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/soa_record_py3.py new file mode 100644 index 000000000000..a9143fa2359b --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/soa_record_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SoaRecord(Model): + """An SOA record. + + :param host: The domain name of the authoritative name server for this SOA + record. + :type host: str + :param email: The email contact for this SOA record. + :type email: str + :param serial_number: The serial number for this SOA record. + :type serial_number: long + :param refresh_time: The refresh value for this SOA record. + :type refresh_time: long + :param retry_time: The retry time for this SOA record. + :type retry_time: long + :param expire_time: The expire time for this SOA record. + :type expire_time: long + :param minimum_ttl: The minimum value for this SOA record. By convention + this is used to determine the negative caching duration. + :type minimum_ttl: long + """ + + _attribute_map = { + 'host': {'key': 'host', 'type': 'str'}, + 'email': {'key': 'email', 'type': 'str'}, + 'serial_number': {'key': 'serialNumber', 'type': 'long'}, + 'refresh_time': {'key': 'refreshTime', 'type': 'long'}, + 'retry_time': {'key': 'retryTime', 'type': 'long'}, + 'expire_time': {'key': 'expireTime', 'type': 'long'}, + 'minimum_ttl': {'key': 'minimumTTL', 'type': 'long'}, + } + + def __init__(self, *, host: str=None, email: str=None, serial_number: int=None, refresh_time: int=None, retry_time: int=None, expire_time: int=None, minimum_ttl: int=None, **kwargs) -> None: + super(SoaRecord, self).__init__(**kwargs) + self.host = host + self.email = email + self.serial_number = serial_number + self.refresh_time = refresh_time + self.retry_time = retry_time + self.expire_time = expire_time + self.minimum_ttl = minimum_ttl diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/srv_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/srv_record.py new file mode 100644 index 000000000000..c7dc5fcdcbbd --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/srv_record.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SrvRecord(Model): + """An SRV record. + + :param priority: The priority value for this SRV record. + :type priority: int + :param weight: The weight value for this SRV record. + :type weight: int + :param port: The port value for this SRV record. + :type port: int + :param target: The target domain name for this SRV record. + :type target: str + """ + + _attribute_map = { + 'priority': {'key': 'priority', 'type': 'int'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'port': {'key': 'port', 'type': 'int'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SrvRecord, self).__init__(**kwargs) + self.priority = kwargs.get('priority', None) + self.weight = kwargs.get('weight', None) + self.port = kwargs.get('port', None) + self.target = kwargs.get('target', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/srv_record_py3.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/srv_record_py3.py new file mode 100644 index 000000000000..9a464f27cb09 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/srv_record_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SrvRecord(Model): + """An SRV record. + + :param priority: The priority value for this SRV record. + :type priority: int + :param weight: The weight value for this SRV record. + :type weight: int + :param port: The port value for this SRV record. + :type port: int + :param target: The target domain name for this SRV record. + :type target: str + """ + + _attribute_map = { + 'priority': {'key': 'priority', 'type': 'int'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'port': {'key': 'port', 'type': 'int'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, *, priority: int=None, weight: int=None, port: int=None, target: str=None, **kwargs) -> None: + super(SrvRecord, self).__init__(**kwargs) + self.priority = priority + self.weight = weight + self.port = port + self.target = target diff --git a/azure-mgmt-dns/azure/mgmt/dns/models/sub_resource.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/sub_resource.py similarity index 84% rename from azure-mgmt-dns/azure/mgmt/dns/models/sub_resource.py rename to azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/sub_resource.py index 65eca8fcb11e..610b6a201149 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/models/sub_resource.py +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/sub_resource.py @@ -23,6 +23,6 @@ class SubResource(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(SubResource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/sub_resource_py3.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/sub_resource_py3.py new file mode 100644 index 000000000000..1e17ddf43fca --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubResource(Model): + """A reference to a another resource. + + :param id: Resource Id. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/txt_record.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/txt_record.py new file mode 100644 index 000000000000..472f1f22b5d3 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/txt_record.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TxtRecord(Model): + """A TXT record. + + :param value: The text value of this TXT record. + :type value: list[str] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(TxtRecord, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/txt_record_py3.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/txt_record_py3.py new file mode 100644 index 000000000000..4faef766e859 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/txt_record_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TxtRecord(Model): + """A TXT record. + + :param value: The text value of this TXT record. + :type value: list[str] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[str]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(TxtRecord, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/zone.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/zone.py new file mode 100644 index 000000000000..d9867d69b703 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/zone.py @@ -0,0 +1,95 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Zone(Resource): + """Describes a DNS zone. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param etag: The etag of the zone. + :type etag: str + :ivar max_number_of_record_sets: The maximum number of record sets that + can be created in this DNS zone. This is a read-only property and any + attempt to set this value will be ignored. + :vartype max_number_of_record_sets: long + :ivar number_of_record_sets: The current number of record sets in this DNS + zone. This is a read-only property and any attempt to set this value will + be ignored. + :vartype number_of_record_sets: long + :ivar name_servers: The name servers for this DNS zone. This is a + read-only property and any attempt to set this value will be ignored. + :vartype name_servers: list[str] + :param zone_type: The type of this DNS zone (Public or Private). Possible + values include: 'Public', 'Private'. Default value: "Public" . + :type zone_type: str or + ~azure.mgmt.dns.v2018_03_01_preview.models.ZoneType + :param registration_virtual_networks: A list of references to virtual + networks that register hostnames in this DNS zone. This is a only when + ZoneType is Private. + :type registration_virtual_networks: + list[~azure.mgmt.dns.v2018_03_01_preview.models.SubResource] + :param resolution_virtual_networks: A list of references to virtual + networks that resolve records in this DNS zone. This is a only when + ZoneType is Private. + :type resolution_virtual_networks: + list[~azure.mgmt.dns.v2018_03_01_preview.models.SubResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'max_number_of_record_sets': {'readonly': True}, + 'number_of_record_sets': {'readonly': True}, + 'name_servers': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'max_number_of_record_sets': {'key': 'properties.maxNumberOfRecordSets', 'type': 'long'}, + 'number_of_record_sets': {'key': 'properties.numberOfRecordSets', 'type': 'long'}, + 'name_servers': {'key': 'properties.nameServers', 'type': '[str]'}, + 'zone_type': {'key': 'properties.zoneType', 'type': 'ZoneType'}, + 'registration_virtual_networks': {'key': 'properties.registrationVirtualNetworks', 'type': '[SubResource]'}, + 'resolution_virtual_networks': {'key': 'properties.resolutionVirtualNetworks', 'type': '[SubResource]'}, + } + + def __init__(self, **kwargs): + super(Zone, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) + self.max_number_of_record_sets = None + self.number_of_record_sets = None + self.name_servers = None + self.zone_type = kwargs.get('zone_type', "Public") + self.registration_virtual_networks = kwargs.get('registration_virtual_networks', None) + self.resolution_virtual_networks = kwargs.get('resolution_virtual_networks', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/zone_paged.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/zone_paged.py new file mode 100644 index 000000000000..950e7189cb5f --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/zone_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ZonePaged(Paged): + """ + A paging container for iterating over a list of :class:`Zone ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Zone]'} + } + + def __init__(self, *args, **kwargs): + + super(ZonePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-dns/azure/mgmt/dns/models/zone.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/zone_py3.py similarity index 85% rename from azure-mgmt-dns/azure/mgmt/dns/models/zone.py rename to azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/zone_py3.py index 729b4c4be264..f59484549ff0 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/models/zone.py +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/zone_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .resource_py3 import Resource class Zone(Resource): @@ -18,13 +18,15 @@ class Zone(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: Resource location. + :param location: Required. Resource location. :type location: str :param tags: Resource tags. :type tags: dict[str, str] @@ -43,17 +45,18 @@ class Zone(Resource): :vartype name_servers: list[str] :param zone_type: The type of this DNS zone (Public or Private). Possible values include: 'Public', 'Private'. Default value: "Public" . - :type zone_type: str or ~azure.mgmt.dns.models.ZoneType + :type zone_type: str or + ~azure.mgmt.dns.v2018_03_01_preview.models.ZoneType :param registration_virtual_networks: A list of references to virtual networks that register hostnames in this DNS zone. This is a only when ZoneType is Private. :type registration_virtual_networks: - list[~azure.mgmt.dns.models.SubResource] + list[~azure.mgmt.dns.v2018_03_01_preview.models.SubResource] :param resolution_virtual_networks: A list of references to virtual networks that resolve records in this DNS zone. This is a only when ZoneType is Private. :type resolution_virtual_networks: - list[~azure.mgmt.dns.models.SubResource] + list[~azure.mgmt.dns.v2018_03_01_preview.models.SubResource] """ _validation = { @@ -81,8 +84,8 @@ class Zone(Resource): 'resolution_virtual_networks': {'key': 'properties.resolutionVirtualNetworks', 'type': '[SubResource]'}, } - def __init__(self, location, tags=None, etag=None, zone_type="Public", registration_virtual_networks=None, resolution_virtual_networks=None): - super(Zone, self).__init__(location=location, tags=tags) + def __init__(self, *, location: str, tags=None, etag: str=None, zone_type="Public", registration_virtual_networks=None, resolution_virtual_networks=None, **kwargs) -> None: + super(Zone, self).__init__(location=location, tags=tags, **kwargs) self.etag = etag self.max_number_of_record_sets = None self.number_of_record_sets = None diff --git a/azure-mgmt-dns/azure/mgmt/dns/models/zone_update.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/zone_update.py similarity index 85% rename from azure-mgmt-dns/azure/mgmt/dns/models/zone_update.py rename to azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/zone_update.py index d9a94ed8f072..35b9948f7243 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/models/zone_update.py +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/zone_update.py @@ -23,6 +23,6 @@ class ZoneUpdate(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, tags=None): - super(ZoneUpdate, self).__init__() - self.tags = tags + def __init__(self, **kwargs): + super(ZoneUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/zone_update_py3.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/zone_update_py3.py new file mode 100644 index 000000000000..f8e85fa3f389 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/models/zone_update_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ZoneUpdate(Model): + """Describes a request to update a DNS zone. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(ZoneUpdate, self).__init__(**kwargs) + self.tags = tags diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/operations/__init__.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/operations/__init__.py new file mode 100644 index 000000000000..0618026e6f29 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/operations/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .record_sets_operations import RecordSetsOperations +from .zones_operations import ZonesOperations + +__all__ = [ + 'RecordSetsOperations', + 'ZonesOperations', +] diff --git a/azure-mgmt-dns/azure/mgmt/dns/operations/record_sets_operations.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/operations/record_sets_operations.py similarity index 93% rename from azure-mgmt-dns/azure/mgmt/dns/operations/record_sets_operations.py rename to azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/operations/record_sets_operations.py index b3dfbce58ba4..7fa7e6f984bb 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/operations/record_sets_operations.py +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/operations/record_sets_operations.py @@ -41,7 +41,8 @@ def update( self, resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): """Updates a record set within a DNS zone. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param zone_name: The name of the DNS zone (without a terminating dot). @@ -52,9 +53,10 @@ def update( :param record_type: The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' - :type record_type: str or ~azure.mgmt.dns.models.RecordType + :type record_type: str or + ~azure.mgmt.dns.v2018_03_01_preview.models.RecordType :param parameters: Parameters supplied to the Update operation. - :type parameters: ~azure.mgmt.dns.models.RecordSet + :type parameters: ~azure.mgmt.dns.v2018_03_01_preview.models.RecordSet :param if_match: 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. @@ -65,14 +67,14 @@ def update( :param operation_config: :ref:`Operation configuration overrides`. :return: RecordSet or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.dns.models.RecordSet or + :rtype: ~azure.mgmt.dns.v2018_03_01_preview.models.RecordSet or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL url = self.update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'zoneName': self._serialize.url("zone_name", zone_name, 'str'), 'relativeRecordSetName': self._serialize.url("relative_record_set_name", relative_record_set_name, 'str', skip_quote=True), 'recordType': self._serialize.url("record_type", record_type, 'RecordType'), @@ -125,7 +127,8 @@ def create_or_update( self, 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): """Creates or updates a record set within a DNS zone. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param zone_name: The name of the DNS zone (without a terminating dot). @@ -137,10 +140,11 @@ def create_or_update( sets of type SOA can be updated but not created (they are created when the DNS zone is created). Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' - :type record_type: str or ~azure.mgmt.dns.models.RecordType + :type record_type: str or + ~azure.mgmt.dns.v2018_03_01_preview.models.RecordType :param parameters: Parameters supplied to the CreateOrUpdate operation. - :type parameters: ~azure.mgmt.dns.models.RecordSet + :type parameters: ~azure.mgmt.dns.v2018_03_01_preview.models.RecordSet :param if_match: 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. @@ -155,14 +159,14 @@ def create_or_update( :param operation_config: :ref:`Operation configuration overrides`. :return: RecordSet or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.dns.models.RecordSet or + :rtype: ~azure.mgmt.dns.v2018_03_01_preview.models.RecordSet or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'zoneName': self._serialize.url("zone_name", zone_name, 'str'), 'relativeRecordSetName': self._serialize.url("relative_record_set_name", relative_record_set_name, 'str', skip_quote=True), 'recordType': self._serialize.url("record_type", record_type, 'RecordType'), @@ -219,7 +223,8 @@ def delete( self, resource_group_name, zone_name, relative_record_set_name, record_type, if_match=None, custom_headers=None, raw=False, **operation_config): """Deletes a record set from a DNS zone. This operation cannot be undone. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param zone_name: The name of the DNS zone (without a terminating dot). @@ -231,7 +236,8 @@ def delete( sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted). Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' - :type record_type: str or ~azure.mgmt.dns.models.RecordType + :type record_type: str or + ~azure.mgmt.dns.v2018_03_01_preview.models.RecordType :param if_match: 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. @@ -248,7 +254,7 @@ def delete( # Construct URL url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'zoneName': self._serialize.url("zone_name", zone_name, 'str'), 'relativeRecordSetName': self._serialize.url("relative_record_set_name", relative_record_set_name, 'str', skip_quote=True), 'recordType': self._serialize.url("record_type", record_type, 'RecordType'), @@ -290,7 +296,8 @@ def get( self, resource_group_name, zone_name, relative_record_set_name, record_type, custom_headers=None, raw=False, **operation_config): """Gets a record set. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param zone_name: The name of the DNS zone (without a terminating dot). @@ -301,21 +308,22 @@ def get( :param record_type: The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' - :type record_type: str or ~azure.mgmt.dns.models.RecordType + :type record_type: str or + ~azure.mgmt.dns.v2018_03_01_preview.models.RecordType :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. :return: RecordSet or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.dns.models.RecordSet or + :rtype: ~azure.mgmt.dns.v2018_03_01_preview.models.RecordSet or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'zoneName': self._serialize.url("zone_name", zone_name, 'str'), 'relativeRecordSetName': self._serialize.url("relative_record_set_name", relative_record_set_name, 'str', skip_quote=True), 'recordType': self._serialize.url("record_type", record_type, 'RecordType'), @@ -362,7 +370,8 @@ def list_by_type( self, resource_group_name, zone_name, record_type, top=None, recordsetnamesuffix=None, custom_headers=None, raw=False, **operation_config): """Lists the record sets of a specified type in a DNS zone. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param zone_name: The name of the DNS zone (without a terminating dot). @@ -370,7 +379,8 @@ def list_by_type( :param record_type: The type of record sets to enumerate. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT' - :type record_type: str or ~azure.mgmt.dns.models.RecordType + :type record_type: str or + ~azure.mgmt.dns.v2018_03_01_preview.models.RecordType :param top: The maximum number of record sets to return. If not specified, returns up to 100 record sets. :type top: int @@ -386,7 +396,7 @@ def list_by_type( overrides`. :return: An iterator like instance of RecordSet :rtype: - ~azure.mgmt.dns.models.RecordSetPaged[~azure.mgmt.dns.models.RecordSet] + ~azure.mgmt.dns.v2018_03_01_preview.models.RecordSetPaged[~azure.mgmt.dns.v2018_03_01_preview.models.RecordSet] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): @@ -395,7 +405,7 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = self.list_by_type.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'zoneName': self._serialize.url("zone_name", zone_name, 'str'), 'recordType': self._serialize.url("record_type", record_type, 'RecordType'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -451,7 +461,8 @@ def list_by_dns_zone( self, resource_group_name, zone_name, top=None, recordsetnamesuffix=None, custom_headers=None, raw=False, **operation_config): """Lists all record sets in a DNS zone. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param zone_name: The name of the DNS zone (without a terminating dot). @@ -471,7 +482,7 @@ def list_by_dns_zone( overrides`. :return: An iterator like instance of RecordSet :rtype: - ~azure.mgmt.dns.models.RecordSetPaged[~azure.mgmt.dns.models.RecordSet] + ~azure.mgmt.dns.v2018_03_01_preview.models.RecordSetPaged[~azure.mgmt.dns.v2018_03_01_preview.models.RecordSet] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): @@ -480,7 +491,7 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = self.list_by_dns_zone.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'zoneName': self._serialize.url("zone_name", zone_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -535,7 +546,8 @@ def list_all_by_dns_zone( self, resource_group_name, zone_name, top=None, record_set_name_suffix=None, custom_headers=None, raw=False, **operation_config): """Lists all record sets in a DNS zone. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param zone_name: The name of the DNS zone (without a terminating dot). @@ -555,7 +567,7 @@ def list_all_by_dns_zone( overrides`. :return: An iterator like instance of RecordSet :rtype: - ~azure.mgmt.dns.models.RecordSetPaged[~azure.mgmt.dns.models.RecordSet] + ~azure.mgmt.dns.v2018_03_01_preview.models.RecordSetPaged[~azure.mgmt.dns.v2018_03_01_preview.models.RecordSet] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): @@ -564,7 +576,7 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = self.list_all_by_dns_zone.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'zoneName': self._serialize.url("zone_name", zone_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } diff --git a/azure-mgmt-dns/azure/mgmt/dns/operations/zones_operations.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/operations/zones_operations.py similarity index 90% rename from azure-mgmt-dns/azure/mgmt/dns/operations/zones_operations.py rename to azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/operations/zones_operations.py index 130319509bdc..b0528ded1c63 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/operations/zones_operations.py +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/operations/zones_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -44,14 +44,15 @@ def create_or_update( """Creates or updates a DNS zone. Does not modify DNS records within the zone. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param zone_name: The name of the DNS zone (without a terminating dot). :type zone_name: str :param parameters: Parameters supplied to the CreateOrUpdate operation. - :type parameters: ~azure.mgmt.dns.models.Zone + :type parameters: ~azure.mgmt.dns.v2018_03_01_preview.models.Zone :param if_match: 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. @@ -66,14 +67,14 @@ def create_or_update( :param operation_config: :ref:`Operation configuration overrides`. :return: Zone or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.dns.models.Zone or + :rtype: ~azure.mgmt.dns.v2018_03_01_preview.models.Zone or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'zoneName': self._serialize.url("zone_name", zone_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -130,7 +131,7 @@ def _delete_initial( # Construct URL url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'zoneName': self._serialize.url("zone_name", zone_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -166,11 +167,12 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, zone_name, if_match=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, zone_name, if_match=None, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param zone_name: The name of the DNS zone (without a terminating dot). @@ -180,12 +182,14 @@ def delete( accidentally deleting any concurrent changes. :type if_match: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -196,40 +200,19 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}'} def get( @@ -237,7 +220,8 @@ def get( """Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param zone_name: The name of the DNS zone (without a terminating dot). @@ -248,14 +232,14 @@ def get( :param operation_config: :ref:`Operation configuration overrides`. :return: Zone or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.dns.models.Zone or + :rtype: ~azure.mgmt.dns.v2018_03_01_preview.models.Zone or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'zoneName': self._serialize.url("zone_name", zone_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -300,7 +284,8 @@ def update( self, resource_group_name, zone_name, if_match=None, tags=None, custom_headers=None, raw=False, **operation_config): """Updates a DNS zone. Does not modify DNS records within the zone. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param zone_name: The name of the DNS zone (without a terminating dot). @@ -317,7 +302,7 @@ def update( :param operation_config: :ref:`Operation configuration overrides`. :return: Zone or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.dns.models.Zone or + :rtype: ~azure.mgmt.dns.v2018_03_01_preview.models.Zone or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -326,7 +311,7 @@ def update( # Construct URL url = self.update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'zoneName': self._serialize.url("zone_name", zone_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -377,7 +362,8 @@ def list_by_resource_group( self, resource_group_name, top=None, custom_headers=None, raw=False, **operation_config): """Lists the DNS zones within a resource group. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param top: The maximum number of record sets to return. If not specified, returns up to 100 record sets. @@ -388,7 +374,8 @@ def list_by_resource_group( :param operation_config: :ref:`Operation configuration overrides`. :return: An iterator like instance of Zone - :rtype: ~azure.mgmt.dns.models.ZonePaged[~azure.mgmt.dns.models.Zone] + :rtype: + ~azure.mgmt.dns.v2018_03_01_preview.models.ZonePaged[~azure.mgmt.dns.v2018_03_01_preview.models.Zone] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): @@ -397,7 +384,7 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = self.list_by_resource_group.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -458,7 +445,8 @@ def list( :param operation_config: :ref:`Operation configuration overrides`. :return: An iterator like instance of Zone - :rtype: ~azure.mgmt.dns.models.ZonePaged[~azure.mgmt.dns.models.Zone] + :rtype: + ~azure.mgmt.dns.v2018_03_01_preview.models.ZonePaged[~azure.mgmt.dns.v2018_03_01_preview.models.Zone] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): diff --git a/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/version.py b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/version.py new file mode 100644 index 000000000000..623d610ecc13 --- /dev/null +++ b/azure-mgmt-dns/azure/mgmt/dns/v2018_03_01_preview/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "2018-03-01-preview" + diff --git a/azure-mgmt-dns/azure/mgmt/dns/version.py b/azure-mgmt-dns/azure/mgmt/dns/version.py index 8d86cf0470d7..fa6594091164 100644 --- a/azure-mgmt-dns/azure/mgmt/dns/version.py +++ b/azure-mgmt-dns/azure/mgmt/dns/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0rc1" +VERSION = "2.0.0rc2" diff --git a/azure-mgmt-dns/sdk_packaging.toml b/azure-mgmt-dns/sdk_packaging.toml new file mode 100644 index 000000000000..694c4f59c661 --- /dev/null +++ b/azure-mgmt-dns/sdk_packaging.toml @@ -0,0 +1,5 @@ +[packaging] +package_name = "azure-mgmt-dns" +package_pprint_name = "DNS Management" +package_doc_id = "dns" +is_stable = false diff --git a/azure-mgmt-dns/setup.py b/azure-mgmt-dns/setup.py index f96dd0c2be04..44ff5437c68c 100644 --- a/azure-mgmt-dns/setup.py +++ b/azure-mgmt-dns/setup.py @@ -77,7 +77,7 @@ zip_safe=False, packages=find_packages(exclude=["tests"]), install_requires=[ - 'msrestazure>=0.4.20,<2.0.0', + 'msrestazure>=0.4.27,<2.0.0', 'azure-common~=1.1', ], cmdclass=cmdclass