diff --git a/sdk/network/azure-mgmt-frontdoor/README.md b/sdk/network/azure-mgmt-frontdoor/README.md index 7c0965c0258d..16f4dfbce483 100644 --- a/sdk/network/azure-mgmt-frontdoor/README.md +++ b/sdk/network/azure-mgmt-frontdoor/README.md @@ -1,29 +1,21 @@ -## Microsoft Azure SDK for Python +# Microsoft Azure SDK for Python This is the Microsoft Azure Front Door Service Client Library. +This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/) -Azure Resource Manager (ARM) is the next generation of management APIs -that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.5, 3.6 and 3.7. +# Usage -For the older Azure Service Management (ASM) libraries, see -[azure-servicemanagement-legacy](https://pypi.python.org/pypi/azure-servicemanagement-legacy) -library. +For code examples, see [Front Door Service](https://docs.microsoft.com/python/api/overview/azure/) +on docs.microsoft.com. -For a more complete set of Azure libraries, see the -[azure](https://pypi.python.org/pypi/azure) bundle package. -## Usage +# Provide Feedback -For code examples, see [Front Door -Service](https://docs.microsoft.com/python/api/overview/azure/) on -docs.microsoft.com. - -## Provide Feedback - -If you encounter any bugs or have suggestions, please file an issue in -the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project. -![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-frontdoor%2FREADME.png) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-frontdoor%2FREADME.png) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/_front_door_management_client.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/_front_door_management_client.py index 619bd15dc0d7..84761d534350 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/_front_door_management_client.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/_front_door_management_client.py @@ -13,11 +13,12 @@ from msrest import Serializer, Deserializer from ._configuration import FrontDoorManagementClientConfiguration -from .operations import FrontDoorManagementClientOperationsMixin from .operations import NetworkExperimentProfilesOperations from .operations import PreconfiguredEndpointsOperations from .operations import ExperimentsOperations from .operations import ReportsOperations +from .operations import FrontDoorNameAvailabilityOperations +from .operations import FrontDoorNameAvailabilityWithSubscriptionOperations from .operations import FrontDoorsOperations from .operations import FrontendEndpointsOperations from .operations import EndpointsOperations @@ -27,7 +28,7 @@ from . import models -class FrontDoorManagementClient(FrontDoorManagementClientOperationsMixin, SDKClient): +class FrontDoorManagementClient(SDKClient): """FrontDoor Client :ivar config: Configuration for client. @@ -41,6 +42,10 @@ class FrontDoorManagementClient(FrontDoorManagementClientOperationsMixin, SDKCli :vartype experiments: azure.mgmt.frontdoor.operations.ExperimentsOperations :ivar reports: Reports operations :vartype reports: azure.mgmt.frontdoor.operations.ReportsOperations + :ivar front_door_name_availability: FrontDoorNameAvailability operations + :vartype front_door_name_availability: azure.mgmt.frontdoor.operations.FrontDoorNameAvailabilityOperations + :ivar front_door_name_availability_with_subscription: FrontDoorNameAvailabilityWithSubscription operations + :vartype front_door_name_availability_with_subscription: azure.mgmt.frontdoor.operations.FrontDoorNameAvailabilityWithSubscriptionOperations :ivar front_doors: FrontDoors operations :vartype front_doors: azure.mgmt.frontdoor.operations.FrontDoorsOperations :ivar frontend_endpoints: FrontendEndpoints operations @@ -82,6 +87,10 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.reports = ReportsOperations( self._client, self.config, self._serialize, self._deserialize) + self.front_door_name_availability = FrontDoorNameAvailabilityOperations( + self._client, self.config, self._serialize, self._deserialize) + self.front_door_name_availability_with_subscription = FrontDoorNameAvailabilityWithSubscriptionOperations( + self._client, self.config, self._serialize, self._deserialize) self.front_doors = FrontDoorsOperations( self._client, self.config, self._serialize, self._deserialize) self.frontend_endpoints = FrontendEndpointsOperations( diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/_models.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/_models.py index eae3d7e674ac..939727efa338 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/_models.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/_models.py @@ -53,6 +53,13 @@ class Backend(Model): :param private_link_alias: The Alias of the Private Link resource. Populating this optional field indicates that this backend is 'Private' :type private_link_alias: str + :param private_link_resource_id: The Resource Id of the Private Link + resource. Populating this optional field indicates that this backend is + 'Private' + :type private_link_resource_id: str + :param private_link_location: The location of the Private Link resource. + Required only if 'privateLinkResourceId' is populated + :type private_link_location: str :ivar private_endpoint_status: The Approval status for the connection to the Private Link. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected', 'Timeout' @@ -92,6 +99,8 @@ class Backend(Model): _attribute_map = { 'address': {'key': 'address', 'type': 'str'}, 'private_link_alias': {'key': 'privateLinkAlias', 'type': 'str'}, + 'private_link_resource_id': {'key': 'privateLinkResourceId', 'type': 'str'}, + 'private_link_location': {'key': 'privateLinkLocation', 'type': 'str'}, 'private_endpoint_status': {'key': 'privateEndpointStatus', 'type': 'PrivateEndpointStatus'}, 'private_link_approval_message': {'key': 'privateLinkApprovalMessage', 'type': 'str'}, 'http_port': {'key': 'httpPort', 'type': 'int'}, @@ -106,6 +115,8 @@ def __init__(self, **kwargs): super(Backend, self).__init__(**kwargs) self.address = kwargs.get('address', None) self.private_link_alias = kwargs.get('private_link_alias', None) + self.private_link_resource_id = kwargs.get('private_link_resource_id', None) + self.private_link_location = kwargs.get('private_link_location', None) self.private_endpoint_status = None self.private_link_approval_message = kwargs.get('private_link_approval_message', None) self.http_port = kwargs.get('http_port', None) diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/_models_py3.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/_models_py3.py index 3e8557fcf7b2..b5032de08c7d 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/_models_py3.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/models/_models_py3.py @@ -53,6 +53,13 @@ class Backend(Model): :param private_link_alias: The Alias of the Private Link resource. Populating this optional field indicates that this backend is 'Private' :type private_link_alias: str + :param private_link_resource_id: The Resource Id of the Private Link + resource. Populating this optional field indicates that this backend is + 'Private' + :type private_link_resource_id: str + :param private_link_location: The location of the Private Link resource. + Required only if 'privateLinkResourceId' is populated + :type private_link_location: str :ivar private_endpoint_status: The Approval status for the connection to the Private Link. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected', 'Timeout' @@ -92,6 +99,8 @@ class Backend(Model): _attribute_map = { 'address': {'key': 'address', 'type': 'str'}, 'private_link_alias': {'key': 'privateLinkAlias', 'type': 'str'}, + 'private_link_resource_id': {'key': 'privateLinkResourceId', 'type': 'str'}, + 'private_link_location': {'key': 'privateLinkLocation', 'type': 'str'}, 'private_endpoint_status': {'key': 'privateEndpointStatus', 'type': 'PrivateEndpointStatus'}, 'private_link_approval_message': {'key': 'privateLinkApprovalMessage', 'type': 'str'}, 'http_port': {'key': 'httpPort', 'type': 'int'}, @@ -102,10 +111,12 @@ class Backend(Model): 'backend_host_header': {'key': 'backendHostHeader', 'type': 'str'}, } - def __init__(self, *, address: str=None, private_link_alias: str=None, private_link_approval_message: str=None, http_port: int=None, https_port: int=None, enabled_state=None, priority: int=None, weight: int=None, backend_host_header: str=None, **kwargs) -> None: + def __init__(self, *, address: str=None, private_link_alias: str=None, private_link_resource_id: str=None, private_link_location: str=None, private_link_approval_message: str=None, http_port: int=None, https_port: int=None, enabled_state=None, priority: int=None, weight: int=None, backend_host_header: str=None, **kwargs) -> None: super(Backend, self).__init__(**kwargs) self.address = address self.private_link_alias = private_link_alias + self.private_link_resource_id = private_link_resource_id + self.private_link_location = private_link_location self.private_endpoint_status = None self.private_link_approval_message = private_link_approval_message self.http_port = http_port diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/__init__.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/__init__.py index 25b6b5eb6790..14b69c8467c9 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/__init__.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/__init__.py @@ -13,24 +13,26 @@ from ._preconfigured_endpoints_operations import PreconfiguredEndpointsOperations from ._experiments_operations import ExperimentsOperations from ._reports_operations import ReportsOperations +from ._front_door_name_availability_operations import FrontDoorNameAvailabilityOperations +from ._front_door_name_availability_with_subscription_operations import FrontDoorNameAvailabilityWithSubscriptionOperations from ._front_doors_operations import FrontDoorsOperations from ._frontend_endpoints_operations import FrontendEndpointsOperations from ._endpoints_operations import EndpointsOperations from ._rules_engines_operations import RulesEnginesOperations from ._policies_operations import PoliciesOperations from ._managed_rule_sets_operations import ManagedRuleSetsOperations -from ._front_door_management_client_operations import FrontDoorManagementClientOperationsMixin __all__ = [ 'NetworkExperimentProfilesOperations', 'PreconfiguredEndpointsOperations', 'ExperimentsOperations', 'ReportsOperations', + 'FrontDoorNameAvailabilityOperations', + 'FrontDoorNameAvailabilityWithSubscriptionOperations', 'FrontDoorsOperations', 'FrontendEndpointsOperations', 'EndpointsOperations', 'RulesEnginesOperations', 'PoliciesOperations', 'ManagedRuleSetsOperations', - 'FrontDoorManagementClientOperationsMixin', ] diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_endpoints_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_endpoints_operations.py index 8280359cfaf6..c0c27651b2f2 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_endpoints_operations.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_endpoints_operations.py @@ -26,7 +26,7 @@ class EndpointsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2020-01-01". + :ivar api_version: Client API version. Constant value: "2020-05-01". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-01-01" + self.api_version = "2020-05-01" self.config = config diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_front_door_management_client_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_front_door_management_client_operations.py deleted file mode 100644 index fa9902b23417..000000000000 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_front_door_management_client_operations.py +++ /dev/null @@ -1,152 +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 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 -import uuid - - -class FrontDoorManagementClientOperationsMixin(object): - - def check_front_door_name_availability( - self, name, type, custom_headers=None, raw=False, **operation_config): - """Check the availability of a Front Door resource name. - - :param name: The resource name to validate. - :type name: str - :param type: The type of the resource whose name is to be validated. - Possible values include: 'Microsoft.Network/frontDoors', - 'Microsoft.Network/frontDoors/frontendEndpoints' - :type type: str or ~azure.mgmt.frontdoor.models.ResourceType - :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: CheckNameAvailabilityOutput or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.frontdoor.models.CheckNameAvailabilityOutput or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - check_front_door_name_availability_input = models.CheckNameAvailabilityInput(name=name, type=type) - - api_version = "2020-01-01" - - # Construct URL - url = self.check_front_door_name_availability.metadata['url'] - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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 body - body_content = self._serialize.body(check_front_door_name_availability_input, 'CheckNameAvailabilityInput') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('CheckNameAvailabilityOutput', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - check_front_door_name_availability.metadata = {'url': '/providers/Microsoft.Network/checkFrontDoorNameAvailability'} - - def check_front_door_name_availability_with_subscription( - self, name, type, custom_headers=None, raw=False, **operation_config): - """Check the availability of a Front Door subdomain. - - :param name: The resource name to validate. - :type name: str - :param type: The type of the resource whose name is to be validated. - Possible values include: 'Microsoft.Network/frontDoors', - 'Microsoft.Network/frontDoors/frontendEndpoints' - :type type: str or ~azure.mgmt.frontdoor.models.ResourceType - :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: CheckNameAvailabilityOutput or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.frontdoor.models.CheckNameAvailabilityOutput or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - check_front_door_name_availability_input = models.CheckNameAvailabilityInput(name=name, type=type) - - api_version = "2020-01-01" - - # Construct URL - url = self.check_front_door_name_availability_with_subscription.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 = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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 body - body_content = self._serialize.body(check_front_door_name_availability_input, 'CheckNameAvailabilityInput') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('CheckNameAvailabilityOutput', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - check_front_door_name_availability_with_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/checkFrontDoorNameAvailability'} diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_front_door_name_availability_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_front_door_name_availability_operations.py new file mode 100644 index 000000000000..e37ce4dcc46a --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_front_door_name_availability_operations.py @@ -0,0 +1,101 @@ +# 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 .. import models + + +class FrontDoorNameAvailabilityOperations(object): + """FrontDoorNameAvailabilityOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: Client API version. Constant value: "2020-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-05-01" + + self.config = config + + def check( + self, name, type, custom_headers=None, raw=False, **operation_config): + """Check the availability of a Front Door resource name. + + :param name: The resource name to validate. + :type name: str + :param type: The type of the resource whose name is to be validated. + Possible values include: 'Microsoft.Network/frontDoors', + 'Microsoft.Network/frontDoors/frontendEndpoints' + :type type: str or ~azure.mgmt.frontdoor.models.ResourceType + :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: CheckNameAvailabilityOutput or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.frontdoor.models.CheckNameAvailabilityOutput or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + check_front_door_name_availability_input = models.CheckNameAvailabilityInput(name=name, type=type) + + # Construct URL + url = self.check.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(check_front_door_name_availability_input, 'CheckNameAvailabilityInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CheckNameAvailabilityOutput', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check.metadata = {'url': '/providers/Microsoft.Network/checkFrontDoorNameAvailability'} diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_front_door_name_availability_with_subscription_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_front_door_name_availability_with_subscription_operations.py new file mode 100644 index 000000000000..cdd13a30f660 --- /dev/null +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_front_door_name_availability_with_subscription_operations.py @@ -0,0 +1,105 @@ +# 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 .. import models + + +class FrontDoorNameAvailabilityWithSubscriptionOperations(object): + """FrontDoorNameAvailabilityWithSubscriptionOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: Client API version. Constant value: "2020-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-05-01" + + self.config = config + + def check( + self, name, type, custom_headers=None, raw=False, **operation_config): + """Check the availability of a Front Door subdomain. + + :param name: The resource name to validate. + :type name: str + :param type: The type of the resource whose name is to be validated. + Possible values include: 'Microsoft.Network/frontDoors', + 'Microsoft.Network/frontDoors/frontendEndpoints' + :type type: str or ~azure.mgmt.frontdoor.models.ResourceType + :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: CheckNameAvailabilityOutput or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.frontdoor.models.CheckNameAvailabilityOutput or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + check_front_door_name_availability_input = models.CheckNameAvailabilityInput(name=name, type=type) + + # Construct URL + url = self.check.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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 body + body_content = self._serialize.body(check_front_door_name_availability_input, 'CheckNameAvailabilityInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CheckNameAvailabilityOutput', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/checkFrontDoorNameAvailability'} diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_front_doors_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_front_doors_operations.py index f7eac8409cbe..d8753006b9b3 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_front_doors_operations.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_front_doors_operations.py @@ -26,7 +26,7 @@ class FrontDoorsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2020-01-01". + :ivar api_version: Client API version. Constant value: "2020-05-01". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-01-01" + self.api_version = "2020-05-01" self.config = config diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_frontend_endpoints_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_frontend_endpoints_operations.py index 33a783f00685..f933ca1969c4 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_frontend_endpoints_operations.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_frontend_endpoints_operations.py @@ -26,7 +26,7 @@ class FrontendEndpointsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2020-01-01". + :ivar api_version: Client API version. Constant value: "2020-05-01". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-01-01" + self.api_version = "2020-05-01" self.config = config diff --git a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_rules_engines_operations.py b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_rules_engines_operations.py index 9ed77ab7a1c4..5646cb4dc19b 100644 --- a/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_rules_engines_operations.py +++ b/sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/operations/_rules_engines_operations.py @@ -26,7 +26,7 @@ class RulesEnginesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2020-01-01". + :ivar api_version: Client API version. Constant value: "2020-05-01". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-01-01" + self.api_version = "2020-05-01" self.config = config diff --git a/sdk/network/azure-mgmt-frontdoor/setup.py b/sdk/network/azure-mgmt-frontdoor/setup.py index 2a3a36d9c429..265094e60de7 100644 --- a/sdk/network/azure-mgmt-frontdoor/setup.py +++ b/sdk/network/azure-mgmt-frontdoor/setup.py @@ -36,7 +36,9 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) @@ -67,6 +69,7 @@ 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: MIT License', ], zip_safe=False,