diff --git a/azure-mgmt-web/azure/mgmt/web/models/__init__.py b/azure-mgmt-web/azure/mgmt/web/models/__init__.py index 5807858a38b6..1e376153b5a4 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/__init__.py +++ b/azure-mgmt-web/azure/mgmt/web/models/__init__.py @@ -118,6 +118,12 @@ from .response_meta_data import ResponseMetaData from .analysis_data import AnalysisData from .analysis_definition import AnalysisDefinition +from .data_table_response_column import DataTableResponseColumn +from .data_table_response_object import DataTableResponseObject +from .detector_info import DetectorInfo +from .rendering import Rendering +from .diagnostic_data import DiagnosticData +from .detector_response import DetectorResponse from .diagnostic_analysis import DiagnosticAnalysis from .diagnostic_category import DiagnosticCategory from .diagnostic_detector_response import DiagnosticDetectorResponse @@ -226,6 +232,7 @@ from .tld_legal_agreement_paged import TldLegalAgreementPaged from .certificate_paged import CertificatePaged from .deleted_site_paged import DeletedSitePaged +from .detector_response_paged import DetectorResponsePaged from .diagnostic_category_paged import DiagnosticCategoryPaged from .analysis_definition_paged import AnalysisDefinitionPaged from .detector_definition_paged import DetectorDefinitionPaged @@ -301,6 +308,7 @@ OperationStatus, IssueType, SolutionType, + RenderingType, ResourceScopeType, NotificationLevel, Channels, @@ -439,6 +447,12 @@ 'ResponseMetaData', 'AnalysisData', 'AnalysisDefinition', + 'DataTableResponseColumn', + 'DataTableResponseObject', + 'DetectorInfo', + 'Rendering', + 'DiagnosticData', + 'DetectorResponse', 'DiagnosticAnalysis', 'DiagnosticCategory', 'DiagnosticDetectorResponse', @@ -547,6 +561,7 @@ 'TldLegalAgreementPaged', 'CertificatePaged', 'DeletedSitePaged', + 'DetectorResponsePaged', 'DiagnosticCategoryPaged', 'AnalysisDefinitionPaged', 'DetectorDefinitionPaged', @@ -621,6 +636,7 @@ 'OperationStatus', 'IssueType', 'SolutionType', + 'RenderingType', 'ResourceScopeType', 'NotificationLevel', 'Channels', diff --git a/azure-mgmt-web/azure/mgmt/web/models/data_table_response_column.py b/azure-mgmt-web/azure/mgmt/web/models/data_table_response_column.py new file mode 100644 index 000000000000..388f033f30b3 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/data_table_response_column.py @@ -0,0 +1,36 @@ +# 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 DataTableResponseColumn(Model): + """Column definition. + + :param column_name: Name of the column + :type column_name: str + :param data_type: Data type which looks like 'String' or 'Int32'. + :type data_type: str + :param column_type: Column Type + :type column_type: str + """ + + _attribute_map = { + 'column_name': {'key': 'columnName', 'type': 'str'}, + 'data_type': {'key': 'dataType', 'type': 'str'}, + 'column_type': {'key': 'columnType', 'type': 'str'}, + } + + def __init__(self, column_name=None, data_type=None, column_type=None): + super(DataTableResponseColumn, self).__init__() + self.column_name = column_name + self.data_type = data_type + self.column_type = column_type diff --git a/azure-mgmt-web/azure/mgmt/web/models/data_table_response_object.py b/azure-mgmt-web/azure/mgmt/web/models/data_table_response_object.py new file mode 100644 index 000000000000..3d3ba7bb8e93 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/data_table_response_object.py @@ -0,0 +1,36 @@ +# 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 DataTableResponseObject(Model): + """Data Table which defines columns and raw row values. + + :param table_name: Name of the table + :type table_name: str + :param columns: List of columns with data types + :type columns: list[~azure.mgmt.web.models.DataTableResponseColumn] + :param rows: Raw row values + :type rows: list[list[str]] + """ + + _attribute_map = { + 'table_name': {'key': 'tableName', 'type': 'str'}, + 'columns': {'key': 'columns', 'type': '[DataTableResponseColumn]'}, + 'rows': {'key': 'rows', 'type': '[[str]]'}, + } + + def __init__(self, table_name=None, columns=None, rows=None): + super(DataTableResponseObject, self).__init__() + self.table_name = table_name + self.columns = columns + self.rows = rows diff --git a/azure-mgmt-web/azure/mgmt/web/models/detector_info.py b/azure-mgmt-web/azure/mgmt/web/models/detector_info.py new file mode 100644 index 000000000000..4c01fe87ecea --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/detector_info.py @@ -0,0 +1,50 @@ +# 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 DetectorInfo(Model): + """Definition of Detector. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar description: Short description of the detector and its purpose + :vartype description: str + :ivar category: Support Category + :vartype category: str + :ivar sub_category: Support Sub Category + :vartype sub_category: str + :ivar support_topic_id: Support Topic Id + :vartype support_topic_id: str + """ + + _validation = { + 'description': {'readonly': True}, + 'category': {'readonly': True}, + 'sub_category': {'readonly': True}, + 'support_topic_id': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'sub_category': {'key': 'subCategory', 'type': 'str'}, + 'support_topic_id': {'key': 'supportTopicId', 'type': 'str'}, + } + + def __init__(self): + super(DetectorInfo, self).__init__() + self.description = None + self.category = None + self.sub_category = None + self.support_topic_id = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/detector_response.py b/azure-mgmt-web/azure/mgmt/web/models/detector_response.py new file mode 100644 index 000000000000..bfaf8d33cb36 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/detector_response.py @@ -0,0 +1,53 @@ +# 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 DetectorResponse(ProxyOnlyResource): + """Class representing Response from Detector. + + 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 metadata: metadata for the detector + :type metadata: ~azure.mgmt.web.models.DetectorInfo + :param dataset: Data Set + :type dataset: list[~azure.mgmt.web.models.DiagnosticData] + """ + + _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'}, + 'metadata': {'key': 'properties.metadata', 'type': 'DetectorInfo'}, + 'dataset': {'key': 'properties.dataset', 'type': '[DiagnosticData]'}, + } + + def __init__(self, kind=None, metadata=None, dataset=None): + super(DetectorResponse, self).__init__(kind=kind) + self.metadata = metadata + self.dataset = dataset diff --git a/azure-mgmt-web/azure/mgmt/web/models/detector_response_paged.py b/azure-mgmt-web/azure/mgmt/web/models/detector_response_paged.py new file mode 100644 index 000000000000..57ed8d9b2788 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/detector_response_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 DetectorResponsePaged(Paged): + """ + A paging container for iterating over a list of :class:`DetectorResponse ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DetectorResponse]'} + } + + def __init__(self, *args, **kwargs): + + super(DetectorResponsePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-web/azure/mgmt/web/models/diagnostic_data.py b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_data.py new file mode 100644 index 000000000000..7208684bfb30 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/diagnostic_data.py @@ -0,0 +1,33 @@ +# 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 DiagnosticData(Model): + """Set of data with rendering instructions. + + :param table: Data in table form + :type table: ~azure.mgmt.web.models.DataTableResponseObject + :param rendering_properties: Properties that describe how the table should + be rendered + :type rendering_properties: ~azure.mgmt.web.models.Rendering + """ + + _attribute_map = { + 'table': {'key': 'table', 'type': 'DataTableResponseObject'}, + 'rendering_properties': {'key': 'renderingProperties', 'type': 'Rendering'}, + } + + def __init__(self, table=None, rendering_properties=None): + super(DiagnosticData, self).__init__() + self.table = table + self.rendering_properties = rendering_properties diff --git a/azure-mgmt-web/azure/mgmt/web/models/rendering.py b/azure-mgmt-web/azure/mgmt/web/models/rendering.py new file mode 100644 index 000000000000..c8b709727043 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/rendering.py @@ -0,0 +1,38 @@ +# 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 Rendering(Model): + """Instructions for rendering the data. + + :param rendering_type: Rendering Type. Possible values include: 'NoGraph', + 'Table', 'TimeSeries', 'TimeSeriesPerInstance' + :type rendering_type: str or ~azure.mgmt.web.models.RenderingType + :param title: Title of data + :type title: str + :param description: Description of the data that will help it be + interpreted + :type description: str + """ + + _attribute_map = { + 'rendering_type': {'key': 'renderingType', 'type': 'RenderingType'}, + 'title': {'key': 'title', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, rendering_type=None, title=None, description=None): + super(Rendering, self).__init__() + self.rendering_type = rendering_type + self.title = title + self.description = description diff --git a/azure-mgmt-web/azure/mgmt/web/models/web_site_management_client_enums.py b/azure-mgmt-web/azure/mgmt/web/models/web_site_management_client_enums.py index 0b311784c359..4636a2b0e7d6 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/web_site_management_client_enums.py +++ b/azure-mgmt-web/azure/mgmt/web/models/web_site_management_client_enums.py @@ -302,6 +302,14 @@ class SolutionType(Enum): best_practices = "BestPractices" +class RenderingType(Enum): + + no_graph = "NoGraph" + table = "Table" + time_series = "TimeSeries" + time_series_per_instance = "TimeSeriesPerInstance" + + class ResourceScopeType(Enum): server_farm = "ServerFarm" diff --git a/azure-mgmt-web/azure/mgmt/web/operations/diagnostics_operations.py b/azure-mgmt-web/azure/mgmt/web/operations/diagnostics_operations.py index 1e912118452c..90609947d199 100644 --- a/azure-mgmt-web/azure/mgmt/web/operations/diagnostics_operations.py +++ b/azure-mgmt-web/azure/mgmt/web/operations/diagnostics_operations.py @@ -37,6 +37,314 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def list_hosting_environment_detector_responses( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """List Hosting Environment Detector Responses. + + List Hosting Environment Detector Responses. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: Site Name + :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 DetectorResponse + :rtype: + ~azure.mgmt.web.models.DetectorResponsePaged[~azure.mgmt.web.models.DetectorResponse] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_hosting_environment_detector_responses.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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.DetectorResponsePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DetectorResponsePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_hosting_environment_detector_responses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors'} + + def get_hosting_environment_detector_response( + self, resource_group_name, name, detector_name, start_time=None, end_time=None, time_grain=None, custom_headers=None, raw=False, **operation_config): + """Get Hosting Environment Detector Response. + + Get Hosting Environment Detector Response. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param name: App Service Environment Name + :type name: str + :param detector_name: Detector Resource Name + :type detector_name: str + :param start_time: Start Time + :type start_time: datetime + :param end_time: End Time + :type end_time: datetime + :param time_grain: Time Grain + :type time_grain: 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: DetectorResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.DetectorResponse or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_hosting_environment_detector_response.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'), + 'detectorName': self._serialize.url("detector_name", detector_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 start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + 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('DetectorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_hosting_environment_detector_response.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors/{detectorName}'} + + def list_site_detector_responses( + self, resource_group_name, site_name, custom_headers=None, raw=False, **operation_config): + """List Site Detector Responses. + + List Site Detector Responses. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param site_name: Site Name + :type site_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 DetectorResponse + :rtype: + ~azure.mgmt.web.models.DetectorResponsePaged[~azure.mgmt.web.models.DetectorResponse] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_site_detector_responses.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\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.DetectorResponsePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DetectorResponsePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_site_detector_responses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors'} + + def get_site_detector_response( + self, resource_group_name, site_name, detector_name, start_time=None, end_time=None, time_grain=None, custom_headers=None, raw=False, **operation_config): + """Get site detector response. + + Get site detector response. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param site_name: Site Name + :type site_name: str + :param detector_name: Detector Resource Name + :type detector_name: str + :param start_time: Start Time + :type start_time: datetime + :param end_time: End Time + :type end_time: datetime + :param time_grain: Time Grain + :type time_grain: 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: DetectorResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.DetectorResponse or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_site_detector_response.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\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_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 start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + 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('DetectorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_site_detector_response.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors/{detectorName}'} + def list_site_diagnostic_categories( self, resource_group_name, site_name, custom_headers=None, raw=False, **operation_config): """Get Diagnostics Categories. @@ -650,6 +958,166 @@ def execute_site_detector( return deserialized execute_site_detector.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute'} + def list_site_detector_responses_slot( + self, resource_group_name, site_name, slot, custom_headers=None, raw=False, **operation_config): + """List Site Detector Responses. + + List Site Detector Responses. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param site_name: Site Name + :type site_name: str + :param slot: Slot Name + :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 DetectorResponse + :rtype: + ~azure.mgmt.web.models.DetectorResponsePaged[~azure.mgmt.web.models.DetectorResponse] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_site_detector_responses_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\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.DetectorResponsePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DetectorResponsePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_site_detector_responses_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors'} + + def get_site_detector_response_slot( + self, resource_group_name, site_name, detector_name, slot, start_time=None, end_time=None, time_grain=None, custom_headers=None, raw=False, **operation_config): + """Get site detector response. + + Get site detector response. + + :param resource_group_name: Name of the resource group to which the + resource belongs. + :type resource_group_name: str + :param site_name: Site Name + :type site_name: str + :param detector_name: Detector Resource Name + :type detector_name: str + :param slot: Slot Name + :type slot: str + :param start_time: Start Time + :type start_time: datetime + :param end_time: End Time + :type end_time: datetime + :param time_grain: Time Grain + :type time_grain: 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: DetectorResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.web.models.DetectorResponse or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_site_detector_response_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\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_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 = {} + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + 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('DetectorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_site_detector_response_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors/{detectorName}'} + def list_site_diagnostic_categories_slot( self, resource_group_name, site_name, slot, custom_headers=None, raw=False, **operation_config): """Get Diagnostics Categories. 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..89bcbe7254e9 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 @@ -19767,7 +19767,7 @@ def get_source_control_slot( 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]: + if response.status_code not in [200, 201, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -19776,6 +19776,10 @@ def get_source_control_slot( if response.status_code == 200: deserialized = self._deserialize('SiteSourceControl', response) + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', response) + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -19819,7 +19823,7 @@ def _create_or_update_source_control_slot_initial( response = self._client.send( request, header_parameters, body_content, stream=False, **operation_config) - if response.status_code not in [200, 201]: + if response.status_code not in [200, 201, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -19830,6 +19834,8 @@ def _create_or_update_source_control_slot_initial( deserialized = self._deserialize('SiteSourceControl', response) if response.status_code == 201: deserialized = self._deserialize('SiteSourceControl', response) + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -19893,7 +19899,7 @@ def get_long_running_status(status_link, headers=None): def get_long_running_output(response): - if response.status_code not in [200, 201]: + if response.status_code not in [200, 201, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp