diff --git a/azure-mgmt-web/azure/mgmt/web/models/__init__.py b/azure-mgmt-web/azure/mgmt/web/models/__init__.py index f60ea1a3a7da..aad8d9bfc2fe 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/__init__.py +++ b/azure-mgmt-web/azure/mgmt/web/models/__init__.py @@ -99,6 +99,9 @@ from .localizable_string import LocalizableString from .csm_usage_quota import CsmUsageQuota from .error_entity import ErrorEntity +from .default_error_response_error_details_item import DefaultErrorResponseErrorDetailsItem +from .default_error_response_error import DefaultErrorResponseError +from .default_error_response import DefaultErrorResponse, DefaultErrorResponseException from .operation import Operation from .resource_metric_property import ResourceMetricProperty from .resource_metric_value import ResourceMetricValue @@ -123,6 +126,7 @@ from .application_stack import ApplicationStack from .recommendation import Recommendation from .recommendation_rule import RecommendationRule +from .resource_health_metadata import ResourceHealthMetadata from .csm_move_resource_envelope import CsmMoveResourceEnvelope from .geo_region import GeoRegion from .hosting_environment_deployment_info import HostingEnvironmentDeploymentInfo @@ -226,6 +230,7 @@ from .detector_definition_paged import DetectorDefinitionPaged from .application_stack_paged import ApplicationStackPaged from .recommendation_paged import RecommendationPaged +from .resource_health_metadata_paged import ResourceHealthMetadataPaged from .source_control_paged import SourceControlPaged from .geo_region_paged import GeoRegionPaged from .identifier_paged import IdentifierPaged @@ -413,6 +418,9 @@ 'LocalizableString', 'CsmUsageQuota', 'ErrorEntity', + 'DefaultErrorResponseErrorDetailsItem', + 'DefaultErrorResponseError', + 'DefaultErrorResponse', 'DefaultErrorResponseException', 'Operation', 'ResourceMetricProperty', 'ResourceMetricValue', @@ -437,6 +445,7 @@ 'ApplicationStack', 'Recommendation', 'RecommendationRule', + 'ResourceHealthMetadata', 'CsmMoveResourceEnvelope', 'GeoRegion', 'HostingEnvironmentDeploymentInfo', @@ -540,6 +549,7 @@ 'DetectorDefinitionPaged', 'ApplicationStackPaged', 'RecommendationPaged', + 'ResourceHealthMetadataPaged', 'SourceControlPaged', 'GeoRegionPaged', 'IdentifierPaged', diff --git a/azure-mgmt-web/azure/mgmt/web/models/default_error_response.py b/azure-mgmt-web/azure/mgmt/web/models/default_error_response.py new file mode 100644 index 000000000000..7a16dd576a12 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/default_error_response.py @@ -0,0 +1,48 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class DefaultErrorResponse(Model): + """App Service error response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error: Error model. + :vartype error: ~azure.mgmt.web.models.DefaultErrorResponseError + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'DefaultErrorResponseError'}, + } + + def __init__(self): + super(DefaultErrorResponse, self).__init__() + self.error = None + + +class DefaultErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'DefaultErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(DefaultErrorResponseException, self).__init__(deserialize, response, 'DefaultErrorResponse', *args) diff --git a/azure-mgmt-web/azure/mgmt/web/models/default_error_response_error.py b/azure-mgmt-web/azure/mgmt/web/models/default_error_response_error.py new file mode 100644 index 000000000000..c12f968877e1 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/default_error_response_error.py @@ -0,0 +1,55 @@ +# 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 DefaultErrorResponseError(Model): + """Error model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Standardized string to programmatically identify the error. + :vartype code: str + :ivar message: Detailed error description and debugging information. + :vartype message: str + :ivar target: Detailed error description and debugging information. + :vartype target: str + :param details: + :type details: + list[~azure.mgmt.web.models.DefaultErrorResponseErrorDetailsItem] + :ivar innererror: More information to debug error. + :vartype innererror: str + """ + + _validation = { + 'code': {'required': True, 'readonly': True}, + 'message': {'required': True, 'readonly': True}, + 'target': {'readonly': True}, + 'innererror': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[DefaultErrorResponseErrorDetailsItem]'}, + 'innererror': {'key': 'innererror', 'type': 'str'}, + } + + def __init__(self, details=None): + super(DefaultErrorResponseError, self).__init__() + self.code = None + self.message = None + self.target = None + self.details = details + self.innererror = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/default_error_response_error_details_item.py b/azure-mgmt-web/azure/mgmt/web/models/default_error_response_error_details_item.py new file mode 100644 index 000000000000..bb0a260d8c93 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/default_error_response_error_details_item.py @@ -0,0 +1,45 @@ +# 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 DefaultErrorResponseErrorDetailsItem(Model): + """Detailed errors. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Standardized string to programmatically identify the error. + :vartype code: str + :ivar message: Detailed error description and debugging information. + :vartype message: str + :ivar target: Detailed error description and debugging information. + :vartype target: str + """ + + _validation = { + 'code': {'required': True, 'readonly': True}, + 'message': {'required': True, 'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self): + super(DefaultErrorResponseErrorDetailsItem, self).__init__() + self.code = None + self.message = None + self.target = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_health_metadata.py b/azure-mgmt-web/azure/mgmt/web/models/resource_health_metadata.py new file mode 100644 index 000000000000..25f2a86c4607 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_health_metadata.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 .proxy_only_resource import ProxyOnlyResource + + +class ResourceHealthMetadata(ProxyOnlyResource): + """Used for getting ResourceHealthCheck settings. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param category: The category that the resource matches in the RHC Policy + File + :type category: str + :param signal_availability: Is there a health signal for the resource + :type signal_availability: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'signal_availability': {'key': 'properties.signalAvailability', 'type': 'bool'}, + } + + def __init__(self, kind=None, category=None, signal_availability=None): + super(ResourceHealthMetadata, self).__init__(kind=kind) + self.category = category + self.signal_availability = signal_availability diff --git a/azure-mgmt-web/azure/mgmt/web/models/resource_health_metadata_paged.py b/azure-mgmt-web/azure/mgmt/web/models/resource_health_metadata_paged.py new file mode 100644 index 000000000000..45c9b8c4945b --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/resource_health_metadata_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 ResourceHealthMetadataPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourceHealthMetadata ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourceHealthMetadata]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourceHealthMetadataPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-web/azure/mgmt/web/operations/__init__.py b/azure-mgmt-web/azure/mgmt/web/operations/__init__.py index 93d9712f46bd..55c58c4be3bb 100644 --- a/azure-mgmt-web/azure/mgmt/web/operations/__init__.py +++ b/azure-mgmt-web/azure/mgmt/web/operations/__init__.py @@ -19,6 +19,7 @@ from .diagnostics_operations import DiagnosticsOperations from .provider_operations import ProviderOperations from .recommendations_operations import RecommendationsOperations +from .resource_health_metadata_operations import ResourceHealthMetadataOperations from .web_apps_operations import WebAppsOperations from .app_service_environments_operations import AppServiceEnvironmentsOperations from .app_service_plans_operations import AppServicePlansOperations @@ -34,6 +35,7 @@ 'DiagnosticsOperations', 'ProviderOperations', 'RecommendationsOperations', + 'ResourceHealthMetadataOperations', 'WebAppsOperations', 'AppServiceEnvironmentsOperations', 'AppServicePlansOperations', diff --git a/azure-mgmt-web/azure/mgmt/web/operations/resource_health_metadata_operations.py b/azure-mgmt-web/azure/mgmt/web/operations/resource_health_metadata_operations.py new file mode 100644 index 000000000000..2b8b44f45e60 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/operations/resource_health_metadata_operations.py @@ -0,0 +1,461 @@ +# 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 ResourceHealthMetadataOperations(object): + """ResourceHealthMetadataOperations 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: API Version. Constant value: "2016-03-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-03-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List all ResourceHealthMetadata for all sites in the subscription. + + List all ResourceHealthMetadata for all sites in the subscription. + + :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 ResourceHealthMetadata + :rtype: + ~azure.mgmt.web.models.ResourceHealthMetadataPaged[~azure.mgmt.web.models.ResourceHealthMetadata] + :raises: + :class:`DefaultErrorResponseException` + """ + 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 = {} + 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]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ResourceHealthMetadataPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ResourceHealthMetadataPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/resourceHealthMetadata'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """List all ResourceHealthMetadata for all sites in the resource group in + the subscription. + + List all ResourceHealthMetadata for all sites in the resource group in + the subscription. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_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: An iterator like instance of ResourceHealthMetadata + :rtype: + ~azure.mgmt.web.models.ResourceHealthMetadataPaged[~azure.mgmt.web.models.ResourceHealthMetadata] + :raises: + :class:`DefaultErrorResponseException` + """ + 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 = {} + 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]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ResourceHealthMetadataPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ResourceHealthMetadataPaged(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.Web/resourceHealthMetadata'} + + def list_by_site( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Gets the category of ResourceHealthMetadata to use for the given site + as a collection. + + Gets the category of ResourceHealthMetadata to use for the given site + as a collection. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type 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: An iterator like instance of ResourceHealthMetadata + :rtype: + ~azure.mgmt.web.models.ResourceHealthMetadataPaged[~azure.mgmt.web.models.ResourceHealthMetadata] + :raises: + :class:`DefaultErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_site.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\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", 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') + + 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]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ResourceHealthMetadataPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ResourceHealthMetadataPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata'} + + def get_by_site( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Gets the category of ResourceHealthMetadata to use for the given site. + + Gets the category of ResourceHealthMetadata to use for the given site. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of web app + :type 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: ResourceHealthMetadata or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.ResourceHealthMetadata or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.get_by_site.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\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", 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]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ResourceHealthMetadata', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata/default'} + + def list_by_site_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Gets the category of ResourceHealthMetadata to use for the given site + as a collection. + + Gets the category of ResourceHealthMetadata to use for the given site + as a collection. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default + to production slot. + :type slot: 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 ResourceHealthMetadata + :rtype: + ~azure.mgmt.web.models.ResourceHealthMetadataPaged[~azure.mgmt.web.models.ResourceHealthMetadata] + :raises: + :class:`DefaultErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_site_slot.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\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, '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') + + 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]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ResourceHealthMetadataPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ResourceHealthMetadataPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_site_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata'} + + def get_by_site_slot( + self, resource_group_name, name, slot, custom_headers=None, raw=False, **operation_config): + """Gets the category of ResourceHealthMetadata to use for the given site. + + Gets the category of ResourceHealthMetadata to use for the given site. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Name of web app + :type name: str + :param slot: Name of web app slot. If not specified then will default + to production slot. + :type slot: 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: ResourceHealthMetadata or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.ResourceHealthMetadata or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DefaultErrorResponseException` + """ + # Construct URL + url = self.get_by_site_slot.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\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, '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]: + raise models.DefaultErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ResourceHealthMetadata', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_site_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata/default'} diff --git a/azure-mgmt-web/azure/mgmt/web/operations/web_apps_operations.py b/azure-mgmt-web/azure/mgmt/web/operations/web_apps_operations.py index 1d1bb5d4bb57..3bf64d3266ad 100644 --- a/azure-mgmt-web/azure/mgmt/web/operations/web_apps_operations.py +++ b/azure-mgmt-web/azure/mgmt/web/operations/web_apps_operations.py @@ -248,7 +248,7 @@ def get( def _create_or_update_initial( - self, resource_group_name, name, site_envelope, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, site_envelope, skip_dns_registration=None, skip_custom_domain_verification=None, force_dns_registration=None, ttl_in_seconds=None, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -260,6 +260,14 @@ def _create_or_update_initial( # Construct parameters query_parameters = {} + if skip_dns_registration is not None: + query_parameters['skipDnsRegistration'] = self._serialize.query("skip_dns_registration", skip_dns_registration, 'bool') + if skip_custom_domain_verification is not None: + query_parameters['skipCustomDomainVerification'] = self._serialize.query("skip_custom_domain_verification", skip_custom_domain_verification, 'bool') + if force_dns_registration is not None: + query_parameters['forceDnsRegistration'] = self._serialize.query("force_dns_registration", force_dns_registration, 'bool') + if ttl_in_seconds is not None: + query_parameters['ttlInSeconds'] = self._serialize.query("ttl_in_seconds", ttl_in_seconds, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers @@ -299,7 +307,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, name, site_envelope, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, site_envelope, skip_dns_registration=None, skip_custom_domain_verification=None, force_dns_registration=None, ttl_in_seconds=None, custom_headers=None, raw=False, **operation_config): """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. @@ -315,6 +323,19 @@ def create_or_update( :param site_envelope: A JSON representation of the app properties. See example. :type site_envelope: ~azure.mgmt.web.models.Site + :param skip_dns_registration: If true web app hostname is not + registered with DNS on creation. This parameter is + only used for app creation. + :type skip_dns_registration: bool + :param skip_custom_domain_verification: If true, custom (non + *.azurewebsites.net) domains associated with web app are not verified. + :type skip_custom_domain_verification: bool + :param force_dns_registration: If true, web app hostname is force + registered with DNS. + :type force_dns_registration: bool + :param ttl_in_seconds: Time to live in seconds for web app's default + domain name. + :type ttl_in_seconds: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -329,6 +350,10 @@ def create_or_update( resource_group_name=resource_group_name, name=name, site_envelope=site_envelope, + skip_dns_registration=skip_dns_registration, + skip_custom_domain_verification=skip_custom_domain_verification, + force_dns_registration=force_dns_registration, + ttl_in_seconds=ttl_in_seconds, custom_headers=custom_headers, raw=True, **operation_config @@ -374,7 +399,7 @@ def get_long_running_output(response): create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} def delete( - self, resource_group_name, name, delete_metrics=None, delete_empty_server_farm=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, delete_metrics=None, delete_empty_server_farm=None, skip_dns_registration=None, custom_headers=None, raw=False, **operation_config): """Deletes a web, mobile, or API app, or one of the deployment slots. Deletes a web, mobile, or API app, or one of the deployment slots. @@ -390,6 +415,8 @@ def delete( will be empty after app deletion and you want to delete the empty App Service plan. By default, the empty App Service plan is not deleted. :type delete_empty_server_farm: bool + :param skip_dns_registration: If true, DNS registration is skipped. + :type skip_dns_registration: bool :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -414,6 +441,8 @@ def delete( query_parameters['deleteMetrics'] = self._serialize.query("delete_metrics", delete_metrics, 'bool') if delete_empty_server_farm is not None: query_parameters['deleteEmptyServerFarm'] = self._serialize.query("delete_empty_server_farm", delete_empty_server_farm, 'bool') + if skip_dns_registration is not None: + query_parameters['skipDnsRegistration'] = self._serialize.query("skip_dns_registration", skip_dns_registration, 'bool') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers @@ -441,7 +470,7 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} def update( - self, resource_group_name, name, site_envelope, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, site_envelope, skip_dns_registration=None, skip_custom_domain_verification=None, force_dns_registration=None, ttl_in_seconds=None, custom_headers=None, raw=False, **operation_config): """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. @@ -457,6 +486,19 @@ def update( :param site_envelope: A JSON representation of the app properties. See example. :type site_envelope: ~azure.mgmt.web.models.SitePatchResource + :param skip_dns_registration: If true web app hostname is not + registered with DNS on creation. This parameter is + only used for app creation. + :type skip_dns_registration: bool + :param skip_custom_domain_verification: If true, custom (non + *.azurewebsites.net) domains associated with web app are not verified. + :type skip_custom_domain_verification: bool + :param force_dns_registration: If true, web app hostname is force + registered with DNS. + :type force_dns_registration: bool + :param ttl_in_seconds: Time to live in seconds for web app's default + domain name. + :type ttl_in_seconds: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -478,6 +520,14 @@ def update( # Construct parameters query_parameters = {} + if skip_dns_registration is not None: + query_parameters['skipDnsRegistration'] = self._serialize.query("skip_dns_registration", skip_dns_registration, 'bool') + if skip_custom_domain_verification is not None: + query_parameters['skipCustomDomainVerification'] = self._serialize.query("skip_custom_domain_verification", skip_custom_domain_verification, 'bool') + if force_dns_registration is not None: + query_parameters['forceDnsRegistration'] = self._serialize.query("force_dns_registration", force_dns_registration, 'bool') + if ttl_in_seconds is not None: + query_parameters['ttlInSeconds'] = self._serialize.query("ttl_in_seconds", ttl_in_seconds, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers diff --git a/azure-mgmt-web/azure/mgmt/web/web_site_management_client.py b/azure-mgmt-web/azure/mgmt/web/web_site_management_client.py index a7da435b33ab..48e5cff90861 100644 --- a/azure-mgmt-web/azure/mgmt/web/web_site_management_client.py +++ b/azure-mgmt-web/azure/mgmt/web/web_site_management_client.py @@ -27,6 +27,7 @@ from .operations.diagnostics_operations import DiagnosticsOperations from .operations.provider_operations import ProviderOperations from .operations.recommendations_operations import RecommendationsOperations +from .operations.resource_health_metadata_operations import ResourceHealthMetadataOperations from .operations.web_apps_operations import WebAppsOperations from .operations.app_service_environments_operations import AppServiceEnvironmentsOperations from .operations.app_service_plans_operations import AppServicePlansOperations @@ -92,6 +93,8 @@ class WebSiteManagementClient(object): :vartype provider: azure.mgmt.web.operations.ProviderOperations :ivar recommendations: Recommendations operations :vartype recommendations: azure.mgmt.web.operations.RecommendationsOperations + :ivar resource_health_metadata: ResourceHealthMetadata operations + :vartype resource_health_metadata: azure.mgmt.web.operations.ResourceHealthMetadataOperations :ivar web_apps: WebApps operations :vartype web_apps: azure.mgmt.web.operations.WebAppsOperations :ivar app_service_environments: AppServiceEnvironments operations @@ -138,6 +141,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.recommendations = RecommendationsOperations( self._client, self.config, self._serialize, self._deserialize) + self.resource_health_metadata = ResourceHealthMetadataOperations( + self._client, self.config, self._serialize, self._deserialize) self.web_apps = WebAppsOperations( self._client, self.config, self._serialize, self._deserialize) self.app_service_environments = AppServiceEnvironmentsOperations(