diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/_application_insights_management_client.py index d2d1abb1bbf7..a2d5c125b898 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/_application_insights_management_client.py @@ -65,7 +65,7 @@ class ApplicationInsightsManagementClient(MultiApiClientMixin, SDKClient): 'ea_subscription_rollback_to_legacy_pricing_model': '2017-10-01', 'export_configurations': '2015-05-01', 'favorites': '2015-05-01', - 'operations': '2015-05-01', + 'my_workbooks': '2015-05-01', 'proactive_detection_configurations': '2018-05-01-preview', 'queries': '2019-09-01-preview', 'query_packs': '2019-09-01-preview', @@ -103,6 +103,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2019-10-17-preview: :mod:`v2019_10_17_preview.models` * 2020-02-02-preview: :mod:`v2020_02_02_preview.models` * 2020-03-01-preview: :mod:`v2020_03_01_preview.models` + * 2020-06-02-preview: :mod:`v2020_06_02-preview.models` """ if api_version == '2015-05-01': from .v2015_05_01 import models @@ -128,6 +129,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2020-03-01-preview': from .v2020_03_01_preview import models return models + elif api_version == '2020-06-02-preview': + from .v2020_06_02-preview import models + return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) @property @@ -331,15 +335,44 @@ def favorites(self): raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def live_token(self): + """Instance depends on the API version: + + * 2020-06-02-preview: :class:`LiveTokenOperations` + """ + api_version = self._get_api_version('live_token') + if api_version == '2020-06-02-preview': + from .v2020_06_02-preview.operations import LiveTokenOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def my_workbooks(self): + """Instance depends on the API version: + + * 2015-05-01: :class:`MyWorkbooksOperations` + """ + api_version = self._get_api_version('my_workbooks') + if api_version == '2015-05-01': + from .v2015_05_01.operations import MyWorkbooksOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def operations(self): """Instance depends on the API version: * 2015-05-01: :class:`Operations` + * 2020-06-02-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2015-05-01': from .v2015_05_01.operations import Operations as OperationClass + elif api_version == '2020-06-02-preview': + from .v2020_06_02-preview.operations import Operations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_application_insights_management_client.py index 59e90899d578..8d89657283ea 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_application_insights_management_client.py @@ -29,6 +29,7 @@ from .operations import WebTestsOperations from .operations import AnalyticsItemsOperations from .operations import WorkbooksOperations +from .operations import MyWorkbooksOperations from . import models @@ -70,6 +71,8 @@ class ApplicationInsightsManagementClient(SDKClient): :vartype analytics_items: azure.mgmt.applicationinsights.v2015_05_01.operations.AnalyticsItemsOperations :ivar workbooks: Workbooks operations :vartype workbooks: azure.mgmt.applicationinsights.v2015_05_01.operations.WorkbooksOperations + :ivar my_workbooks: MyWorkbooks operations + :vartype my_workbooks: azure.mgmt.applicationinsights.v2015_05_01.operations.MyWorkbooksOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -122,3 +125,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.workbooks = WorkbooksOperations( self._client, self.config, self._serialize, self._deserialize) + self.my_workbooks = MyWorkbooksOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/__init__.py index fa8f959cc5d8..6c6e1c436148 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/__init__.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/__init__.py @@ -39,6 +39,9 @@ from ._models_py3 import ErrorResponse, ErrorResponseException from ._models_py3 import InnerError from ._models_py3 import LinkProperties + from ._models_py3 import MyWorkbook + from ._models_py3 import MyWorkbookError, MyWorkbookErrorException + from ._models_py3 import MyWorkbookResource from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import PrivateLinkScopedResource @@ -83,6 +86,9 @@ from ._models import ErrorResponse, ErrorResponseException from ._models import InnerError from ._models import LinkProperties + from ._models import MyWorkbook + from ._models import MyWorkbookError, MyWorkbookErrorException + from ._models import MyWorkbookResource from ._models import Operation from ._models import OperationDisplay from ._models import PrivateLinkScopedResource @@ -101,6 +107,7 @@ from ._paged_models import ApplicationInsightsComponentAPIKeyPaged from ._paged_models import ApplicationInsightsComponentPaged from ._paged_models import ApplicationInsightsComponentWebTestLocationPaged +from ._paged_models import MyWorkbookPaged from ._paged_models import OperationPaged from ._paged_models import WebTestPaged from ._paged_models import WorkbookPaged @@ -109,6 +116,7 @@ ApplicationType, FlowType, RequestSource, + IngestionMode, PurgeState, FavoriteType, WebTestKind, @@ -151,6 +159,9 @@ 'ErrorResponse', 'ErrorResponseException', 'InnerError', 'LinkProperties', + 'MyWorkbook', + 'MyWorkbookError', 'MyWorkbookErrorException', + 'MyWorkbookResource', 'Operation', 'OperationDisplay', 'PrivateLinkScopedResource', @@ -173,9 +184,11 @@ 'ApplicationInsightsComponentWebTestLocationPaged', 'WebTestPaged', 'WorkbookPaged', + 'MyWorkbookPaged', 'ApplicationType', 'FlowType', 'RequestSource', + 'IngestionMode', 'PurgeState', 'FavoriteType', 'WebTestKind', diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_application_insights_management_client_enums.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_application_insights_management_client_enums.py index 1c2f9886c302..bd218e36d5f1 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_application_insights_management_client_enums.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_application_insights_management_client_enums.py @@ -28,6 +28,13 @@ class RequestSource(str, Enum): rest = "rest" +class IngestionMode(str, Enum): + + application_insights = "ApplicationInsights" + application_insights_with_diagnostic_settings = "ApplicationInsightsWithDiagnosticSettings" + log_analytics = "LogAnalytics" + + class PurgeState(str, Enum): pending = "pending" diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_models.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_models.py index 472d68d45031..68cfebc653bf 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_models.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_models.py @@ -236,6 +236,12 @@ class ApplicationInsightsComponent(ComponentsResource): resources. :vartype private_link_scoped_resources: list[~azure.mgmt.applicationinsights.v2015_05_01.models.PrivateLinkScopedResource] + :param ingestion_mode: Indicates the flow of the ingestion. Possible + values include: 'ApplicationInsights', + 'ApplicationInsightsWithDiagnosticSettings', 'LogAnalytics'. Default + value: "ApplicationInsights" . + :type ingestion_mode: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.IngestionMode """ _validation = { @@ -280,6 +286,7 @@ class ApplicationInsightsComponent(ComponentsResource): 'disable_ip_masking': {'key': 'properties.DisableIpMasking', 'type': 'bool'}, 'immediate_purge_data_on30_days': {'key': 'properties.ImmediatePurgeDataOn30Days', 'type': 'bool'}, 'private_link_scoped_resources': {'key': 'properties.PrivateLinkScopedResources', 'type': '[PrivateLinkScopedResource]'}, + 'ingestion_mode': {'key': 'properties.IngestionMode', 'type': 'str'}, } def __init__(self, **kwargs): @@ -302,6 +309,7 @@ def __init__(self, **kwargs): self.disable_ip_masking = kwargs.get('disable_ip_masking', None) self.immediate_purge_data_on30_days = kwargs.get('immediate_purge_data_on30_days', None) self.private_link_scoped_resources = None + self.ingestion_mode = kwargs.get('ingestion_mode', "ApplicationInsights") class ApplicationInsightsComponentAnalyticsItem(Model): @@ -1381,6 +1389,162 @@ def __init__(self, **kwargs): self.category = kwargs.get('category', None) +class MyWorkbookResource(Model): + """An azure resource object. + + :param id: Azure resource Id + :type id: str + :param name: Azure resource name + :type name: str + :param type: Azure resource type + :type type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(MyWorkbookResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class MyWorkbook(MyWorkbookResource): + """An Application Insights private workbook definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Azure resource Id + :type id: str + :param name: Azure resource name + :type name: str + :param type: Azure resource type + :type type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: The kind of workbook. Choices are user and shared. Possible + values include: 'user', 'shared' + :type kind: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.SharedTypeKind + :param display_name: Required. The user-defined name of the private + workbook. + :type display_name: str + :param serialized_data: Required. Configuration of this particular private + workbook. Configuration data is a string containing valid JSON + :type serialized_data: str + :param version: This instance's version of the data model. This can change + as new features are added that can be marked private workbook. + :type version: str + :ivar time_modified: Date and time in UTC of the last modification that + was made to this private workbook definition. + :vartype time_modified: str + :param category: Required. Workbook category, as defined by the user at + creation time. + :type category: str + :param my_workbook_tags: A list of 0 or more tags that are associated with + this private workbook definition + :type my_workbook_tags: list[str] + :ivar user_id: Unique user id of the specific user that owns this private + workbook. + :vartype user_id: str + :param source_id: Optional resourceId for a source resource. + :type source_id: str + """ + + _validation = { + 'display_name': {'required': True}, + 'serialized_data': {'required': True}, + 'time_modified': {'readonly': True}, + 'category': {'required': True}, + 'user_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'serialized_data': {'key': 'properties.serializedData', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'time_modified': {'key': 'properties.timeModified', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'my_workbook_tags': {'key': 'properties.tags', 'type': '[str]'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'source_id': {'key': 'properties.sourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MyWorkbook, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.display_name = kwargs.get('display_name', None) + self.serialized_data = kwargs.get('serialized_data', None) + self.version = kwargs.get('version', None) + self.time_modified = None + self.category = kwargs.get('category', None) + self.my_workbook_tags = kwargs.get('my_workbook_tags', None) + self.user_id = None + self.source_id = kwargs.get('source_id', None) + + +class MyWorkbookError(Model): + """Error message body that will indicate why the operation failed. + + :param code: Service-defined error code. This code serves as a sub-status + for the HTTP error code specified in the response. + :type code: str + :param message: Human-readable representation of the error. + :type message: str + :param details: The list of invalid fields send in request, in case of + validation error. + :type details: + list[~azure.mgmt.applicationinsights.v2015_05_01.models.ErrorFieldContract] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, + } + + def __init__(self, **kwargs): + super(MyWorkbookError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) + + +class MyWorkbookErrorException(HttpOperationError): + """Server responsed with exception of type: 'MyWorkbookError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(MyWorkbookErrorException, self).__init__(deserialize, response, 'MyWorkbookError', *args) + + class Operation(Model): """CDN REST API operation. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_models_py3.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_models_py3.py index 9d4210e5ffd9..91cd926e2b11 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_models_py3.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_models_py3.py @@ -236,6 +236,12 @@ class ApplicationInsightsComponent(ComponentsResource): resources. :vartype private_link_scoped_resources: list[~azure.mgmt.applicationinsights.v2015_05_01.models.PrivateLinkScopedResource] + :param ingestion_mode: Indicates the flow of the ingestion. Possible + values include: 'ApplicationInsights', + 'ApplicationInsightsWithDiagnosticSettings', 'LogAnalytics'. Default + value: "ApplicationInsights" . + :type ingestion_mode: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.IngestionMode """ _validation = { @@ -280,9 +286,10 @@ class ApplicationInsightsComponent(ComponentsResource): 'disable_ip_masking': {'key': 'properties.DisableIpMasking', 'type': 'bool'}, 'immediate_purge_data_on30_days': {'key': 'properties.ImmediatePurgeDataOn30Days', 'type': 'bool'}, 'private_link_scoped_resources': {'key': 'properties.PrivateLinkScopedResources', 'type': '[PrivateLinkScopedResource]'}, + 'ingestion_mode': {'key': 'properties.IngestionMode', 'type': 'str'}, } - def __init__(self, *, location: str, kind: str, tags=None, application_type="web", flow_type="Bluefield", request_source="rest", hockey_app_id: str=None, sampling_percentage: float=None, retention_in_days: int=90, disable_ip_masking: bool=None, immediate_purge_data_on30_days: bool=None, **kwargs) -> None: + def __init__(self, *, location: str, kind: str, tags=None, application_type="web", flow_type="Bluefield", request_source="rest", hockey_app_id: str=None, sampling_percentage: float=None, retention_in_days: int=90, disable_ip_masking: bool=None, immediate_purge_data_on30_days: bool=None, ingestion_mode="ApplicationInsights", **kwargs) -> None: super(ApplicationInsightsComponent, self).__init__(location=location, tags=tags, **kwargs) self.kind = kind self.application_id = None @@ -302,6 +309,7 @@ def __init__(self, *, location: str, kind: str, tags=None, application_type="web self.disable_ip_masking = disable_ip_masking self.immediate_purge_data_on30_days = immediate_purge_data_on30_days self.private_link_scoped_resources = None + self.ingestion_mode = ingestion_mode class ApplicationInsightsComponentAnalyticsItem(Model): @@ -1381,6 +1389,162 @@ def __init__(self, *, source_id: str=None, target_id: str=None, category: str=No self.category = category +class MyWorkbookResource(Model): + """An azure resource object. + + :param id: Azure resource Id + :type id: str + :param name: Azure resource name + :type name: str + :param type: Azure resource type + :type type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, id: str=None, name: str=None, type: str=None, location: str=None, tags=None, **kwargs) -> None: + super(MyWorkbookResource, self).__init__(**kwargs) + self.id = id + self.name = name + self.type = type + self.location = location + self.tags = tags + + +class MyWorkbook(MyWorkbookResource): + """An Application Insights private workbook definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Azure resource Id + :type id: str + :param name: Azure resource name + :type name: str + :param type: Azure resource type + :type type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: The kind of workbook. Choices are user and shared. Possible + values include: 'user', 'shared' + :type kind: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.SharedTypeKind + :param display_name: Required. The user-defined name of the private + workbook. + :type display_name: str + :param serialized_data: Required. Configuration of this particular private + workbook. Configuration data is a string containing valid JSON + :type serialized_data: str + :param version: This instance's version of the data model. This can change + as new features are added that can be marked private workbook. + :type version: str + :ivar time_modified: Date and time in UTC of the last modification that + was made to this private workbook definition. + :vartype time_modified: str + :param category: Required. Workbook category, as defined by the user at + creation time. + :type category: str + :param my_workbook_tags: A list of 0 or more tags that are associated with + this private workbook definition + :type my_workbook_tags: list[str] + :ivar user_id: Unique user id of the specific user that owns this private + workbook. + :vartype user_id: str + :param source_id: Optional resourceId for a source resource. + :type source_id: str + """ + + _validation = { + 'display_name': {'required': True}, + 'serialized_data': {'required': True}, + 'time_modified': {'readonly': True}, + 'category': {'required': True}, + 'user_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'serialized_data': {'key': 'properties.serializedData', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'time_modified': {'key': 'properties.timeModified', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'my_workbook_tags': {'key': 'properties.tags', 'type': '[str]'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'source_id': {'key': 'properties.sourceId', 'type': 'str'}, + } + + def __init__(self, *, display_name: str, serialized_data: str, category: str, id: str=None, name: str=None, type: str=None, location: str=None, tags=None, kind=None, version: str=None, my_workbook_tags=None, source_id: str=None, **kwargs) -> None: + super(MyWorkbook, self).__init__(id=id, name=name, type=type, location=location, tags=tags, **kwargs) + self.kind = kind + self.display_name = display_name + self.serialized_data = serialized_data + self.version = version + self.time_modified = None + self.category = category + self.my_workbook_tags = my_workbook_tags + self.user_id = None + self.source_id = source_id + + +class MyWorkbookError(Model): + """Error message body that will indicate why the operation failed. + + :param code: Service-defined error code. This code serves as a sub-status + for the HTTP error code specified in the response. + :type code: str + :param message: Human-readable representation of the error. + :type message: str + :param details: The list of invalid fields send in request, in case of + validation error. + :type details: + list[~azure.mgmt.applicationinsights.v2015_05_01.models.ErrorFieldContract] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, + } + + def __init__(self, *, code: str=None, message: str=None, details=None, **kwargs) -> None: + super(MyWorkbookError, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + + +class MyWorkbookErrorException(HttpOperationError): + """Server responsed with exception of type: 'MyWorkbookError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(MyWorkbookErrorException, self).__init__(deserialize, response, 'MyWorkbookError', *args) + + class Operation(Model): """CDN REST API operation. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_paged_models.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_paged_models.py index 17a42d8050fc..f7a178f46b43 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_paged_models.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_paged_models.py @@ -116,3 +116,16 @@ class WorkbookPaged(Paged): def __init__(self, *args, **kwargs): super(WorkbookPaged, self).__init__(*args, **kwargs) +class MyWorkbookPaged(Paged): + """ + A paging container for iterating over a list of :class:`MyWorkbook ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[MyWorkbook]'} + } + + def __init__(self, *args, **kwargs): + + super(MyWorkbookPaged, self).__init__(*args, **kwargs) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/__init__.py index 3bd2ec335a09..389748afed3c 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/__init__.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/__init__.py @@ -25,6 +25,7 @@ from ._web_tests_operations import WebTestsOperations from ._analytics_items_operations import AnalyticsItemsOperations from ._workbooks_operations import WorkbooksOperations +from ._my_workbooks_operations import MyWorkbooksOperations __all__ = [ 'Operations', @@ -43,4 +44,5 @@ 'WebTestsOperations', 'AnalyticsItemsOperations', 'WorkbooksOperations', + 'MyWorkbooksOperations', ] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_my_workbooks_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_my_workbooks_operations.py new file mode 100644 index 000000000000..fb7a0386c2f3 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_my_workbooks_operations.py @@ -0,0 +1,463 @@ +# 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 MyWorkbooksOperations(object): + """MyWorkbooksOperations 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: The API version to use for this operation. Constant value: "2015-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-05-01" + + self.config = config + + def list_by_resource_group( + self, resource_group_name, category, tags=None, can_fetch_content=None, custom_headers=None, raw=False, **operation_config): + """Get all private workbooks defined within a specified resource group and + category. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param category: Category of workbook to return. Possible values + include: 'workbook', 'TSG', 'performance', 'retention' + :type category: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.CategoryType + :param tags: Tags presents on each workbook returned. + :type tags: list[str] + :param can_fetch_content: Flag indicating whether or not to return the + full content for each applicable workbook. If false, only return + summary content for workbooks. + :type can_fetch_content: bool + :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 MyWorkbook + :rtype: + ~azure.mgmt.applicationinsights.v2015_05_01.models.MyWorkbookPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.MyWorkbook] + :raises: + :class:`MyWorkbookErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['category'] = self._serialize.query("category", category, 'str') + if tags is not None: + query_parameters['tags'] = self._serialize.query("tags", tags, '[str]', div=',') + if can_fetch_content is not None: + query_parameters['canFetchContent'] = self._serialize.query("can_fetch_content", can_fetch_content, 'bool') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.MyWorkbookErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.MyWorkbookPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks'} + + def list_by_subscription( + self, category, tags=None, can_fetch_content=None, custom_headers=None, raw=False, **operation_config): + """Get all private workbooks defined within a specified subscription and + category. + + :param category: Category of workbook to return. Possible values + include: 'workbook', 'TSG', 'performance', 'retention' + :type category: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.CategoryType + :param tags: Tags presents on each workbook returned. + :type tags: list[str] + :param can_fetch_content: Flag indicating whether or not to return the + full content for each applicable workbook. If false, only return + summary content for workbooks. + :type can_fetch_content: bool + :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 MyWorkbook + :rtype: + ~azure.mgmt.applicationinsights.v2015_05_01.models.MyWorkbookPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.MyWorkbook] + :raises: + :class:`MyWorkbookErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['category'] = self._serialize.query("category", category, 'str') + if tags is not None: + query_parameters['tags'] = self._serialize.query("tags", tags, '[str]', div=',') + if can_fetch_content is not None: + query_parameters['canFetchContent'] = self._serialize.query("can_fetch_content", can_fetch_content, 'bool') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.MyWorkbookErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.MyWorkbookPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/myWorkbooks'} + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Get a single private workbook by its resourceName. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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: MyWorkbook or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.MyWorkbook + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`MyWorkbookErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.MyWorkbookErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MyWorkbook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}'} + + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Delete a private workbook. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`MyWorkbookErrorException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201, 204]: + raise models.MyWorkbookErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}'} + + def create_or_update( + self, resource_group_name, resource_name, workbook_properties, custom_headers=None, raw=False, **operation_config): + """Create a new private workbook. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param workbook_properties: Properties that need to be specified to + create a new private workbook. + :type workbook_properties: + ~azure.mgmt.applicationinsights.v2015_05_01.models.MyWorkbook + :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: MyWorkbook or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.MyWorkbook + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`MyWorkbookErrorException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, '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', min_length=1) + + # 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(workbook_properties, 'MyWorkbook') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.MyWorkbookErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MyWorkbook', response) + if response.status_code == 201: + deserialized = self._deserialize('MyWorkbook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}'} + + def update( + self, resource_group_name, resource_name, workbook_properties, custom_headers=None, raw=False, **operation_config): + """Updates a private workbook that has already been added. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param workbook_properties: Properties that need to be specified to + create a new private workbook. + :type workbook_properties: + ~azure.mgmt.applicationinsights.v2015_05_01.models.MyWorkbook + :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: MyWorkbook or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.MyWorkbook + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`MyWorkbookErrorException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, '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', min_length=1) + + # 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(workbook_properties, 'MyWorkbook') + + # Construct and send request + request = self._client.patch(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.MyWorkbookErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MyWorkbook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}'} diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_workbooks_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_workbooks_operations.py index 48aee77b9de6..eec756ef14e6 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_workbooks_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_workbooks_operations.py @@ -121,7 +121,7 @@ def internal_paging(next_link=None): deserialized = models.WorkbookPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks'} + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks'} def get( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): @@ -183,7 +183,7 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} def delete( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): @@ -237,7 +237,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} def create_or_update( self, resource_group_name, resource_name, workbook_properties, custom_headers=None, raw=False, **operation_config): @@ -309,7 +309,7 @@ def create_or_update( return client_raw_response return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} def update( self, resource_group_name, resource_name, workbook_properties, custom_headers=None, raw=False, **operation_config): @@ -379,4 +379,4 @@ def update( return client_raw_response return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/models/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/models/__init__.py index ba5030f74719..a7a170a5aee3 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/models/__init__.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/models/__init__.py @@ -37,6 +37,7 @@ FlowType, RequestSource, PublicNetworkAccessType, + IngestionMode, PurgeState, ) @@ -56,5 +57,6 @@ 'FlowType', 'RequestSource', 'PublicNetworkAccessType', + 'IngestionMode', 'PurgeState', ] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/models/_application_insights_management_client_enums.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/models/_application_insights_management_client_enums.py index cab8df5318db..95991581077a 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/models/_application_insights_management_client_enums.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/models/_application_insights_management_client_enums.py @@ -34,6 +34,13 @@ class PublicNetworkAccessType(str, Enum): disabled = "Disabled" #: Disables public connectivity to Application Insights through public DNS. +class IngestionMode(str, Enum): + + application_insights = "ApplicationInsights" + application_insights_with_diagnostic_settings = "ApplicationInsightsWithDiagnosticSettings" + log_analytics = "LogAnalytics" + + class PurgeState(str, Enum): pending = "pending" diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/models/_models.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/models/_models.py index 7d95273618e2..fea34f3457d6 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/models/_models.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/models/_models.py @@ -146,6 +146,12 @@ class ApplicationInsightsComponent(ComponentsResource): 'Disabled'. Default value: "Enabled" . :type public_network_access_for_query: str or ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.PublicNetworkAccessType + :param ingestion_mode: Indicates the flow of the ingestion. Possible + values include: 'ApplicationInsights', + 'ApplicationInsightsWithDiagnosticSettings', 'LogAnalytics'. Default + value: "ApplicationInsights" . + :type ingestion_mode: str or + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.IngestionMode """ _validation = { @@ -192,6 +198,7 @@ class ApplicationInsightsComponent(ComponentsResource): 'private_link_scoped_resources': {'key': 'properties.PrivateLinkScopedResources', 'type': '[PrivateLinkScopedResource]'}, 'public_network_access_for_ingestion': {'key': 'properties.publicNetworkAccessForIngestion', 'type': 'str'}, 'public_network_access_for_query': {'key': 'properties.publicNetworkAccessForQuery', 'type': 'str'}, + 'ingestion_mode': {'key': 'properties.IngestionMode', 'type': 'str'}, } def __init__(self, **kwargs): @@ -216,6 +223,7 @@ def __init__(self, **kwargs): self.private_link_scoped_resources = None self.public_network_access_for_ingestion = kwargs.get('public_network_access_for_ingestion', "Enabled") self.public_network_access_for_query = kwargs.get('public_network_access_for_query', "Enabled") + self.ingestion_mode = kwargs.get('ingestion_mode', "ApplicationInsights") class ApplicationInsightsComponentProactiveDetectionConfiguration(Model): diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/models/_models_py3.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/models/_models_py3.py index ce015182f99d..aff00d00ee4d 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/models/_models_py3.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/models/_models_py3.py @@ -146,6 +146,12 @@ class ApplicationInsightsComponent(ComponentsResource): 'Disabled'. Default value: "Enabled" . :type public_network_access_for_query: str or ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.PublicNetworkAccessType + :param ingestion_mode: Indicates the flow of the ingestion. Possible + values include: 'ApplicationInsights', + 'ApplicationInsightsWithDiagnosticSettings', 'LogAnalytics'. Default + value: "ApplicationInsights" . + :type ingestion_mode: str or + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.IngestionMode """ _validation = { @@ -192,9 +198,10 @@ class ApplicationInsightsComponent(ComponentsResource): 'private_link_scoped_resources': {'key': 'properties.PrivateLinkScopedResources', 'type': '[PrivateLinkScopedResource]'}, 'public_network_access_for_ingestion': {'key': 'properties.publicNetworkAccessForIngestion', 'type': 'str'}, 'public_network_access_for_query': {'key': 'properties.publicNetworkAccessForQuery', 'type': 'str'}, + 'ingestion_mode': {'key': 'properties.IngestionMode', 'type': 'str'}, } - def __init__(self, *, location: str, kind: str, tags=None, application_type="web", flow_type="Bluefield", request_source="rest", hockey_app_id: str=None, sampling_percentage: float=None, retention_in_days: int=90, disable_ip_masking: bool=None, immediate_purge_data_on30_days: bool=None, public_network_access_for_ingestion="Enabled", public_network_access_for_query="Enabled", **kwargs) -> None: + def __init__(self, *, location: str, kind: str, tags=None, application_type="web", flow_type="Bluefield", request_source="rest", hockey_app_id: str=None, sampling_percentage: float=None, retention_in_days: int=90, disable_ip_masking: bool=None, immediate_purge_data_on30_days: bool=None, public_network_access_for_ingestion="Enabled", public_network_access_for_query="Enabled", ingestion_mode="ApplicationInsights", **kwargs) -> None: super(ApplicationInsightsComponent, self).__init__(location=location, tags=tags, **kwargs) self.kind = kind self.application_id = None @@ -216,6 +223,7 @@ def __init__(self, *, location: str, kind: str, tags=None, application_type="web self.private_link_scoped_resources = None self.public_network_access_for_ingestion = public_network_access_for_ingestion self.public_network_access_for_query = public_network_access_for_query + self.ingestion_mode = ingestion_mode class ApplicationInsightsComponentProactiveDetectionConfiguration(Model): diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/models/_models.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/models/_models.py index a1c456978595..396a912fcc5a 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/models/_models.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/models/_models.py @@ -136,9 +136,11 @@ class Workbook(Resource): :param workbook_tags: A list of 0 or more tags that are associated with this workbook definition :type workbook_tags: list[str] - :param user_id: Required. Unique user id of the specific user that owns - this workbook. - :type user_id: str + :ivar user_id: Unique user id of the specific user that owns this + workbook. + :vartype user_id: str + :param source_id: ResourceId for a source resource. + :type source_id: str """ _validation = { @@ -150,7 +152,7 @@ class Workbook(Resource): 'serialized_data': {'required': True}, 'time_modified': {'readonly': True}, 'category': {'required': True}, - 'user_id': {'required': True}, + 'user_id': {'readonly': True}, } _attribute_map = { @@ -167,6 +169,7 @@ class Workbook(Resource): 'version': {'key': 'properties.version', 'type': 'str'}, 'workbook_tags': {'key': 'properties.tags', 'type': '[str]'}, 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'source_id': {'key': 'properties.sourceId', 'type': 'str'}, } def __init__(self, **kwargs): @@ -177,7 +180,8 @@ def __init__(self, **kwargs): self.category = kwargs.get('category', None) self.version = kwargs.get('version', None) self.workbook_tags = kwargs.get('workbook_tags', None) - self.user_id = kwargs.get('user_id', None) + self.user_id = None + self.source_id = kwargs.get('source_id', None) class WorkbookError(Model): diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/models/_models_py3.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/models/_models_py3.py index 59055e5e8005..1ada400a9881 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/models/_models_py3.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/models/_models_py3.py @@ -136,9 +136,11 @@ class Workbook(Resource): :param workbook_tags: A list of 0 or more tags that are associated with this workbook definition :type workbook_tags: list[str] - :param user_id: Required. Unique user id of the specific user that owns - this workbook. - :type user_id: str + :ivar user_id: Unique user id of the specific user that owns this + workbook. + :vartype user_id: str + :param source_id: ResourceId for a source resource. + :type source_id: str """ _validation = { @@ -150,7 +152,7 @@ class Workbook(Resource): 'serialized_data': {'required': True}, 'time_modified': {'readonly': True}, 'category': {'required': True}, - 'user_id': {'required': True}, + 'user_id': {'readonly': True}, } _attribute_map = { @@ -167,9 +169,10 @@ class Workbook(Resource): 'version': {'key': 'properties.version', 'type': 'str'}, 'workbook_tags': {'key': 'properties.tags', 'type': '[str]'}, 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'source_id': {'key': 'properties.sourceId', 'type': 'str'}, } - def __init__(self, *, location: str, display_name: str, serialized_data: str, category: str, user_id: str, kind=None, tags=None, version: str=None, workbook_tags=None, **kwargs) -> None: + def __init__(self, *, location: str, display_name: str, serialized_data: str, category: str, kind=None, tags=None, version: str=None, workbook_tags=None, source_id: str=None, **kwargs) -> None: super(Workbook, self).__init__(kind=kind, location=location, tags=tags, **kwargs) self.display_name = display_name self.serialized_data = serialized_data @@ -177,7 +180,8 @@ def __init__(self, *, location: str, display_name: str, serialized_data: str, ca self.category = category self.version = version self.workbook_tags = workbook_tags - self.user_id = user_id + self.user_id = None + self.source_id = source_id class WorkbookError(Model): diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/operations/_workbooks_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/operations/_workbooks_operations.py index 18e678e06030..33b4df62a469 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/operations/_workbooks_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/operations/_workbooks_operations.py @@ -125,7 +125,7 @@ def internal_paging(next_link=None): deserialized = models.WorkbookPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks'} + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks'} def get( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): @@ -188,7 +188,7 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} def delete( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): @@ -242,7 +242,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} def create_or_update( self, resource_group_name, resource_name, source_id, workbook_properties, custom_headers=None, raw=False, **operation_config): @@ -319,7 +319,7 @@ def create_or_update( return client_raw_response return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} def update( self, resource_group_name, resource_name, source_id, workbook_update_parameters=None, custom_headers=None, raw=False, **operation_config): @@ -397,4 +397,4 @@ def update( return client_raw_response return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/operations/_workbook_templates_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/operations/_workbook_templates_operations.py index 17066285b1a8..d639ac3719f5 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/operations/_workbook_templates_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/operations/_workbook_templates_operations.py @@ -105,7 +105,7 @@ def internal_paging(next_link=None): deserialized = models.WorkbookTemplatePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooktemplates'} + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates'} def get( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): @@ -168,7 +168,7 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}'} def delete( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): @@ -222,7 +222,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}'} def create_or_update( self, resource_group_name, resource_name, workbook_template_properties, custom_headers=None, raw=False, **operation_config): @@ -295,7 +295,7 @@ def create_or_update( return client_raw_response return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}'} def update( self, resource_group_name, resource_name, workbook_template_update_parameters=None, custom_headers=None, raw=False, **operation_config): @@ -369,4 +369,4 @@ def update( return client_raw_response return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}'} diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/__init__.py index cbde4cca8f30..89e4d7ae9a05 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/__init__.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/__init__.py @@ -16,6 +16,9 @@ from ._models_py3 import ComponentPurgeResponse from ._models_py3 import ComponentPurgeStatusResponse from ._models_py3 import ComponentsResource + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse, ErrorResponseException from ._models_py3 import PrivateLinkScopedResource from ._models_py3 import TagsResource except (SyntaxError, ImportError): @@ -25,6 +28,9 @@ from ._models import ComponentPurgeResponse from ._models import ComponentPurgeStatusResponse from ._models import ComponentsResource + from ._models import ErrorAdditionalInfo + from ._models import ErrorDetail + from ._models import ErrorResponse, ErrorResponseException from ._models import PrivateLinkScopedResource from ._models import TagsResource from ._paged_models import ApplicationInsightsComponentPaged @@ -33,6 +39,7 @@ FlowType, RequestSource, PublicNetworkAccessType, + IngestionMode, PurgeState, ) @@ -43,6 +50,9 @@ 'ComponentPurgeResponse', 'ComponentPurgeStatusResponse', 'ComponentsResource', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', 'ErrorResponseException', 'PrivateLinkScopedResource', 'TagsResource', 'ApplicationInsightsComponentPaged', @@ -50,5 +60,6 @@ 'FlowType', 'RequestSource', 'PublicNetworkAccessType', + 'IngestionMode', 'PurgeState', ] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_application_insights_management_client_enums.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_application_insights_management_client_enums.py index cab8df5318db..95991581077a 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_application_insights_management_client_enums.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_application_insights_management_client_enums.py @@ -34,6 +34,13 @@ class PublicNetworkAccessType(str, Enum): disabled = "Disabled" #: Disables public connectivity to Application Insights through public DNS. +class IngestionMode(str, Enum): + + application_insights = "ApplicationInsights" + application_insights_with_diagnostic_settings = "ApplicationInsightsWithDiagnosticSettings" + log_analytics = "LogAnalytics" + + class PurgeState(str, Enum): pending = "pending" diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models.py index 256b50e40b1e..d5a3a95f09df 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model +from msrest.exceptions import HttpOperationError class ComponentsResource(Model): @@ -78,11 +79,15 @@ class ApplicationInsightsComponent(ComponentsResource): to, used to customize UI. This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone. :type kind: str + :param etag: Resource etag + :type etag: str :ivar application_id: The unique ID of your application. This field mirrors the 'Name' field and cannot be changed. :vartype application_id: str :ivar app_id: Application Insights Unique ID for your Application. :vartype app_id: str + :ivar application_insights_component_name: Application name. + :vartype application_insights_component_name: str :param application_type: Required. Type of application being monitored. Possible values include: 'web', 'other'. Default value: "web" . :type application_type: str or @@ -132,9 +137,14 @@ class ApplicationInsightsComponent(ComponentsResource): :param immediate_purge_data_on30_days: Purge data immediately after 30 days. :type immediate_purge_data_on30_days: bool - :param workspace_resource_id: Required. ResourceId of the log analytics - workspace which the data will be ingested to. + :param workspace_resource_id: Resource Id of the log analytics workspace + which the data will be ingested to. This property is required to create an + application with this API version. Applications from older versions will + not have this property. :type workspace_resource_id: str + :ivar la_migration_date: The date which the component got migrated to LA, + in ISO 8601 format. + :vartype la_migration_date: datetime :ivar private_link_scoped_resources: List of linked private link scope resources. :vartype private_link_scoped_resources: @@ -149,6 +159,12 @@ class ApplicationInsightsComponent(ComponentsResource): 'Disabled'. Default value: "Enabled" . :type public_network_access_for_query: str or ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.PublicNetworkAccessType + :param ingestion_mode: Indicates the flow of the ingestion. Possible + values include: 'ApplicationInsights', + 'ApplicationInsightsWithDiagnosticSettings', 'LogAnalytics'. Default + value: "LogAnalytics" . + :type ingestion_mode: str or + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.IngestionMode """ _validation = { @@ -159,6 +175,7 @@ class ApplicationInsightsComponent(ComponentsResource): 'kind': {'required': True}, 'application_id': {'readonly': True}, 'app_id': {'readonly': True}, + 'application_insights_component_name': {'readonly': True}, 'application_type': {'required': True}, 'instrumentation_key': {'readonly': True}, 'creation_date': {'readonly': True}, @@ -167,7 +184,7 @@ class ApplicationInsightsComponent(ComponentsResource): 'provisioning_state': {'readonly': True}, 'connection_string': {'readonly': True}, 'retention_in_days': {'readonly': True}, - 'workspace_resource_id': {'required': True}, + 'la_migration_date': {'readonly': True}, 'private_link_scoped_resources': {'readonly': True}, } @@ -178,8 +195,10 @@ class ApplicationInsightsComponent(ComponentsResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'application_id': {'key': 'properties.ApplicationId', 'type': 'str'}, 'app_id': {'key': 'properties.AppId', 'type': 'str'}, + 'application_insights_component_name': {'key': 'properties.Name', 'type': 'str'}, 'application_type': {'key': 'properties.Application_Type', 'type': 'str'}, 'flow_type': {'key': 'properties.Flow_Type', 'type': 'str'}, 'request_source': {'key': 'properties.Request_Source', 'type': 'str'}, @@ -195,16 +214,20 @@ class ApplicationInsightsComponent(ComponentsResource): 'disable_ip_masking': {'key': 'properties.DisableIpMasking', 'type': 'bool'}, 'immediate_purge_data_on30_days': {'key': 'properties.ImmediatePurgeDataOn30Days', 'type': 'bool'}, 'workspace_resource_id': {'key': 'properties.WorkspaceResourceId', 'type': 'str'}, + 'la_migration_date': {'key': 'properties.LaMigrationDate', 'type': 'iso-8601'}, 'private_link_scoped_resources': {'key': 'properties.PrivateLinkScopedResources', 'type': '[PrivateLinkScopedResource]'}, 'public_network_access_for_ingestion': {'key': 'properties.publicNetworkAccessForIngestion', 'type': 'str'}, 'public_network_access_for_query': {'key': 'properties.publicNetworkAccessForQuery', 'type': 'str'}, + 'ingestion_mode': {'key': 'properties.IngestionMode', 'type': 'str'}, } def __init__(self, **kwargs): super(ApplicationInsightsComponent, self).__init__(**kwargs) self.kind = kwargs.get('kind', None) + self.etag = kwargs.get('etag', None) self.application_id = None self.app_id = None + self.application_insights_component_name = None self.application_type = kwargs.get('application_type', "web") self.flow_type = kwargs.get('flow_type', "Bluefield") self.request_source = kwargs.get('request_source', "rest") @@ -220,9 +243,11 @@ def __init__(self, **kwargs): self.disable_ip_masking = kwargs.get('disable_ip_masking', None) self.immediate_purge_data_on30_days = kwargs.get('immediate_purge_data_on30_days', None) self.workspace_resource_id = kwargs.get('workspace_resource_id', None) + self.la_migration_date = None self.private_link_scoped_resources = None self.public_network_access_for_ingestion = kwargs.get('public_network_access_for_ingestion', "Enabled") self.public_network_access_for_query = kwargs.get('public_network_access_for_query', "Enabled") + self.ingestion_mode = kwargs.get('ingestion_mode', "LogAnalytics") class CloudError(Model): @@ -343,6 +368,112 @@ def __init__(self, **kwargs): self.status = kwargs.get('status', None) +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(Model): + """Error response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). + + :param error: The error object. + :type error: + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + class PrivateLinkScopedResource(Model): """The private link scope resource reference. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models_py3.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models_py3.py index 9b8fcb866f9b..e00058569c3c 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models_py3.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models_py3.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model +from msrest.exceptions import HttpOperationError class ComponentsResource(Model): @@ -78,11 +79,15 @@ class ApplicationInsightsComponent(ComponentsResource): to, used to customize UI. This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone. :type kind: str + :param etag: Resource etag + :type etag: str :ivar application_id: The unique ID of your application. This field mirrors the 'Name' field and cannot be changed. :vartype application_id: str :ivar app_id: Application Insights Unique ID for your Application. :vartype app_id: str + :ivar application_insights_component_name: Application name. + :vartype application_insights_component_name: str :param application_type: Required. Type of application being monitored. Possible values include: 'web', 'other'. Default value: "web" . :type application_type: str or @@ -132,9 +137,14 @@ class ApplicationInsightsComponent(ComponentsResource): :param immediate_purge_data_on30_days: Purge data immediately after 30 days. :type immediate_purge_data_on30_days: bool - :param workspace_resource_id: Required. ResourceId of the log analytics - workspace which the data will be ingested to. + :param workspace_resource_id: Resource Id of the log analytics workspace + which the data will be ingested to. This property is required to create an + application with this API version. Applications from older versions will + not have this property. :type workspace_resource_id: str + :ivar la_migration_date: The date which the component got migrated to LA, + in ISO 8601 format. + :vartype la_migration_date: datetime :ivar private_link_scoped_resources: List of linked private link scope resources. :vartype private_link_scoped_resources: @@ -149,6 +159,12 @@ class ApplicationInsightsComponent(ComponentsResource): 'Disabled'. Default value: "Enabled" . :type public_network_access_for_query: str or ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.PublicNetworkAccessType + :param ingestion_mode: Indicates the flow of the ingestion. Possible + values include: 'ApplicationInsights', + 'ApplicationInsightsWithDiagnosticSettings', 'LogAnalytics'. Default + value: "LogAnalytics" . + :type ingestion_mode: str or + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.IngestionMode """ _validation = { @@ -159,6 +175,7 @@ class ApplicationInsightsComponent(ComponentsResource): 'kind': {'required': True}, 'application_id': {'readonly': True}, 'app_id': {'readonly': True}, + 'application_insights_component_name': {'readonly': True}, 'application_type': {'required': True}, 'instrumentation_key': {'readonly': True}, 'creation_date': {'readonly': True}, @@ -167,7 +184,7 @@ class ApplicationInsightsComponent(ComponentsResource): 'provisioning_state': {'readonly': True}, 'connection_string': {'readonly': True}, 'retention_in_days': {'readonly': True}, - 'workspace_resource_id': {'required': True}, + 'la_migration_date': {'readonly': True}, 'private_link_scoped_resources': {'readonly': True}, } @@ -178,8 +195,10 @@ class ApplicationInsightsComponent(ComponentsResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'kind': {'key': 'kind', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, 'application_id': {'key': 'properties.ApplicationId', 'type': 'str'}, 'app_id': {'key': 'properties.AppId', 'type': 'str'}, + 'application_insights_component_name': {'key': 'properties.Name', 'type': 'str'}, 'application_type': {'key': 'properties.Application_Type', 'type': 'str'}, 'flow_type': {'key': 'properties.Flow_Type', 'type': 'str'}, 'request_source': {'key': 'properties.Request_Source', 'type': 'str'}, @@ -195,16 +214,20 @@ class ApplicationInsightsComponent(ComponentsResource): 'disable_ip_masking': {'key': 'properties.DisableIpMasking', 'type': 'bool'}, 'immediate_purge_data_on30_days': {'key': 'properties.ImmediatePurgeDataOn30Days', 'type': 'bool'}, 'workspace_resource_id': {'key': 'properties.WorkspaceResourceId', 'type': 'str'}, + 'la_migration_date': {'key': 'properties.LaMigrationDate', 'type': 'iso-8601'}, 'private_link_scoped_resources': {'key': 'properties.PrivateLinkScopedResources', 'type': '[PrivateLinkScopedResource]'}, 'public_network_access_for_ingestion': {'key': 'properties.publicNetworkAccessForIngestion', 'type': 'str'}, 'public_network_access_for_query': {'key': 'properties.publicNetworkAccessForQuery', 'type': 'str'}, + 'ingestion_mode': {'key': 'properties.IngestionMode', 'type': 'str'}, } - def __init__(self, *, location: str, kind: str, workspace_resource_id: str, tags=None, application_type="web", flow_type="Bluefield", request_source="rest", hockey_app_id: str=None, sampling_percentage: float=None, disable_ip_masking: bool=None, immediate_purge_data_on30_days: bool=None, public_network_access_for_ingestion="Enabled", public_network_access_for_query="Enabled", **kwargs) -> None: + def __init__(self, *, location: str, kind: str, tags=None, etag: str=None, application_type="web", flow_type="Bluefield", request_source="rest", hockey_app_id: str=None, sampling_percentage: float=None, disable_ip_masking: bool=None, immediate_purge_data_on30_days: bool=None, workspace_resource_id: str=None, public_network_access_for_ingestion="Enabled", public_network_access_for_query="Enabled", ingestion_mode="LogAnalytics", **kwargs) -> None: super(ApplicationInsightsComponent, self).__init__(location=location, tags=tags, **kwargs) self.kind = kind + self.etag = etag self.application_id = None self.app_id = None + self.application_insights_component_name = None self.application_type = application_type self.flow_type = flow_type self.request_source = request_source @@ -220,9 +243,11 @@ def __init__(self, *, location: str, kind: str, workspace_resource_id: str, tags self.disable_ip_masking = disable_ip_masking self.immediate_purge_data_on30_days = immediate_purge_data_on30_days self.workspace_resource_id = workspace_resource_id + self.la_migration_date = None self.private_link_scoped_resources = None self.public_network_access_for_ingestion = public_network_access_for_ingestion self.public_network_access_for_query = public_network_access_for_query + self.ingestion_mode = ingestion_mode class CloudError(Model): @@ -343,6 +368,112 @@ def __init__(self, *, status, **kwargs) -> None: self.status = status +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(Model): + """Error response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). + + :param error: The error object. + :type error: + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + class PrivateLinkScopedResource(Model): """The private link scope resource reference. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/operations/_components_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/operations/_components_operations.py index fb453f6f5ce2..3c93a84e35a0 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/operations/_components_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/operations/_components_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -52,7 +51,8 @@ def list( :return: An iterator like instance of ApplicationInsightsComponent :rtype: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponentPaged[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponent] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -91,9 +91,7 @@ def internal_paging(next_link=None): response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) return response @@ -121,7 +119,8 @@ def list_by_resource_group( :return: An iterator like instance of ApplicationInsightsComponent :rtype: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponentPaged[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponent] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -161,9 +160,7 @@ def internal_paging(next_link=None): response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) return response @@ -193,7 +190,8 @@ def delete( overrides`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.delete.metadata['url'] @@ -222,9 +220,7 @@ def delete( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -250,7 +246,8 @@ def get( :rtype: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponent or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -280,9 +277,7 @@ def get( response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -320,7 +315,8 @@ def create_or_update( :rtype: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponent or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.create_or_update.metadata['url'] @@ -354,9 +350,7 @@ def create_or_update( response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -391,7 +385,8 @@ def update_tags( :rtype: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponent or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ component_tags = models.TagsResource(tags=tags) @@ -427,9 +422,7 @@ def update_tags( response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -474,7 +467,8 @@ def purge( :rtype: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ComponentPurgeResponse or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ body = models.ComponentPurgeBody(table=table, filters=filters) @@ -510,9 +504,7 @@ def purge( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 202: @@ -547,7 +539,8 @@ def get_purge_status( :rtype: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ComponentPurgeStatusResponse or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get_purge_status.metadata['url'] @@ -578,9 +571,7 @@ def get_purge_status( response = self._client.send(request, 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 + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/_models.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/_models.py index 1d6c7cfb916b..8d9c23595fca 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/_models.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/_models.py @@ -16,16 +16,19 @@ class Resource(Model): """Resource. + Common fields that are returned in the response for all Azure Resource + Manager resources. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str """ @@ -49,19 +52,21 @@ def __init__(self, **kwargs): class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an - etag. + """Entity Resource. + + The resource model definition for an Azure Resource Manager resource with + an etag. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -95,19 +100,21 @@ class CloudError(Model): class ProxyResource(Resource): - """The resource model definition for a ARM proxy resource. It will have - everything other than required location and tags. + """Proxy Resource. + + The resource model definition for a Azure Resource Manager proxy resource. + It will not have tags and a location. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str """ @@ -133,13 +140,13 @@ class ComponentLinkedStorageAccounts(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param linked_storage_account: Linked storage account resource ID :type linked_storage_account: str @@ -180,9 +187,10 @@ def __init__(self, **kwargs): class ErrorResponse(Model): - """Describe the format of an Error response. + """Error response indicates Insights service is not able to process the + incoming request. The reason is provided in the error message. - :param code: Error code + :param code: Error code. :type code: str :param message: Error message indicating why the operation failed. :type message: str @@ -212,20 +220,23 @@ def __init__(self, deserialize, response, *args): class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """Tracked Resource. + + The resource model definition for an Azure Resource Manager tracked top + level resource which has 'tags' and a 'location'. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param tags: Resource tags. :type tags: dict[str, str] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/_models_py3.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/_models_py3.py index 887bad54fdf9..e2be79c550e0 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/_models_py3.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/_models_py3.py @@ -16,16 +16,19 @@ class Resource(Model): """Resource. + Common fields that are returned in the response for all Azure Resource + Manager resources. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str """ @@ -49,19 +52,21 @@ def __init__(self, **kwargs) -> None: class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an - etag. + """Entity Resource. + + The resource model definition for an Azure Resource Manager resource with + an etag. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -95,19 +100,21 @@ class CloudError(Model): class ProxyResource(Resource): - """The resource model definition for a ARM proxy resource. It will have - everything other than required location and tags. + """Proxy Resource. + + The resource model definition for a Azure Resource Manager proxy resource. + It will not have tags and a location. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str """ @@ -133,13 +140,13 @@ class ComponentLinkedStorageAccounts(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param linked_storage_account: Linked storage account resource ID :type linked_storage_account: str @@ -180,9 +187,10 @@ def __init__(self, *, linked_storage_account: str=None, **kwargs) -> None: class ErrorResponse(Model): - """Describe the format of an Error response. + """Error response indicates Insights service is not able to process the + incoming request. The reason is provided in the error message. - :param code: Error code + :param code: Error code. :type code: str :param message: Error message indicating why the operation failed. :type message: str @@ -212,20 +220,23 @@ def __init__(self, deserialize, response, *args): class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """Tracked Resource. + + The resource model definition for an Azure Resource Manager tracked top + level resource which has 'tags' and a 'location'. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param tags: Resource tags. :type tags: dict[str, str] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/__init__.py new file mode 100644 index 000000000000..298512941d91 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/__init__.py @@ -0,0 +1,19 @@ +# 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 ._configuration import ApplicationInsightsManagementClientConfiguration +from ._application_insights_management_client import ApplicationInsightsManagementClient +__all__ = ['ApplicationInsightsManagementClient', 'ApplicationInsightsManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/_application_insights_management_client.py new file mode 100644 index 000000000000..0fa6e2aced9a --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/_application_insights_management_client.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import ApplicationInsightsManagementClientConfiguration +from .operations import Operations +from .operations import LiveTokenOperations +from . import models + + +class ApplicationInsightsManagementClient(SDKClient): + """Composite Swagger for Application Insights Management Client + + :ivar config: Configuration for client. + :vartype config: ApplicationInsightsManagementClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.applicationinsights.v2020_06_02_preview.operations.Operations + :ivar live_token: LiveToken operations + :vartype live_token: azure.mgmt.applicationinsights.v2020_06_02_preview.operations.LiveTokenOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param str base_url: Service URL + """ + + def __init__( + self, credentials, base_url=None): + + self.config = ApplicationInsightsManagementClientConfiguration(credentials, base_url) + super(ApplicationInsightsManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2020-06-02-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.live_token = LiveTokenOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/_configuration.py new file mode 100644 index 000000000000..befe7582854d --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/_configuration.py @@ -0,0 +1,43 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class ApplicationInsightsManagementClientConfiguration(AzureConfiguration): + """Configuration for ApplicationInsightsManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param str base_url: Service URL + """ + + def __init__( + self, credentials, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(ApplicationInsightsManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-applicationinsights/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/models/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/models/__init__.py new file mode 100644 index 000000000000..02646d5dbafb --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/models/__init__.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import LiveTokenResponse + from ._models_py3 import OperationInfo + from ._models_py3 import OperationLive +except (SyntaxError, ImportError): + from ._models import ErrorResponse, ErrorResponseException + from ._models import LiveTokenResponse + from ._models import OperationInfo + from ._models import OperationLive +from ._paged_models import OperationLivePaged + +__all__ = [ + 'ErrorResponse', 'ErrorResponseException', + 'LiveTokenResponse', + 'OperationInfo', + 'OperationLive', + 'OperationLivePaged', +] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/models/_models.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/models/_models.py new file mode 100644 index 000000000000..b7a6a321ab68 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/models/_models.py @@ -0,0 +1,134 @@ +# 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 CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorResponse(Model): + """Error response indicates Insights service is not able to process the + incoming request. The reason is provided in the error message. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class LiveTokenResponse(Model): + """The response to a live token query. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar live_token: JWT token for accessing live metrics stream data. + :vartype live_token: str + """ + + _validation = { + 'live_token': {'readonly': True}, + } + + _attribute_map = { + 'live_token': {'key': 'liveToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LiveTokenResponse, self).__init__(**kwargs) + self.live_token = None + + +class OperationInfo(Model): + """Information about an operation. + + :param provider: Name of the provider + :type provider: str + :param resource: Name of the resource type + :type resource: str + :param operation: Name of the operation + :type operation: str + :param description: Description of the operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationInfo, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class OperationLive(Model): + """Represents an operation returned by the GetOperations request. + + :param name: Name of the operation + :type name: str + :param display: Display name of the operation + :type display: + ~azure.mgmt.applicationinsights.v2020_06_02_preview.models.OperationInfo + :param origin: Origin of the operation + :type origin: str + :param properties: Properties of the operation + :type properties: object + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationInfo'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(OperationLive, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.properties = kwargs.get('properties', None) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/models/_models_py3.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/models/_models_py3.py new file mode 100644 index 000000000000..cf94a680f4c8 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/models/_models_py3.py @@ -0,0 +1,134 @@ +# 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 CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorResponse(Model): + """Error response indicates Insights service is not able to process the + incoming request. The reason is provided in the error message. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class LiveTokenResponse(Model): + """The response to a live token query. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar live_token: JWT token for accessing live metrics stream data. + :vartype live_token: str + """ + + _validation = { + 'live_token': {'readonly': True}, + } + + _attribute_map = { + 'live_token': {'key': 'liveToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(LiveTokenResponse, self).__init__(**kwargs) + self.live_token = None + + +class OperationInfo(Model): + """Information about an operation. + + :param provider: Name of the provider + :type provider: str + :param resource: Name of the resource type + :type resource: str + :param operation: Name of the operation + :type operation: str + :param description: Description of the operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationInfo, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationLive(Model): + """Represents an operation returned by the GetOperations request. + + :param name: Name of the operation + :type name: str + :param display: Display name of the operation + :type display: + ~azure.mgmt.applicationinsights.v2020_06_02_preview.models.OperationInfo + :param origin: Origin of the operation + :type origin: str + :param properties: Properties of the operation + :type properties: object + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationInfo'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, properties=None, **kwargs) -> None: + super(OperationLive, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.properties = properties diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/models/_paged_models.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/models/_paged_models.py new file mode 100644 index 000000000000..9f9da53c556b --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/models/_paged_models.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 OperationLivePaged(Paged): + """ + A paging container for iterating over a list of :class:`OperationLive ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[OperationLive]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationLivePaged, self).__init__(*args, **kwargs) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/operations/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/operations/__init__.py new file mode 100644 index 000000000000..42c0c8f149e9 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/operations/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._live_token_operations import LiveTokenOperations + +__all__ = [ + 'Operations', + 'LiveTokenOperations', +] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/operations/_live_token_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/operations/_live_token_operations.py new file mode 100644 index 000000000000..8c53435e8186 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/operations/_live_token_operations.py @@ -0,0 +1,96 @@ +# 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 LiveTokenOperations(object): + """LiveTokenOperations 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: The API version to use for this operation. Constant value: "2020-06-02-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-06-02-preview" + + self.config = config + + def get( + self, resource_uri, custom_headers=None, raw=False, **operation_config): + """**Gets an access token for live metrics stream data.**. + + :param resource_uri: The identifier of the resource. + :type resource_uri: 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: LiveTokenResponse or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2020_06_02_preview.models.LiveTokenResponse + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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.post(url, query_parameters, header_parameters) + 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('LiveTokenResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/generatelivetoken'} diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/operations/_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/operations/_operations.py new file mode 100644 index 000000000000..995d8e3459f9 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/operations/_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations 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: The API version to use for this operation. Constant value: "2020-06-02-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-06-02-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List available operations. + + List the available operations supported by the resource provider. + + :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 OperationLive + :rtype: + ~azure.mgmt.applicationinsights.v2020_06_02_preview.models.OperationLivePaged[~azure.mgmt.applicationinsights.v2020_06_02_preview.models.OperationLive] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationLivePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/microsoft.insights/operations'} diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/version.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/version.py new file mode 100644 index 000000000000..9fd9a5df5f7b --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02-preview/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "2020-06-02-preview" +