diff --git a/azure-mgmt-applicationinsights/HISTORY.rst b/azure-mgmt-applicationinsights/HISTORY.rst index 8f187ce247ed..21f0200d4fd0 100644 --- a/azure-mgmt-applicationinsights/HISTORY.rst +++ b/azure-mgmt-applicationinsights/HISTORY.rst @@ -3,6 +3,49 @@ Release History =============== +0.2.0 (2019-04-10) +++++++++++++++++++ + +**Features** + +- Added operation WebTestsOperations.list_by_component +- Added operation ComponentsOperations.get_purge_status +- Added operation ComponentsOperations.purge +- Added operation group FavoritesOperations +- Added operation group ComponentFeatureCapabilitiesOperations +- Added operation group WebTestLocationsOperations +- Added operation group ComponentAvailableFeaturesOperations +- Added operation group ProactiveDetectionConfigurationsOperations +- Added operation group AnnotationsOperations +- Added operation group WorkItemConfigurationsOperations +- Added operation group WorkbooksOperations +- Added operation group AnalyticsItemsOperations + +**General Breaking changes** + +This version uses a next-generation code generator that *might* introduce breaking changes. + +- Model signatures now use only keyword-argument syntax. All positional arguments must be re-written as keyword-arguments. + To keep auto-completion in most cases, models are now generated for Python 2 and Python 3. Python 3 uses the "*" syntax for keyword-only arguments. +- Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to improve the behavior when unrecognized enum values are encountered. + While this is not a breaking change, the distinctions are important, and are documented here: + https://docs.python.org/3/library/enum.html#others + At a glance: + + - "is" should not be used at all. + - "format" will return the string value, where "%s" string formatting will return `NameOfEnum.stringvalue`. Format syntax should be prefered. + +- New Long Running Operation: + + - Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same. + - Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used. + - The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`, + without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`. + - New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`, + the response of the initial call will be returned without polling. + - `polling` parameter accepts instances of subclasses of `msrest.polling.PollingMethod`. + - `add_done_callback` will no longer raise if called after polling is finished, but will instead execute the callback right away. + 0.1.1 (2018-02-12) ++++++++++++++++++ diff --git a/azure-mgmt-applicationinsights/MANIFEST.in b/azure-mgmt-applicationinsights/MANIFEST.in index bb37a2723dae..e4884efef41b 100644 --- a/azure-mgmt-applicationinsights/MANIFEST.in +++ b/azure-mgmt-applicationinsights/MANIFEST.in @@ -1 +1,5 @@ +recursive-include tests *.py *.yaml include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-applicationinsights/README.rst b/azure-mgmt-applicationinsights/README.rst index f92d928950a9..1d500a69491a 100644 --- a/azure-mgmt-applicationinsights/README.rst +++ b/azure-mgmt-applicationinsights/README.rst @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see For a more complete set of Azure libraries, see the `azure `__ bundle package. -Compatibility -============= - -**IMPORTANT**: If you have an earlier version of the azure package -(version < 1.0), you should uninstall it before installing this package. - -You can check the version using pip: - -.. code:: shell - - pip freeze - -If you see azure==0.11.0 (or any version below 1.0), uninstall it first: - -.. code:: shell - - pip uninstall azure - - Usage ===== diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/application_insights_management_client.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/application_insights_management_client.py index 241589ea5807..58f40abf1c0d 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/application_insights_management_client.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/application_insights_management_client.py @@ -9,18 +9,26 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION from .operations.operations import Operations -from .operations.components_operations import ComponentsOperations -from .operations.web_tests_operations import WebTestsOperations +from .operations.annotations_operations import AnnotationsOperations +from .operations.api_keys_operations import APIKeysOperations from .operations.export_configurations_operations import ExportConfigurationsOperations -from .operations.proactive_detection_configurations_operations import ProactiveDetectionConfigurationsOperations from .operations.component_current_billing_features_operations import ComponentCurrentBillingFeaturesOperations from .operations.component_quota_status_operations import ComponentQuotaStatusOperations -from .operations.api_keys_operations import APIKeysOperations +from .operations.component_feature_capabilities_operations import ComponentFeatureCapabilitiesOperations +from .operations.component_available_features_operations import ComponentAvailableFeaturesOperations +from .operations.proactive_detection_configurations_operations import ProactiveDetectionConfigurationsOperations +from .operations.components_operations import ComponentsOperations +from .operations.work_item_configurations_operations import WorkItemConfigurationsOperations +from .operations.favorites_operations import FavoritesOperations +from .operations.web_test_locations_operations import WebTestLocationsOperations +from .operations.web_tests_operations import WebTestsOperations +from .operations.analytics_items_operations import AnalyticsItemsOperations +from .operations.workbooks_operations import WorkbooksOperations from . import models @@ -32,7 +40,7 @@ class ApplicationInsightsManagementClientConfiguration(AzureConfiguration): :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object` - :param subscription_id: The Azure subscription ID. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -56,7 +64,7 @@ def __init__( self.subscription_id = subscription_id -class ApplicationInsightsManagementClient(object): +class ApplicationInsightsManagementClient(SDKClient): """Composite Swagger for Application Insights Management Client :ivar config: Configuration for client. @@ -64,25 +72,41 @@ class ApplicationInsightsManagementClient(object): :ivar operations: Operations operations :vartype operations: azure.mgmt.applicationinsights.operations.Operations - :ivar components: Components operations - :vartype components: azure.mgmt.applicationinsights.operations.ComponentsOperations - :ivar web_tests: WebTests operations - :vartype web_tests: azure.mgmt.applicationinsights.operations.WebTestsOperations + :ivar annotations: Annotations operations + :vartype annotations: azure.mgmt.applicationinsights.operations.AnnotationsOperations + :ivar api_keys: APIKeys operations + :vartype api_keys: azure.mgmt.applicationinsights.operations.APIKeysOperations :ivar export_configurations: ExportConfigurations operations :vartype export_configurations: azure.mgmt.applicationinsights.operations.ExportConfigurationsOperations - :ivar proactive_detection_configurations: ProactiveDetectionConfigurations operations - :vartype proactive_detection_configurations: azure.mgmt.applicationinsights.operations.ProactiveDetectionConfigurationsOperations :ivar component_current_billing_features: ComponentCurrentBillingFeatures operations :vartype component_current_billing_features: azure.mgmt.applicationinsights.operations.ComponentCurrentBillingFeaturesOperations :ivar component_quota_status: ComponentQuotaStatus operations :vartype component_quota_status: azure.mgmt.applicationinsights.operations.ComponentQuotaStatusOperations - :ivar api_keys: APIKeys operations - :vartype api_keys: azure.mgmt.applicationinsights.operations.APIKeysOperations + :ivar component_feature_capabilities: ComponentFeatureCapabilities operations + :vartype component_feature_capabilities: azure.mgmt.applicationinsights.operations.ComponentFeatureCapabilitiesOperations + :ivar component_available_features: ComponentAvailableFeatures operations + :vartype component_available_features: azure.mgmt.applicationinsights.operations.ComponentAvailableFeaturesOperations + :ivar proactive_detection_configurations: ProactiveDetectionConfigurations operations + :vartype proactive_detection_configurations: azure.mgmt.applicationinsights.operations.ProactiveDetectionConfigurationsOperations + :ivar components: Components operations + :vartype components: azure.mgmt.applicationinsights.operations.ComponentsOperations + :ivar work_item_configurations: WorkItemConfigurations operations + :vartype work_item_configurations: azure.mgmt.applicationinsights.operations.WorkItemConfigurationsOperations + :ivar favorites: Favorites operations + :vartype favorites: azure.mgmt.applicationinsights.operations.FavoritesOperations + :ivar web_test_locations: WebTestLocations operations + :vartype web_test_locations: azure.mgmt.applicationinsights.operations.WebTestLocationsOperations + :ivar web_tests: WebTests operations + :vartype web_tests: azure.mgmt.applicationinsights.operations.WebTestsOperations + :ivar analytics_items: AnalyticsItems operations + :vartype analytics_items: azure.mgmt.applicationinsights.operations.AnalyticsItemsOperations + :ivar workbooks: Workbooks operations + :vartype workbooks: azure.mgmt.applicationinsights.operations.WorkbooksOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object` - :param subscription_id: The Azure subscription ID. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -91,7 +115,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = ApplicationInsightsManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + 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 = '2015-05-01' @@ -100,17 +124,33 @@ def __init__( self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) - self.components = ComponentsOperations( + self.annotations = AnnotationsOperations( self._client, self.config, self._serialize, self._deserialize) - self.web_tests = WebTestsOperations( + self.api_keys = APIKeysOperations( self._client, self.config, self._serialize, self._deserialize) self.export_configurations = ExportConfigurationsOperations( self._client, self.config, self._serialize, self._deserialize) - self.proactive_detection_configurations = ProactiveDetectionConfigurationsOperations( - self._client, self.config, self._serialize, self._deserialize) self.component_current_billing_features = ComponentCurrentBillingFeaturesOperations( self._client, self.config, self._serialize, self._deserialize) self.component_quota_status = ComponentQuotaStatusOperations( self._client, self.config, self._serialize, self._deserialize) - self.api_keys = APIKeysOperations( + self.component_feature_capabilities = ComponentFeatureCapabilitiesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.component_available_features = ComponentAvailableFeaturesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.proactive_detection_configurations = ProactiveDetectionConfigurationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.components = ComponentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.work_item_configurations = WorkItemConfigurationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.favorites = FavoritesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.web_test_locations = WebTestLocationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.web_tests = WebTestsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.analytics_items = AnalyticsItemsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.workbooks = WorkbooksOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/__init__.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/__init__.py index 40e594f9b551..6045835ff520 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/__init__.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/__init__.py @@ -9,60 +9,178 @@ # regenerated. # -------------------------------------------------------------------------- -from .error_response import ErrorResponse, ErrorResponseException -from .operation_display import OperationDisplay -from .operation import Operation -from .resource import Resource -from .tags_resource import TagsResource -from .application_insights_component import ApplicationInsightsComponent -from .web_test_geolocation import WebTestGeolocation -from .web_test_properties_configuration import WebTestPropertiesConfiguration -from .web_test import WebTest -from .application_insights_component_export_request import ApplicationInsightsComponentExportRequest -from .application_insights_component_export_configuration import ApplicationInsightsComponentExportConfiguration -from .application_insights_component_proactive_detection_configuration_rule_definitions import ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions -from .application_insights_component_proactive_detection_configuration import ApplicationInsightsComponentProactiveDetectionConfiguration -from .application_insights_component_data_volume_cap import ApplicationInsightsComponentDataVolumeCap -from .application_insights_component_billing_features import ApplicationInsightsComponentBillingFeatures -from .application_insights_component_quota_status import ApplicationInsightsComponentQuotaStatus -from .api_key_request import APIKeyRequest -from .application_insights_component_api_key import ApplicationInsightsComponentAPIKey +try: + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation + from .annotation_py3 import Annotation + from .inner_error_py3 import InnerError + from .annotation_error_py3 import AnnotationError, AnnotationErrorException + from .api_key_request_py3 import APIKeyRequest + from .application_insights_component_api_key_py3 import ApplicationInsightsComponentAPIKey + from .application_insights_component_export_request_py3 import ApplicationInsightsComponentExportRequest + from .application_insights_component_export_configuration_py3 import ApplicationInsightsComponentExportConfiguration + from .application_insights_component_data_volume_cap_py3 import ApplicationInsightsComponentDataVolumeCap + from .application_insights_component_billing_features_py3 import ApplicationInsightsComponentBillingFeatures + from .application_insights_component_quota_status_py3 import ApplicationInsightsComponentQuotaStatus + from .application_insights_component_feature_capabilities_py3 import ApplicationInsightsComponentFeatureCapabilities + from .application_insights_component_feature_capability_py3 import ApplicationInsightsComponentFeatureCapability + from .application_insights_component_feature_py3 import ApplicationInsightsComponentFeature + from .application_insights_component_available_features_py3 import ApplicationInsightsComponentAvailableFeatures + from .application_insights_component_proactive_detection_configuration_rule_definitions_py3 import ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions + from .application_insights_component_proactive_detection_configuration_py3 import ApplicationInsightsComponentProactiveDetectionConfiguration + from .components_resource_py3 import ComponentsResource + from .tags_resource_py3 import TagsResource + from .application_insights_component_py3 import ApplicationInsightsComponent + from .component_purge_body_filters_py3 import ComponentPurgeBodyFilters + from .component_purge_body_py3 import ComponentPurgeBody + from .component_purge_response_py3 import ComponentPurgeResponse + from .component_purge_status_response_py3 import ComponentPurgeStatusResponse + from .work_item_configuration_py3 import WorkItemConfiguration + from .work_item_create_configuration_py3 import WorkItemCreateConfiguration + from .work_item_configuration_error_py3 import WorkItemConfigurationError, WorkItemConfigurationErrorException + from .application_insights_component_favorite_py3 import ApplicationInsightsComponentFavorite + from .application_insights_component_web_test_location_py3 import ApplicationInsightsComponentWebTestLocation + from .webtests_resource_py3 import WebtestsResource + from .web_test_geolocation_py3 import WebTestGeolocation + from .web_test_properties_configuration_py3 import WebTestPropertiesConfiguration + from .web_test_py3 import WebTest + from .application_insights_component_analytics_item_properties_py3 import ApplicationInsightsComponentAnalyticsItemProperties + from .application_insights_component_analytics_item_py3 import ApplicationInsightsComponentAnalyticsItem + from .workbook_resource_py3 import WorkbookResource + from .workbook_py3 import Workbook + from .link_properties_py3 import LinkProperties + from .error_field_contract_py3 import ErrorFieldContract + from .workbook_error_py3 import WorkbookError, WorkbookErrorException +except (SyntaxError, ImportError): + from .error_response import ErrorResponse, ErrorResponseException + from .operation_display import OperationDisplay + from .operation import Operation + from .annotation import Annotation + from .inner_error import InnerError + from .annotation_error import AnnotationError, AnnotationErrorException + from .api_key_request import APIKeyRequest + from .application_insights_component_api_key import ApplicationInsightsComponentAPIKey + from .application_insights_component_export_request import ApplicationInsightsComponentExportRequest + from .application_insights_component_export_configuration import ApplicationInsightsComponentExportConfiguration + from .application_insights_component_data_volume_cap import ApplicationInsightsComponentDataVolumeCap + from .application_insights_component_billing_features import ApplicationInsightsComponentBillingFeatures + from .application_insights_component_quota_status import ApplicationInsightsComponentQuotaStatus + from .application_insights_component_feature_capabilities import ApplicationInsightsComponentFeatureCapabilities + from .application_insights_component_feature_capability import ApplicationInsightsComponentFeatureCapability + from .application_insights_component_feature import ApplicationInsightsComponentFeature + from .application_insights_component_available_features import ApplicationInsightsComponentAvailableFeatures + from .application_insights_component_proactive_detection_configuration_rule_definitions import ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions + from .application_insights_component_proactive_detection_configuration import ApplicationInsightsComponentProactiveDetectionConfiguration + from .components_resource import ComponentsResource + from .tags_resource import TagsResource + from .application_insights_component import ApplicationInsightsComponent + from .component_purge_body_filters import ComponentPurgeBodyFilters + from .component_purge_body import ComponentPurgeBody + from .component_purge_response import ComponentPurgeResponse + from .component_purge_status_response import ComponentPurgeStatusResponse + from .work_item_configuration import WorkItemConfiguration + from .work_item_create_configuration import WorkItemCreateConfiguration + from .work_item_configuration_error import WorkItemConfigurationError, WorkItemConfigurationErrorException + from .application_insights_component_favorite import ApplicationInsightsComponentFavorite + from .application_insights_component_web_test_location import ApplicationInsightsComponentWebTestLocation + from .webtests_resource import WebtestsResource + from .web_test_geolocation import WebTestGeolocation + from .web_test_properties_configuration import WebTestPropertiesConfiguration + from .web_test import WebTest + from .application_insights_component_analytics_item_properties import ApplicationInsightsComponentAnalyticsItemProperties + from .application_insights_component_analytics_item import ApplicationInsightsComponentAnalyticsItem + from .workbook_resource import WorkbookResource + from .workbook import Workbook + from .link_properties import LinkProperties + from .error_field_contract import ErrorFieldContract + from .workbook_error import WorkbookError, WorkbookErrorException from .operation_paged import OperationPaged +from .annotation_paged import AnnotationPaged +from .application_insights_component_api_key_paged import ApplicationInsightsComponentAPIKeyPaged from .application_insights_component_paged import ApplicationInsightsComponentPaged +from .work_item_configuration_paged import WorkItemConfigurationPaged +from .application_insights_component_web_test_location_paged import ApplicationInsightsComponentWebTestLocationPaged from .web_test_paged import WebTestPaged -from .application_insights_component_api_key_paged import ApplicationInsightsComponentAPIKeyPaged +from .workbook_paged import WorkbookPaged from .application_insights_management_client_enums import ( ApplicationType, FlowType, RequestSource, + PurgeState, + FavoriteType, WebTestKind, + ItemScope, + ItemType, + SharedTypeKind, + FavoriteSourceType, + ItemScopePath, + ItemTypeParameter, + CategoryType, ) __all__ = [ 'ErrorResponse', 'ErrorResponseException', 'OperationDisplay', 'Operation', - 'Resource', - 'TagsResource', - 'ApplicationInsightsComponent', - 'WebTestGeolocation', - 'WebTestPropertiesConfiguration', - 'WebTest', + 'Annotation', + 'InnerError', + 'AnnotationError', 'AnnotationErrorException', + 'APIKeyRequest', + 'ApplicationInsightsComponentAPIKey', 'ApplicationInsightsComponentExportRequest', 'ApplicationInsightsComponentExportConfiguration', - 'ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions', - 'ApplicationInsightsComponentProactiveDetectionConfiguration', 'ApplicationInsightsComponentDataVolumeCap', 'ApplicationInsightsComponentBillingFeatures', 'ApplicationInsightsComponentQuotaStatus', - 'APIKeyRequest', - 'ApplicationInsightsComponentAPIKey', + 'ApplicationInsightsComponentFeatureCapabilities', + 'ApplicationInsightsComponentFeatureCapability', + 'ApplicationInsightsComponentFeature', + 'ApplicationInsightsComponentAvailableFeatures', + 'ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions', + 'ApplicationInsightsComponentProactiveDetectionConfiguration', + 'ComponentsResource', + 'TagsResource', + 'ApplicationInsightsComponent', + 'ComponentPurgeBodyFilters', + 'ComponentPurgeBody', + 'ComponentPurgeResponse', + 'ComponentPurgeStatusResponse', + 'WorkItemConfiguration', + 'WorkItemCreateConfiguration', + 'WorkItemConfigurationError', 'WorkItemConfigurationErrorException', + 'ApplicationInsightsComponentFavorite', + 'ApplicationInsightsComponentWebTestLocation', + 'WebtestsResource', + 'WebTestGeolocation', + 'WebTestPropertiesConfiguration', + 'WebTest', + 'ApplicationInsightsComponentAnalyticsItemProperties', + 'ApplicationInsightsComponentAnalyticsItem', + 'WorkbookResource', + 'Workbook', + 'LinkProperties', + 'ErrorFieldContract', + 'WorkbookError', 'WorkbookErrorException', 'OperationPaged', + 'AnnotationPaged', + 'ApplicationInsightsComponentAPIKeyPaged', 'ApplicationInsightsComponentPaged', + 'WorkItemConfigurationPaged', + 'ApplicationInsightsComponentWebTestLocationPaged', 'WebTestPaged', - 'ApplicationInsightsComponentAPIKeyPaged', + 'WorkbookPaged', 'ApplicationType', 'FlowType', 'RequestSource', + 'PurgeState', + 'FavoriteType', 'WebTestKind', + 'ItemScope', + 'ItemType', + 'SharedTypeKind', + 'FavoriteSourceType', + 'ItemScopePath', + 'ItemTypeParameter', + 'CategoryType', ] diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation.py new file mode 100644 index 000000000000..34b96b0d7660 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Annotation(Model): + """Annotation associated with an application insights resource. + + :param annotation_name: Name of annotation + :type annotation_name: str + :param category: Category of annotation, free form + :type category: str + :param event_time: Time when event occurred + :type event_time: datetime + :param id: Unique Id for annotation + :type id: str + :param properties: Serialized JSON object for detailed properties + :type properties: str + :param related_annotation: Related parent annotation if any. Default + value: "null" . + :type related_annotation: str + """ + + _attribute_map = { + 'annotation_name': {'key': 'AnnotationName', 'type': 'str'}, + 'category': {'key': 'Category', 'type': 'str'}, + 'event_time': {'key': 'EventTime', 'type': 'iso-8601'}, + 'id': {'key': 'Id', 'type': 'str'}, + 'properties': {'key': 'Properties', 'type': 'str'}, + 'related_annotation': {'key': 'RelatedAnnotation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Annotation, self).__init__(**kwargs) + self.annotation_name = kwargs.get('annotation_name', None) + self.category = kwargs.get('category', None) + self.event_time = kwargs.get('event_time', None) + self.id = kwargs.get('id', None) + self.properties = kwargs.get('properties', None) + self.related_annotation = kwargs.get('related_annotation', "null") diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_error.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_error.py new file mode 100644 index 000000000000..b0eb1feb10e2 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_error.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class AnnotationError(Model): + """Error associated with trying to create annotation with Id that already + exist. + + :param code: Error detail code and explanation + :type code: str + :param message: Error message + :type message: str + :param innererror: + :type innererror: ~azure.mgmt.applicationinsights.models.InnerError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + } + + def __init__(self, **kwargs): + super(AnnotationError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.innererror = kwargs.get('innererror', None) + + +class AnnotationErrorException(HttpOperationError): + """Server responsed with exception of type: 'AnnotationError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(AnnotationErrorException, self).__init__(deserialize, response, 'AnnotationError', *args) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_error_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_error_py3.py new file mode 100644 index 000000000000..81ac3d4340b1 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_error_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class AnnotationError(Model): + """Error associated with trying to create annotation with Id that already + exist. + + :param code: Error detail code and explanation + :type code: str + :param message: Error message + :type message: str + :param innererror: + :type innererror: ~azure.mgmt.applicationinsights.models.InnerError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + } + + def __init__(self, *, code: str=None, message: str=None, innererror=None, **kwargs) -> None: + super(AnnotationError, self).__init__(**kwargs) + self.code = code + self.message = message + self.innererror = innererror + + +class AnnotationErrorException(HttpOperationError): + """Server responsed with exception of type: 'AnnotationError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(AnnotationErrorException, self).__init__(deserialize, response, 'AnnotationError', *args) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_insight_paged.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_paged.py similarity index 61% rename from azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_insight_paged.py rename to azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_paged.py index 8aa6b40efaa4..c9de7bcba53a 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_insight_paged.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_paged.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class StorageInsightPaged(Paged): +class AnnotationPaged(Paged): """ - A paging container for iterating over a list of :class:`StorageInsight ` object + A paging container for iterating over a list of :class:`Annotation ` object """ _attribute_map = { - 'next_link': {'key': '@odata\\.nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[StorageInsight]'} + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Annotation]'} } def __init__(self, *args, **kwargs): - super(StorageInsightPaged, self).__init__(*args, **kwargs) + super(AnnotationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_py3.py new file mode 100644 index 000000000000..f9e84417d725 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_py3.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Annotation(Model): + """Annotation associated with an application insights resource. + + :param annotation_name: Name of annotation + :type annotation_name: str + :param category: Category of annotation, free form + :type category: str + :param event_time: Time when event occurred + :type event_time: datetime + :param id: Unique Id for annotation + :type id: str + :param properties: Serialized JSON object for detailed properties + :type properties: str + :param related_annotation: Related parent annotation if any. Default + value: "null" . + :type related_annotation: str + """ + + _attribute_map = { + 'annotation_name': {'key': 'AnnotationName', 'type': 'str'}, + 'category': {'key': 'Category', 'type': 'str'}, + 'event_time': {'key': 'EventTime', 'type': 'iso-8601'}, + 'id': {'key': 'Id', 'type': 'str'}, + 'properties': {'key': 'Properties', 'type': 'str'}, + 'related_annotation': {'key': 'RelatedAnnotation', 'type': 'str'}, + } + + def __init__(self, *, annotation_name: str=None, category: str=None, event_time=None, id: str=None, properties: str=None, related_annotation: str="null", **kwargs) -> None: + super(Annotation, self).__init__(**kwargs) + self.annotation_name = annotation_name + self.category = category + self.event_time = event_time + self.id = id + self.properties = properties + self.related_annotation = related_annotation diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/api_key_request.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/api_key_request.py index a802d1544b81..324be1c1e51f 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/api_key_request.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/api_key_request.py @@ -13,7 +13,7 @@ class APIKeyRequest(Model): - """An Application Insights component API Key createion request definition. + """An Application Insights component API Key creation request definition. :param name: The name of the API Key. :type name: str @@ -29,8 +29,8 @@ class APIKeyRequest(Model): 'linked_write_properties': {'key': 'linkedWriteProperties', 'type': '[str]'}, } - def __init__(self, name=None, linked_read_properties=None, linked_write_properties=None): - super(APIKeyRequest, self).__init__() - self.name = name - self.linked_read_properties = linked_read_properties - self.linked_write_properties = linked_write_properties + def __init__(self, **kwargs): + super(APIKeyRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.linked_read_properties = kwargs.get('linked_read_properties', None) + self.linked_write_properties = kwargs.get('linked_write_properties', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/api_key_request_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/api_key_request_py3.py new file mode 100644 index 000000000000..4d36981c4e23 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/api_key_request_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class APIKeyRequest(Model): + """An Application Insights component API Key creation request definition. + + :param name: The name of the API Key. + :type name: str + :param linked_read_properties: The read access rights of this API Key. + :type linked_read_properties: list[str] + :param linked_write_properties: The write access rights of this API Key. + :type linked_write_properties: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'linked_read_properties': {'key': 'linkedReadProperties', 'type': '[str]'}, + 'linked_write_properties': {'key': 'linkedWriteProperties', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, linked_read_properties=None, linked_write_properties=None, **kwargs) -> None: + super(APIKeyRequest, self).__init__(**kwargs) + self.name = name + self.linked_read_properties = linked_read_properties + self.linked_write_properties = linked_write_properties diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component.py index f3c11134bfe0..226b0bfd90f9 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component.py @@ -9,36 +9,38 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .components_resource import ComponentsResource -class ApplicationInsightsComponent(Resource): +class ApplicationInsightsComponent(ComponentsResource): """An Application Insights component 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. + :ivar id: Azure resource Id :vartype id: str :ivar name: Azure resource name :vartype name: str :ivar type: Azure resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] - :param kind: The kind of application that this component refers 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. + :param kind: Required. The kind of application that this component refers + 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 :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 - :param application_type: Type of application being monitored. Possible - values include: 'web', 'other'. Default value: "web" . + :param application_type: Required. Type of application being monitored. + Possible values include: 'web', 'other'. Default value: "web" . :type application_type: str or ~azure.mgmt.applicationinsights.models.ApplicationType :param flow_type: Used by the Application Insights system to determine @@ -115,18 +117,18 @@ class ApplicationInsightsComponent(Resource): 'sampling_percentage': {'key': 'properties.SamplingPercentage', 'type': 'float'}, } - def __init__(self, location, kind, tags=None, application_type="web", flow_type="Bluefield", request_source="rest", hockey_app_id=None, sampling_percentage=None): - super(ApplicationInsightsComponent, self).__init__(location=location, tags=tags) - self.kind = kind + def __init__(self, **kwargs): + super(ApplicationInsightsComponent, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) self.application_id = None self.app_id = None - self.application_type = application_type - self.flow_type = flow_type - self.request_source = request_source + self.application_type = kwargs.get('application_type', "web") + self.flow_type = kwargs.get('flow_type', "Bluefield") + self.request_source = kwargs.get('request_source', "rest") self.instrumentation_key = None self.creation_date = None self.tenant_id = None - self.hockey_app_id = hockey_app_id + self.hockey_app_id = kwargs.get('hockey_app_id', None) self.hockey_app_token = None self.provisioning_state = None - self.sampling_percentage = sampling_percentage + self.sampling_percentage = kwargs.get('sampling_percentage', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_analytics_item.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_analytics_item.py new file mode 100644 index 000000000000..ac41804be429 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_analytics_item.py @@ -0,0 +1,76 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentAnalyticsItem(Model): + """Properties that define an Analytics item that is associated to an + Application Insights component. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Internally assigned unique id of the item definition. + :type id: str + :param name: The user-defined name of the item. + :type name: str + :param content: The content of this item + :type content: str + :ivar version: This instance's version of the data model. This can change + as new features are added. + :vartype version: str + :param scope: Enum indicating if this item definition is owned by a + specific user or is shared between all users with access to the + Application Insights component. Possible values include: 'shared', 'user' + :type scope: str or ~azure.mgmt.applicationinsights.models.ItemScope + :param type: Enum indicating the type of the Analytics item. Possible + values include: 'query', 'function', 'folder', 'recent' + :type type: str or ~azure.mgmt.applicationinsights.models.ItemType + :ivar time_created: Date and time in UTC when this item was created. + :vartype time_created: str + :ivar time_modified: Date and time in UTC of the last modification that + was made to this item. + :vartype time_modified: str + :param properties: + :type properties: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentAnalyticsItemProperties + """ + + _validation = { + 'version': {'readonly': True}, + 'time_created': {'readonly': True}, + 'time_modified': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'Id', 'type': 'str'}, + 'name': {'key': 'Name', 'type': 'str'}, + 'content': {'key': 'Content', 'type': 'str'}, + 'version': {'key': 'Version', 'type': 'str'}, + 'scope': {'key': 'Scope', 'type': 'str'}, + 'type': {'key': 'Type', 'type': 'str'}, + 'time_created': {'key': 'TimeCreated', 'type': 'str'}, + 'time_modified': {'key': 'TimeModified', 'type': 'str'}, + 'properties': {'key': 'Properties', 'type': 'ApplicationInsightsComponentAnalyticsItemProperties'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentAnalyticsItem, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.content = kwargs.get('content', None) + self.version = None + self.scope = kwargs.get('scope', None) + self.type = kwargs.get('type', None) + self.time_created = None + self.time_modified = None + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_sort.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_analytics_item_properties.py similarity index 51% rename from azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_sort.py rename to azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_analytics_item_properties.py index 2abb299ee3fd..56a2b9ca8258 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_sort.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_analytics_item_properties.py @@ -12,22 +12,19 @@ from msrest.serialization import Model -class SearchSort(Model): - """The sort parameters for search. +class ApplicationInsightsComponentAnalyticsItemProperties(Model): + """A set of properties that can be defined in the context of a specific item + type. Each type may have its own properties. - :param name: The name of the field the search query is sorted on. - :type name: str - :param order: The sort order of the search. Possible values include: - 'asc', 'desc' - :type order: str or ~azure.mgmt.loganalytics.models.SearchSortEnum + :param function_alias: A function alias, used when the type of the item is + Function + :type function_alias: str """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'order': {'key': 'order', 'type': 'str'}, + 'function_alias': {'key': 'functionAlias', 'type': 'str'}, } def __init__(self, **kwargs): - super(SearchSort, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.order = kwargs.get('order', None) + super(ApplicationInsightsComponentAnalyticsItemProperties, self).__init__(**kwargs) + self.function_alias = kwargs.get('function_alias', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_analytics_item_properties_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_analytics_item_properties_py3.py new file mode 100644 index 000000000000..30a0e6c0dca3 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_analytics_item_properties_py3.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentAnalyticsItemProperties(Model): + """A set of properties that can be defined in the context of a specific item + type. Each type may have its own properties. + + :param function_alias: A function alias, used when the type of the item is + Function + :type function_alias: str + """ + + _attribute_map = { + 'function_alias': {'key': 'functionAlias', 'type': 'str'}, + } + + def __init__(self, *, function_alias: str=None, **kwargs) -> None: + super(ApplicationInsightsComponentAnalyticsItemProperties, self).__init__(**kwargs) + self.function_alias = function_alias diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_analytics_item_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_analytics_item_py3.py new file mode 100644 index 000000000000..fb2502512db3 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_analytics_item_py3.py @@ -0,0 +1,76 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentAnalyticsItem(Model): + """Properties that define an Analytics item that is associated to an + Application Insights component. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Internally assigned unique id of the item definition. + :type id: str + :param name: The user-defined name of the item. + :type name: str + :param content: The content of this item + :type content: str + :ivar version: This instance's version of the data model. This can change + as new features are added. + :vartype version: str + :param scope: Enum indicating if this item definition is owned by a + specific user or is shared between all users with access to the + Application Insights component. Possible values include: 'shared', 'user' + :type scope: str or ~azure.mgmt.applicationinsights.models.ItemScope + :param type: Enum indicating the type of the Analytics item. Possible + values include: 'query', 'function', 'folder', 'recent' + :type type: str or ~azure.mgmt.applicationinsights.models.ItemType + :ivar time_created: Date and time in UTC when this item was created. + :vartype time_created: str + :ivar time_modified: Date and time in UTC of the last modification that + was made to this item. + :vartype time_modified: str + :param properties: + :type properties: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentAnalyticsItemProperties + """ + + _validation = { + 'version': {'readonly': True}, + 'time_created': {'readonly': True}, + 'time_modified': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'Id', 'type': 'str'}, + 'name': {'key': 'Name', 'type': 'str'}, + 'content': {'key': 'Content', 'type': 'str'}, + 'version': {'key': 'Version', 'type': 'str'}, + 'scope': {'key': 'Scope', 'type': 'str'}, + 'type': {'key': 'Type', 'type': 'str'}, + 'time_created': {'key': 'TimeCreated', 'type': 'str'}, + 'time_modified': {'key': 'TimeModified', 'type': 'str'}, + 'properties': {'key': 'Properties', 'type': 'ApplicationInsightsComponentAnalyticsItemProperties'}, + } + + def __init__(self, *, id: str=None, name: str=None, content: str=None, scope=None, type=None, properties=None, **kwargs) -> None: + super(ApplicationInsightsComponentAnalyticsItem, self).__init__(**kwargs) + self.id = id + self.name = name + self.content = content + self.version = None + self.scope = scope + self.type = type + self.time_created = None + self.time_modified = None + self.properties = properties diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_api_key.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_api_key.py index b5d76a452508..854139952ad1 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_api_key.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_api_key.py @@ -18,7 +18,7 @@ class ApplicationInsightsComponentAPIKey(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique ID of the API key inside an Applciation Insights + :ivar id: The unique ID of the API key inside an Application Insights component. It is auto generated when the API key is created. :vartype id: str :ivar api_key: The API key value. It will be only return once when the API @@ -48,11 +48,11 @@ class ApplicationInsightsComponentAPIKey(Model): 'linked_write_properties': {'key': 'linkedWriteProperties', 'type': '[str]'}, } - def __init__(self, created_date=None, name=None, linked_read_properties=None, linked_write_properties=None): - super(ApplicationInsightsComponentAPIKey, self).__init__() + def __init__(self, **kwargs): + super(ApplicationInsightsComponentAPIKey, self).__init__(**kwargs) self.id = None self.api_key = None - self.created_date = created_date - self.name = name - self.linked_read_properties = linked_read_properties - self.linked_write_properties = linked_write_properties + self.created_date = kwargs.get('created_date', None) + self.name = kwargs.get('name', None) + self.linked_read_properties = kwargs.get('linked_read_properties', None) + self.linked_write_properties = kwargs.get('linked_write_properties', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_api_key_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_api_key_py3.py new file mode 100644 index 000000000000..670dcdbce4d8 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_api_key_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentAPIKey(Model): + """Properties that define an API key of an Application Insights Component. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The unique ID of the API key inside an Application Insights + component. It is auto generated when the API key is created. + :vartype id: str + :ivar api_key: The API key value. It will be only return once when the API + Key was created. + :vartype api_key: str + :param created_date: The create date of this API key. + :type created_date: str + :param name: The name of the API key. + :type name: str + :param linked_read_properties: The read access rights of this API Key. + :type linked_read_properties: list[str] + :param linked_write_properties: The write access rights of this API Key. + :type linked_write_properties: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'api_key': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'api_key': {'key': 'apiKey', 'type': 'str'}, + 'created_date': {'key': 'createdDate', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'linked_read_properties': {'key': 'linkedReadProperties', 'type': '[str]'}, + 'linked_write_properties': {'key': 'linkedWriteProperties', 'type': '[str]'}, + } + + def __init__(self, *, created_date: str=None, name: str=None, linked_read_properties=None, linked_write_properties=None, **kwargs) -> None: + super(ApplicationInsightsComponentAPIKey, self).__init__(**kwargs) + self.id = None + self.api_key = None + self.created_date = created_date + self.name = name + self.linked_read_properties = linked_read_properties + self.linked_write_properties = linked_write_properties diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_available_features.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_available_features.py new file mode 100644 index 000000000000..5358010ad5d4 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_available_features.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentAvailableFeatures(Model): + """An Application Insights component available features. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar result: A list of Application Insights component feature. + :vartype result: + list[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFeature] + """ + + _validation = { + 'result': {'readonly': True}, + } + + _attribute_map = { + 'result': {'key': 'Result', 'type': '[ApplicationInsightsComponentFeature]'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentAvailableFeatures, self).__init__(**kwargs) + self.result = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_available_features_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_available_features_py3.py new file mode 100644 index 000000000000..a42604832686 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_available_features_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentAvailableFeatures(Model): + """An Application Insights component available features. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar result: A list of Application Insights component feature. + :vartype result: + list[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFeature] + """ + + _validation = { + 'result': {'readonly': True}, + } + + _attribute_map = { + 'result': {'key': 'Result', 'type': '[ApplicationInsightsComponentFeature]'}, + } + + def __init__(self, **kwargs) -> None: + super(ApplicationInsightsComponentAvailableFeatures, self).__init__(**kwargs) + self.result = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_billing_features.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_billing_features.py index c6a653660cda..4b194d4b26d4 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_billing_features.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_billing_features.py @@ -16,7 +16,7 @@ class ApplicationInsightsComponentBillingFeatures(Model): """An Application Insights component billing features. :param data_volume_cap: An Application Insights component daily data - volumne cap + volume cap :type data_volume_cap: ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentDataVolumeCap :param current_billing_features: Current enabled pricing plan. When the @@ -30,7 +30,7 @@ class ApplicationInsightsComponentBillingFeatures(Model): 'current_billing_features': {'key': 'CurrentBillingFeatures', 'type': '[str]'}, } - def __init__(self, data_volume_cap=None, current_billing_features=None): - super(ApplicationInsightsComponentBillingFeatures, self).__init__() - self.data_volume_cap = data_volume_cap - self.current_billing_features = current_billing_features + def __init__(self, **kwargs): + super(ApplicationInsightsComponentBillingFeatures, self).__init__(**kwargs) + self.data_volume_cap = kwargs.get('data_volume_cap', None) + self.current_billing_features = kwargs.get('current_billing_features', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_billing_features_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_billing_features_py3.py new file mode 100644 index 000000000000..94ade3fcf09a --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_billing_features_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentBillingFeatures(Model): + """An Application Insights component billing features. + + :param data_volume_cap: An Application Insights component daily data + volume cap + :type data_volume_cap: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentDataVolumeCap + :param current_billing_features: Current enabled pricing plan. When the + component is in the Enterprise plan, this will list both 'Basic' and + 'Application Insights Enterprise'. + :type current_billing_features: list[str] + """ + + _attribute_map = { + 'data_volume_cap': {'key': 'DataVolumeCap', 'type': 'ApplicationInsightsComponentDataVolumeCap'}, + 'current_billing_features': {'key': 'CurrentBillingFeatures', 'type': '[str]'}, + } + + def __init__(self, *, data_volume_cap=None, current_billing_features=None, **kwargs) -> None: + super(ApplicationInsightsComponentBillingFeatures, self).__init__(**kwargs) + self.data_volume_cap = data_volume_cap + self.current_billing_features = current_billing_features diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_data_volume_cap.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_data_volume_cap.py index 3fd7a709fc2f..a364ad440217 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_data_volume_cap.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_data_volume_cap.py @@ -13,7 +13,7 @@ class ApplicationInsightsComponentDataVolumeCap(Model): - """An Application Insights component daily data volumne cap. + """An Application Insights component daily data volume cap. Variables are only populated by the server, and will be ignored when sending a request. @@ -49,11 +49,11 @@ class ApplicationInsightsComponentDataVolumeCap(Model): 'max_history_cap': {'key': 'MaxHistoryCap', 'type': 'float'}, } - def __init__(self, cap=None, warning_threshold=None, stop_send_notification_when_hit_threshold=None, stop_send_notification_when_hit_cap=None): - super(ApplicationInsightsComponentDataVolumeCap, self).__init__() - self.cap = cap + def __init__(self, **kwargs): + super(ApplicationInsightsComponentDataVolumeCap, self).__init__(**kwargs) + self.cap = kwargs.get('cap', None) self.reset_time = None - self.warning_threshold = warning_threshold - self.stop_send_notification_when_hit_threshold = stop_send_notification_when_hit_threshold - self.stop_send_notification_when_hit_cap = stop_send_notification_when_hit_cap + self.warning_threshold = kwargs.get('warning_threshold', None) + self.stop_send_notification_when_hit_threshold = kwargs.get('stop_send_notification_when_hit_threshold', None) + self.stop_send_notification_when_hit_cap = kwargs.get('stop_send_notification_when_hit_cap', None) self.max_history_cap = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_data_volume_cap_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_data_volume_cap_py3.py new file mode 100644 index 000000000000..1065fa77ceba --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_data_volume_cap_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentDataVolumeCap(Model): + """An Application Insights component daily data volume cap. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param cap: Daily data volume cap in GB. + :type cap: float + :ivar reset_time: Daily data volume cap UTC reset hour. + :vartype reset_time: int + :param warning_threshold: Reserved, not used for now. + :type warning_threshold: int + :param stop_send_notification_when_hit_threshold: Reserved, not used for + now. + :type stop_send_notification_when_hit_threshold: bool + :param stop_send_notification_when_hit_cap: Do not send a notification + email when the daily data volume cap is met. + :type stop_send_notification_when_hit_cap: bool + :ivar max_history_cap: Maximum daily data volume cap that the user can set + for this component. + :vartype max_history_cap: float + """ + + _validation = { + 'reset_time': {'readonly': True}, + 'max_history_cap': {'readonly': True}, + } + + _attribute_map = { + 'cap': {'key': 'Cap', 'type': 'float'}, + 'reset_time': {'key': 'ResetTime', 'type': 'int'}, + 'warning_threshold': {'key': 'WarningThreshold', 'type': 'int'}, + 'stop_send_notification_when_hit_threshold': {'key': 'StopSendNotificationWhenHitThreshold', 'type': 'bool'}, + 'stop_send_notification_when_hit_cap': {'key': 'StopSendNotificationWhenHitCap', 'type': 'bool'}, + 'max_history_cap': {'key': 'MaxHistoryCap', 'type': 'float'}, + } + + def __init__(self, *, cap: float=None, warning_threshold: int=None, stop_send_notification_when_hit_threshold: bool=None, stop_send_notification_when_hit_cap: bool=None, **kwargs) -> None: + super(ApplicationInsightsComponentDataVolumeCap, self).__init__(**kwargs) + self.cap = cap + self.reset_time = None + self.warning_threshold = warning_threshold + self.stop_send_notification_when_hit_threshold = stop_send_notification_when_hit_threshold + self.stop_send_notification_when_hit_cap = stop_send_notification_when_hit_cap + self.max_history_cap = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_configuration.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_configuration.py index 33a28500dd76..8c99d4bddc91 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_configuration.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_configuration.py @@ -19,7 +19,7 @@ class ApplicationInsightsComponentExportConfiguration(Model): sending a request. :ivar export_id: The unique ID of the export configuration inside an - Applciation Insights component. It is auto generated when the Continuous + Application Insights component. It is auto generated when the Continuous Export configuration is created. :vartype export_id: str :ivar instrumentation_key: The instrumentation key of the Application @@ -119,11 +119,11 @@ class ApplicationInsightsComponentExportConfiguration(Model): 'container_name': {'key': 'ContainerName', 'type': 'str'}, } - def __init__(self, record_types=None, notification_queue_enabled=None): - super(ApplicationInsightsComponentExportConfiguration, self).__init__() + def __init__(self, **kwargs): + super(ApplicationInsightsComponentExportConfiguration, self).__init__(**kwargs) self.export_id = None self.instrumentation_key = None - self.record_types = record_types + self.record_types = kwargs.get('record_types', None) self.application_name = None self.subscription_id = None self.resource_group = None @@ -133,7 +133,7 @@ def __init__(self, record_types=None, notification_queue_enabled=None): self.destination_type = None self.is_user_enabled = None self.last_user_update = None - self.notification_queue_enabled = notification_queue_enabled + self.notification_queue_enabled = kwargs.get('notification_queue_enabled', None) self.export_status = None self.last_success_time = None self.last_gap_time = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_configuration_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_configuration_py3.py new file mode 100644 index 000000000000..81d92c3b82d1 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_configuration_py3.py @@ -0,0 +1,142 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentExportConfiguration(Model): + """Properties that define a Continuous Export configuration. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar export_id: The unique ID of the export configuration inside an + Application Insights component. It is auto generated when the Continuous + Export configuration is created. + :vartype export_id: str + :ivar instrumentation_key: The instrumentation key of the Application + Insights component. + :vartype instrumentation_key: str + :param record_types: This comma separated list of document types that will + be exported. The possible values include 'Requests', 'Event', + 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', + 'PerformanceCounters', 'Availability', 'Messages'. + :type record_types: str + :ivar application_name: The name of the Application Insights component. + :vartype application_name: str + :ivar subscription_id: The subscription of the Application Insights + component. + :vartype subscription_id: str + :ivar resource_group: The resource group of the Application Insights + component. + :vartype resource_group: str + :ivar destination_storage_subscription_id: The destination storage account + subscription ID. + :vartype destination_storage_subscription_id: str + :ivar destination_storage_location_id: The destination account location + ID. + :vartype destination_storage_location_id: str + :ivar destination_account_id: The name of destination account. + :vartype destination_account_id: str + :ivar destination_type: The destination type. + :vartype destination_type: str + :ivar is_user_enabled: This will be 'true' if the Continuous Export + configuration is enabled, otherwise it will be 'false'. + :vartype is_user_enabled: str + :ivar last_user_update: Last time the Continuous Export configuration was + updated. + :vartype last_user_update: str + :param notification_queue_enabled: Deprecated + :type notification_queue_enabled: str + :ivar export_status: This indicates current Continuous Export + configuration status. The possible values are 'Preparing', 'Success', + 'Failure'. + :vartype export_status: str + :ivar last_success_time: The last time data was successfully delivered to + the destination storage container for this Continuous Export + configuration. + :vartype last_success_time: str + :ivar last_gap_time: The last time the Continuous Export configuration + started failing. + :vartype last_gap_time: str + :ivar permanent_error_reason: This is the reason the Continuous Export + configuration started failing. It can be 'AzureStorageNotFound' or + 'AzureStorageAccessDenied'. + :vartype permanent_error_reason: str + :ivar storage_name: The name of the destination storage account. + :vartype storage_name: str + :ivar container_name: The name of the destination storage container. + :vartype container_name: str + """ + + _validation = { + 'export_id': {'readonly': True}, + 'instrumentation_key': {'readonly': True}, + 'application_name': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'destination_storage_subscription_id': {'readonly': True}, + 'destination_storage_location_id': {'readonly': True}, + 'destination_account_id': {'readonly': True}, + 'destination_type': {'readonly': True}, + 'is_user_enabled': {'readonly': True}, + 'last_user_update': {'readonly': True}, + 'export_status': {'readonly': True}, + 'last_success_time': {'readonly': True}, + 'last_gap_time': {'readonly': True}, + 'permanent_error_reason': {'readonly': True}, + 'storage_name': {'readonly': True}, + 'container_name': {'readonly': True}, + } + + _attribute_map = { + 'export_id': {'key': 'ExportId', 'type': 'str'}, + 'instrumentation_key': {'key': 'InstrumentationKey', 'type': 'str'}, + 'record_types': {'key': 'RecordTypes', 'type': 'str'}, + 'application_name': {'key': 'ApplicationName', 'type': 'str'}, + 'subscription_id': {'key': 'SubscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'ResourceGroup', 'type': 'str'}, + 'destination_storage_subscription_id': {'key': 'DestinationStorageSubscriptionId', 'type': 'str'}, + 'destination_storage_location_id': {'key': 'DestinationStorageLocationId', 'type': 'str'}, + 'destination_account_id': {'key': 'DestinationAccountId', 'type': 'str'}, + 'destination_type': {'key': 'DestinationType', 'type': 'str'}, + 'is_user_enabled': {'key': 'IsUserEnabled', 'type': 'str'}, + 'last_user_update': {'key': 'LastUserUpdate', 'type': 'str'}, + 'notification_queue_enabled': {'key': 'NotificationQueueEnabled', 'type': 'str'}, + 'export_status': {'key': 'ExportStatus', 'type': 'str'}, + 'last_success_time': {'key': 'LastSuccessTime', 'type': 'str'}, + 'last_gap_time': {'key': 'LastGapTime', 'type': 'str'}, + 'permanent_error_reason': {'key': 'PermanentErrorReason', 'type': 'str'}, + 'storage_name': {'key': 'StorageName', 'type': 'str'}, + 'container_name': {'key': 'ContainerName', 'type': 'str'}, + } + + def __init__(self, *, record_types: str=None, notification_queue_enabled: str=None, **kwargs) -> None: + super(ApplicationInsightsComponentExportConfiguration, self).__init__(**kwargs) + self.export_id = None + self.instrumentation_key = None + self.record_types = record_types + self.application_name = None + self.subscription_id = None + self.resource_group = None + self.destination_storage_subscription_id = None + self.destination_storage_location_id = None + self.destination_account_id = None + self.destination_type = None + self.is_user_enabled = None + self.last_user_update = None + self.notification_queue_enabled = notification_queue_enabled + self.export_status = None + self.last_success_time = None + self.last_gap_time = None + self.permanent_error_reason = None + self.storage_name = None + self.container_name = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_request.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_request.py index c35eb10ab564..19e940c75162 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_request.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_request.py @@ -56,14 +56,14 @@ class ApplicationInsightsComponentExportRequest(Model): 'destination_account_id': {'key': 'DestinationAccountId', 'type': 'str'}, } - def __init__(self, record_types=None, destination_type=None, destination_address=None, is_enabled=None, notification_queue_enabled=None, notification_queue_uri=None, destination_storage_subscription_id=None, destination_storage_location_id=None, destination_account_id=None): - super(ApplicationInsightsComponentExportRequest, self).__init__() - self.record_types = record_types - self.destination_type = destination_type - self.destination_address = destination_address - self.is_enabled = is_enabled - self.notification_queue_enabled = notification_queue_enabled - self.notification_queue_uri = notification_queue_uri - self.destination_storage_subscription_id = destination_storage_subscription_id - self.destination_storage_location_id = destination_storage_location_id - self.destination_account_id = destination_account_id + def __init__(self, **kwargs): + super(ApplicationInsightsComponentExportRequest, self).__init__(**kwargs) + self.record_types = kwargs.get('record_types', None) + self.destination_type = kwargs.get('destination_type', None) + self.destination_address = kwargs.get('destination_address', None) + self.is_enabled = kwargs.get('is_enabled', None) + self.notification_queue_enabled = kwargs.get('notification_queue_enabled', None) + self.notification_queue_uri = kwargs.get('notification_queue_uri', None) + self.destination_storage_subscription_id = kwargs.get('destination_storage_subscription_id', None) + self.destination_storage_location_id = kwargs.get('destination_storage_location_id', None) + self.destination_account_id = kwargs.get('destination_account_id', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_request_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_request_py3.py new file mode 100644 index 000000000000..ecacc3b49a02 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_request_py3.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentExportRequest(Model): + """An Application Insights component Continuous Export configuration request + definition. + + :param record_types: The document types to be exported, as comma separated + values. Allowed values include 'Requests', 'Event', 'Exceptions', + 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', + 'PerformanceCounters', 'Availability', 'Messages'. + :type record_types: str + :param destination_type: The Continuous Export destination type. This has + to be 'Blob'. + :type destination_type: str + :param destination_address: The SAS URL for the destination storage + container. It must grant write permission. + :type destination_address: str + :param is_enabled: Set to 'true' to create a Continuous Export + configuration as enabled, otherwise set it to 'false'. + :type is_enabled: str + :param notification_queue_enabled: Deprecated + :type notification_queue_enabled: str + :param notification_queue_uri: Deprecated + :type notification_queue_uri: str + :param destination_storage_subscription_id: The subscription ID of the + destination storage container. + :type destination_storage_subscription_id: str + :param destination_storage_location_id: The location ID of the destination + storage container. + :type destination_storage_location_id: str + :param destination_account_id: The name of destination storage account. + :type destination_account_id: str + """ + + _attribute_map = { + 'record_types': {'key': 'RecordTypes', 'type': 'str'}, + 'destination_type': {'key': 'DestinationType', 'type': 'str'}, + 'destination_address': {'key': 'DestinationAddress', 'type': 'str'}, + 'is_enabled': {'key': 'IsEnabled', 'type': 'str'}, + 'notification_queue_enabled': {'key': 'NotificationQueueEnabled', 'type': 'str'}, + 'notification_queue_uri': {'key': 'NotificationQueueUri', 'type': 'str'}, + 'destination_storage_subscription_id': {'key': 'DestinationStorageSubscriptionId', 'type': 'str'}, + 'destination_storage_location_id': {'key': 'DestinationStorageLocationId', 'type': 'str'}, + 'destination_account_id': {'key': 'DestinationAccountId', 'type': 'str'}, + } + + def __init__(self, *, record_types: str=None, destination_type: str=None, destination_address: str=None, is_enabled: str=None, notification_queue_enabled: str=None, notification_queue_uri: str=None, destination_storage_subscription_id: str=None, destination_storage_location_id: str=None, destination_account_id: str=None, **kwargs) -> None: + super(ApplicationInsightsComponentExportRequest, self).__init__(**kwargs) + self.record_types = record_types + self.destination_type = destination_type + self.destination_address = destination_address + self.is_enabled = is_enabled + self.notification_queue_enabled = notification_queue_enabled + self.notification_queue_uri = notification_queue_uri + self.destination_storage_subscription_id = destination_storage_subscription_id + self.destination_storage_location_id = destination_storage_location_id + self.destination_account_id = destination_account_id diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_favorite.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_favorite.py new file mode 100644 index 000000000000..a4e853688245 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_favorite.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentFavorite(Model): + """Properties that define a favorite that is associated to an Application + Insights component. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: The user-defined name of the favorite. + :type name: str + :param config: Configuration of this particular favorite, which are driven + by the Azure portal UX. Configuration data is a string containing valid + JSON + :type config: str + :param version: This instance's version of the data model. This can change + as new features are added that can be marked favorite. Current examples + include MetricsExplorer (ME) and Search. + :type version: str + :ivar favorite_id: Internally assigned unique id of the favorite + definition. + :vartype favorite_id: str + :param favorite_type: Enum indicating if this favorite definition is owned + by a specific user or is shared between all users with access to the + Application Insights component. Possible values include: 'shared', 'user' + :type favorite_type: str or + ~azure.mgmt.applicationinsights.models.FavoriteType + :param source_type: The source of the favorite definition. + :type source_type: str + :ivar time_modified: Date and time in UTC of the last modification that + was made to this favorite definition. + :vartype time_modified: str + :param tags: A list of 0 or more tags that are associated with this + favorite definition + :type tags: list[str] + :param category: Favorite category, as defined by the user at creation + time. + :type category: str + :param is_generated_from_template: Flag denoting wether or not this + favorite was generated from a template. + :type is_generated_from_template: bool + :ivar user_id: Unique user id of the specific user that owns this + favorite. + :vartype user_id: str + """ + + _validation = { + 'favorite_id': {'readonly': True}, + 'time_modified': {'readonly': True}, + 'user_id': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'config': {'key': 'Config', 'type': 'str'}, + 'version': {'key': 'Version', 'type': 'str'}, + 'favorite_id': {'key': 'FavoriteId', 'type': 'str'}, + 'favorite_type': {'key': 'FavoriteType', 'type': 'FavoriteType'}, + 'source_type': {'key': 'SourceType', 'type': 'str'}, + 'time_modified': {'key': 'TimeModified', 'type': 'str'}, + 'tags': {'key': 'Tags', 'type': '[str]'}, + 'category': {'key': 'Category', 'type': 'str'}, + 'is_generated_from_template': {'key': 'IsGeneratedFromTemplate', 'type': 'bool'}, + 'user_id': {'key': 'UserId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentFavorite, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.config = kwargs.get('config', None) + self.version = kwargs.get('version', None) + self.favorite_id = None + self.favorite_type = kwargs.get('favorite_type', None) + self.source_type = kwargs.get('source_type', None) + self.time_modified = None + self.tags = kwargs.get('tags', None) + self.category = kwargs.get('category', None) + self.is_generated_from_template = kwargs.get('is_generated_from_template', None) + self.user_id = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_favorite_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_favorite_py3.py new file mode 100644 index 000000000000..e259c7974f11 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_favorite_py3.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentFavorite(Model): + """Properties that define a favorite that is associated to an Application + Insights component. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: The user-defined name of the favorite. + :type name: str + :param config: Configuration of this particular favorite, which are driven + by the Azure portal UX. Configuration data is a string containing valid + JSON + :type config: str + :param version: This instance's version of the data model. This can change + as new features are added that can be marked favorite. Current examples + include MetricsExplorer (ME) and Search. + :type version: str + :ivar favorite_id: Internally assigned unique id of the favorite + definition. + :vartype favorite_id: str + :param favorite_type: Enum indicating if this favorite definition is owned + by a specific user or is shared between all users with access to the + Application Insights component. Possible values include: 'shared', 'user' + :type favorite_type: str or + ~azure.mgmt.applicationinsights.models.FavoriteType + :param source_type: The source of the favorite definition. + :type source_type: str + :ivar time_modified: Date and time in UTC of the last modification that + was made to this favorite definition. + :vartype time_modified: str + :param tags: A list of 0 or more tags that are associated with this + favorite definition + :type tags: list[str] + :param category: Favorite category, as defined by the user at creation + time. + :type category: str + :param is_generated_from_template: Flag denoting wether or not this + favorite was generated from a template. + :type is_generated_from_template: bool + :ivar user_id: Unique user id of the specific user that owns this + favorite. + :vartype user_id: str + """ + + _validation = { + 'favorite_id': {'readonly': True}, + 'time_modified': {'readonly': True}, + 'user_id': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'config': {'key': 'Config', 'type': 'str'}, + 'version': {'key': 'Version', 'type': 'str'}, + 'favorite_id': {'key': 'FavoriteId', 'type': 'str'}, + 'favorite_type': {'key': 'FavoriteType', 'type': 'FavoriteType'}, + 'source_type': {'key': 'SourceType', 'type': 'str'}, + 'time_modified': {'key': 'TimeModified', 'type': 'str'}, + 'tags': {'key': 'Tags', 'type': '[str]'}, + 'category': {'key': 'Category', 'type': 'str'}, + 'is_generated_from_template': {'key': 'IsGeneratedFromTemplate', 'type': 'bool'}, + 'user_id': {'key': 'UserId', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, config: str=None, version: str=None, favorite_type=None, source_type: str=None, tags=None, category: str=None, is_generated_from_template: bool=None, **kwargs) -> None: + super(ApplicationInsightsComponentFavorite, self).__init__(**kwargs) + self.name = name + self.config = config + self.version = version + self.favorite_id = None + self.favorite_type = favorite_type + self.source_type = source_type + self.time_modified = None + self.tags = tags + self.category = category + self.is_generated_from_template = is_generated_from_template + self.user_id = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature.py new file mode 100644 index 000000000000..88d9c54730be --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentFeature(Model): + """An Application Insights component daily data volume cap status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar feature_name: The pricing feature name. + :vartype feature_name: str + :ivar meter_id: The meter id used for the feature. + :vartype meter_id: str + :ivar meter_rate_frequency: The meter rate for the feature's meter. + :vartype meter_rate_frequency: str + :ivar resouce_id: Reserved, not used now. + :vartype resouce_id: str + :ivar is_hidden: Reserved, not used now. + :vartype is_hidden: bool + :ivar capabilities: A list of Application Insights component feature + capability. + :vartype capabilities: + list[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFeatureCapability] + :ivar title: Display name of the feature. + :vartype title: str + :ivar is_main_feature: Whether can apply addon feature on to it. + :vartype is_main_feature: bool + :ivar supported_addon_features: The add on features on main feature. + :vartype supported_addon_features: str + """ + + _validation = { + 'feature_name': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'meter_rate_frequency': {'readonly': True}, + 'resouce_id': {'readonly': True}, + 'is_hidden': {'readonly': True}, + 'capabilities': {'readonly': True}, + 'title': {'readonly': True}, + 'is_main_feature': {'readonly': True}, + 'supported_addon_features': {'readonly': True}, + } + + _attribute_map = { + 'feature_name': {'key': 'FeatureName', 'type': 'str'}, + 'meter_id': {'key': 'MeterId', 'type': 'str'}, + 'meter_rate_frequency': {'key': 'MeterRateFrequency', 'type': 'str'}, + 'resouce_id': {'key': 'ResouceId', 'type': 'str'}, + 'is_hidden': {'key': 'IsHidden', 'type': 'bool'}, + 'capabilities': {'key': 'Capabilities', 'type': '[ApplicationInsightsComponentFeatureCapability]'}, + 'title': {'key': 'Title', 'type': 'str'}, + 'is_main_feature': {'key': 'IsMainFeature', 'type': 'bool'}, + 'supported_addon_features': {'key': 'SupportedAddonFeatures', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentFeature, self).__init__(**kwargs) + self.feature_name = None + self.meter_id = None + self.meter_rate_frequency = None + self.resouce_id = None + self.is_hidden = None + self.capabilities = None + self.title = None + self.is_main_feature = None + self.supported_addon_features = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capabilities.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capabilities.py new file mode 100644 index 000000000000..7207366358e1 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capabilities.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentFeatureCapabilities(Model): + """An Application Insights component feature capabilities. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar support_export_data: Whether allow to use continuous export feature. + :vartype support_export_data: bool + :ivar burst_throttle_policy: Reserved, not used now. + :vartype burst_throttle_policy: str + :ivar metadata_class: Reserved, not used now. + :vartype metadata_class: str + :ivar live_stream_metrics: Reserved, not used now. + :vartype live_stream_metrics: bool + :ivar application_map: Reserved, not used now. + :vartype application_map: bool + :ivar work_item_integration: Whether allow to use work item integration + feature. + :vartype work_item_integration: bool + :ivar power_bi_integration: Reserved, not used now. + :vartype power_bi_integration: bool + :ivar open_schema: Reserved, not used now. + :vartype open_schema: bool + :ivar proactive_detection: Reserved, not used now. + :vartype proactive_detection: bool + :ivar analytics_integration: Reserved, not used now. + :vartype analytics_integration: bool + :ivar multiple_step_web_test: Whether allow to use multiple steps web test + feature. + :vartype multiple_step_web_test: bool + :ivar api_access_level: Reserved, not used now. + :vartype api_access_level: str + :ivar tracking_type: The application insights component used tracking + type. + :vartype tracking_type: str + :ivar daily_cap: Daily data volume cap in GB. + :vartype daily_cap: float + :ivar daily_cap_reset_time: Daily data volume cap UTC reset hour. + :vartype daily_cap_reset_time: float + :ivar throttle_rate: Reserved, not used now. + :vartype throttle_rate: float + """ + + _validation = { + 'support_export_data': {'readonly': True}, + 'burst_throttle_policy': {'readonly': True}, + 'metadata_class': {'readonly': True}, + 'live_stream_metrics': {'readonly': True}, + 'application_map': {'readonly': True}, + 'work_item_integration': {'readonly': True}, + 'power_bi_integration': {'readonly': True}, + 'open_schema': {'readonly': True}, + 'proactive_detection': {'readonly': True}, + 'analytics_integration': {'readonly': True}, + 'multiple_step_web_test': {'readonly': True}, + 'api_access_level': {'readonly': True}, + 'tracking_type': {'readonly': True}, + 'daily_cap': {'readonly': True}, + 'daily_cap_reset_time': {'readonly': True}, + 'throttle_rate': {'readonly': True}, + } + + _attribute_map = { + 'support_export_data': {'key': 'SupportExportData', 'type': 'bool'}, + 'burst_throttle_policy': {'key': 'BurstThrottlePolicy', 'type': 'str'}, + 'metadata_class': {'key': 'MetadataClass', 'type': 'str'}, + 'live_stream_metrics': {'key': 'LiveStreamMetrics', 'type': 'bool'}, + 'application_map': {'key': 'ApplicationMap', 'type': 'bool'}, + 'work_item_integration': {'key': 'WorkItemIntegration', 'type': 'bool'}, + 'power_bi_integration': {'key': 'PowerBIIntegration', 'type': 'bool'}, + 'open_schema': {'key': 'OpenSchema', 'type': 'bool'}, + 'proactive_detection': {'key': 'ProactiveDetection', 'type': 'bool'}, + 'analytics_integration': {'key': 'AnalyticsIntegration', 'type': 'bool'}, + 'multiple_step_web_test': {'key': 'MultipleStepWebTest', 'type': 'bool'}, + 'api_access_level': {'key': 'ApiAccessLevel', 'type': 'str'}, + 'tracking_type': {'key': 'TrackingType', 'type': 'str'}, + 'daily_cap': {'key': 'DailyCap', 'type': 'float'}, + 'daily_cap_reset_time': {'key': 'DailyCapResetTime', 'type': 'float'}, + 'throttle_rate': {'key': 'ThrottleRate', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentFeatureCapabilities, self).__init__(**kwargs) + self.support_export_data = None + self.burst_throttle_policy = None + self.metadata_class = None + self.live_stream_metrics = None + self.application_map = None + self.work_item_integration = None + self.power_bi_integration = None + self.open_schema = None + self.proactive_detection = None + self.analytics_integration = None + self.multiple_step_web_test = None + self.api_access_level = None + self.tracking_type = None + self.daily_cap = None + self.daily_cap_reset_time = None + self.throttle_rate = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capabilities_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capabilities_py3.py new file mode 100644 index 000000000000..80cd00e62901 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capabilities_py3.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentFeatureCapabilities(Model): + """An Application Insights component feature capabilities. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar support_export_data: Whether allow to use continuous export feature. + :vartype support_export_data: bool + :ivar burst_throttle_policy: Reserved, not used now. + :vartype burst_throttle_policy: str + :ivar metadata_class: Reserved, not used now. + :vartype metadata_class: str + :ivar live_stream_metrics: Reserved, not used now. + :vartype live_stream_metrics: bool + :ivar application_map: Reserved, not used now. + :vartype application_map: bool + :ivar work_item_integration: Whether allow to use work item integration + feature. + :vartype work_item_integration: bool + :ivar power_bi_integration: Reserved, not used now. + :vartype power_bi_integration: bool + :ivar open_schema: Reserved, not used now. + :vartype open_schema: bool + :ivar proactive_detection: Reserved, not used now. + :vartype proactive_detection: bool + :ivar analytics_integration: Reserved, not used now. + :vartype analytics_integration: bool + :ivar multiple_step_web_test: Whether allow to use multiple steps web test + feature. + :vartype multiple_step_web_test: bool + :ivar api_access_level: Reserved, not used now. + :vartype api_access_level: str + :ivar tracking_type: The application insights component used tracking + type. + :vartype tracking_type: str + :ivar daily_cap: Daily data volume cap in GB. + :vartype daily_cap: float + :ivar daily_cap_reset_time: Daily data volume cap UTC reset hour. + :vartype daily_cap_reset_time: float + :ivar throttle_rate: Reserved, not used now. + :vartype throttle_rate: float + """ + + _validation = { + 'support_export_data': {'readonly': True}, + 'burst_throttle_policy': {'readonly': True}, + 'metadata_class': {'readonly': True}, + 'live_stream_metrics': {'readonly': True}, + 'application_map': {'readonly': True}, + 'work_item_integration': {'readonly': True}, + 'power_bi_integration': {'readonly': True}, + 'open_schema': {'readonly': True}, + 'proactive_detection': {'readonly': True}, + 'analytics_integration': {'readonly': True}, + 'multiple_step_web_test': {'readonly': True}, + 'api_access_level': {'readonly': True}, + 'tracking_type': {'readonly': True}, + 'daily_cap': {'readonly': True}, + 'daily_cap_reset_time': {'readonly': True}, + 'throttle_rate': {'readonly': True}, + } + + _attribute_map = { + 'support_export_data': {'key': 'SupportExportData', 'type': 'bool'}, + 'burst_throttle_policy': {'key': 'BurstThrottlePolicy', 'type': 'str'}, + 'metadata_class': {'key': 'MetadataClass', 'type': 'str'}, + 'live_stream_metrics': {'key': 'LiveStreamMetrics', 'type': 'bool'}, + 'application_map': {'key': 'ApplicationMap', 'type': 'bool'}, + 'work_item_integration': {'key': 'WorkItemIntegration', 'type': 'bool'}, + 'power_bi_integration': {'key': 'PowerBIIntegration', 'type': 'bool'}, + 'open_schema': {'key': 'OpenSchema', 'type': 'bool'}, + 'proactive_detection': {'key': 'ProactiveDetection', 'type': 'bool'}, + 'analytics_integration': {'key': 'AnalyticsIntegration', 'type': 'bool'}, + 'multiple_step_web_test': {'key': 'MultipleStepWebTest', 'type': 'bool'}, + 'api_access_level': {'key': 'ApiAccessLevel', 'type': 'str'}, + 'tracking_type': {'key': 'TrackingType', 'type': 'str'}, + 'daily_cap': {'key': 'DailyCap', 'type': 'float'}, + 'daily_cap_reset_time': {'key': 'DailyCapResetTime', 'type': 'float'}, + 'throttle_rate': {'key': 'ThrottleRate', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(ApplicationInsightsComponentFeatureCapabilities, self).__init__(**kwargs) + self.support_export_data = None + self.burst_throttle_policy = None + self.metadata_class = None + self.live_stream_metrics = None + self.application_map = None + self.work_item_integration = None + self.power_bi_integration = None + self.open_schema = None + self.proactive_detection = None + self.analytics_integration = None + self.multiple_step_web_test = None + self.api_access_level = None + self.tracking_type = None + self.daily_cap = None + self.daily_cap_reset_time = None + self.throttle_rate = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capability.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capability.py new file mode 100644 index 000000000000..eb5a4cee5c28 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capability.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentFeatureCapability(Model): + """An Application Insights component feature capability. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the capability. + :vartype name: str + :ivar description: The description of the capability. + :vartype description: str + :ivar value: The value of the capability. + :vartype value: str + :ivar unit: The unit of the capability. + :vartype unit: str + :ivar meter_id: The meter used for the capability. + :vartype meter_id: str + :ivar meter_rate_frequency: The meter rate of the meter. + :vartype meter_rate_frequency: str + """ + + _validation = { + 'name': {'readonly': True}, + 'description': {'readonly': True}, + 'value': {'readonly': True}, + 'unit': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'meter_rate_frequency': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'description': {'key': 'Description', 'type': 'str'}, + 'value': {'key': 'Value', 'type': 'str'}, + 'unit': {'key': 'Unit', 'type': 'str'}, + 'meter_id': {'key': 'MeterId', 'type': 'str'}, + 'meter_rate_frequency': {'key': 'MeterRateFrequency', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentFeatureCapability, self).__init__(**kwargs) + self.name = None + self.description = None + self.value = None + self.unit = None + self.meter_id = None + self.meter_rate_frequency = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capability_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capability_py3.py new file mode 100644 index 000000000000..e301012a6694 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capability_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentFeatureCapability(Model): + """An Application Insights component feature capability. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the capability. + :vartype name: str + :ivar description: The description of the capability. + :vartype description: str + :ivar value: The value of the capability. + :vartype value: str + :ivar unit: The unit of the capability. + :vartype unit: str + :ivar meter_id: The meter used for the capability. + :vartype meter_id: str + :ivar meter_rate_frequency: The meter rate of the meter. + :vartype meter_rate_frequency: str + """ + + _validation = { + 'name': {'readonly': True}, + 'description': {'readonly': True}, + 'value': {'readonly': True}, + 'unit': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'meter_rate_frequency': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'description': {'key': 'Description', 'type': 'str'}, + 'value': {'key': 'Value', 'type': 'str'}, + 'unit': {'key': 'Unit', 'type': 'str'}, + 'meter_id': {'key': 'MeterId', 'type': 'str'}, + 'meter_rate_frequency': {'key': 'MeterRateFrequency', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ApplicationInsightsComponentFeatureCapability, self).__init__(**kwargs) + self.name = None + self.description = None + self.value = None + self.unit = None + self.meter_id = None + self.meter_rate_frequency = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_py3.py new file mode 100644 index 000000000000..1df9aee5e940 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_py3.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentFeature(Model): + """An Application Insights component daily data volume cap status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar feature_name: The pricing feature name. + :vartype feature_name: str + :ivar meter_id: The meter id used for the feature. + :vartype meter_id: str + :ivar meter_rate_frequency: The meter rate for the feature's meter. + :vartype meter_rate_frequency: str + :ivar resouce_id: Reserved, not used now. + :vartype resouce_id: str + :ivar is_hidden: Reserved, not used now. + :vartype is_hidden: bool + :ivar capabilities: A list of Application Insights component feature + capability. + :vartype capabilities: + list[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFeatureCapability] + :ivar title: Display name of the feature. + :vartype title: str + :ivar is_main_feature: Whether can apply addon feature on to it. + :vartype is_main_feature: bool + :ivar supported_addon_features: The add on features on main feature. + :vartype supported_addon_features: str + """ + + _validation = { + 'feature_name': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'meter_rate_frequency': {'readonly': True}, + 'resouce_id': {'readonly': True}, + 'is_hidden': {'readonly': True}, + 'capabilities': {'readonly': True}, + 'title': {'readonly': True}, + 'is_main_feature': {'readonly': True}, + 'supported_addon_features': {'readonly': True}, + } + + _attribute_map = { + 'feature_name': {'key': 'FeatureName', 'type': 'str'}, + 'meter_id': {'key': 'MeterId', 'type': 'str'}, + 'meter_rate_frequency': {'key': 'MeterRateFrequency', 'type': 'str'}, + 'resouce_id': {'key': 'ResouceId', 'type': 'str'}, + 'is_hidden': {'key': 'IsHidden', 'type': 'bool'}, + 'capabilities': {'key': 'Capabilities', 'type': '[ApplicationInsightsComponentFeatureCapability]'}, + 'title': {'key': 'Title', 'type': 'str'}, + 'is_main_feature': {'key': 'IsMainFeature', 'type': 'bool'}, + 'supported_addon_features': {'key': 'SupportedAddonFeatures', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ApplicationInsightsComponentFeature, self).__init__(**kwargs) + self.feature_name = None + self.meter_id = None + self.meter_rate_frequency = None + self.resouce_id = None + self.is_hidden = None + self.capabilities = None + self.title = None + self.is_main_feature = None + self.supported_addon_features = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration.py index 14734b3c0f68..355e6bf6014a 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration.py @@ -42,11 +42,11 @@ class ApplicationInsightsComponentProactiveDetectionConfiguration(Model): 'rule_definitions': {'key': 'RuleDefinitions', 'type': 'ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions'}, } - def __init__(self, name=None, enabled=None, send_emails_to_subscription_owners=None, custom_emails=None, last_updated_time=None, rule_definitions=None): - super(ApplicationInsightsComponentProactiveDetectionConfiguration, self).__init__() - self.name = name - self.enabled = enabled - self.send_emails_to_subscription_owners = send_emails_to_subscription_owners - self.custom_emails = custom_emails - self.last_updated_time = last_updated_time - self.rule_definitions = rule_definitions + def __init__(self, **kwargs): + super(ApplicationInsightsComponentProactiveDetectionConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.enabled = kwargs.get('enabled', None) + self.send_emails_to_subscription_owners = kwargs.get('send_emails_to_subscription_owners', None) + self.custom_emails = kwargs.get('custom_emails', None) + self.last_updated_time = kwargs.get('last_updated_time', None) + self.rule_definitions = kwargs.get('rule_definitions', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration_py3.py new file mode 100644 index 000000000000..9dd76e067641 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration_py3.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.serialization import Model + + +class ApplicationInsightsComponentProactiveDetectionConfiguration(Model): + """Properties that define a ProactiveDetection configuration. + + :param name: The rule name + :type name: str + :param enabled: A flag that indicates whether this rule is enabled by the + user + :type enabled: bool + :param send_emails_to_subscription_owners: A flag that indicated whether + notifications on this rule should be sent to subscription owners + :type send_emails_to_subscription_owners: bool + :param custom_emails: Custom email addresses for this rule notifications + :type custom_emails: list[str] + :param last_updated_time: The last time this rule was updated + :type last_updated_time: str + :param rule_definitions: Static definitions of the ProactiveDetection + configuration rule (same values for all components). + :type rule_definitions: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions + """ + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'enabled': {'key': 'Enabled', 'type': 'bool'}, + 'send_emails_to_subscription_owners': {'key': 'SendEmailsToSubscriptionOwners', 'type': 'bool'}, + 'custom_emails': {'key': 'CustomEmails', 'type': '[str]'}, + 'last_updated_time': {'key': 'LastUpdatedTime', 'type': 'str'}, + 'rule_definitions': {'key': 'RuleDefinitions', 'type': 'ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions'}, + } + + def __init__(self, *, name: str=None, enabled: bool=None, send_emails_to_subscription_owners: bool=None, custom_emails=None, last_updated_time: str=None, rule_definitions=None, **kwargs) -> None: + super(ApplicationInsightsComponentProactiveDetectionConfiguration, self).__init__(**kwargs) + self.name = name + self.enabled = enabled + self.send_emails_to_subscription_owners = send_emails_to_subscription_owners + self.custom_emails = custom_emails + self.last_updated_time = last_updated_time + self.rule_definitions = rule_definitions diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration_rule_definitions.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration_rule_definitions.py index 8fafb0a49a27..c555ca273c51 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration_rule_definitions.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration_rule_definitions.py @@ -22,7 +22,7 @@ class ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions :type display_name: str :param description: The rule description :type description: str - :param help_url: URL which displays aditional info about the proactive + :param help_url: URL which displays additional info about the proactive detection rule :type help_url: str :param is_hidden: A flag indicating whether the rule is hidden (from the @@ -49,13 +49,13 @@ class ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions 'supports_email_notifications': {'key': 'SupportsEmailNotifications', 'type': 'bool'}, } - def __init__(self, name=None, display_name=None, description=None, help_url=None, is_hidden=None, is_enabled_by_default=None, is_in_preview=None, supports_email_notifications=None): - super(ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions, self).__init__() - self.name = name - self.display_name = display_name - self.description = description - self.help_url = help_url - self.is_hidden = is_hidden - self.is_enabled_by_default = is_enabled_by_default - self.is_in_preview = is_in_preview - self.supports_email_notifications = supports_email_notifications + def __init__(self, **kwargs): + super(ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.help_url = kwargs.get('help_url', None) + self.is_hidden = kwargs.get('is_hidden', None) + self.is_enabled_by_default = kwargs.get('is_enabled_by_default', None) + self.is_in_preview = kwargs.get('is_in_preview', None) + self.supports_email_notifications = kwargs.get('supports_email_notifications', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration_rule_definitions_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration_rule_definitions_py3.py new file mode 100644 index 000000000000..f10a49b01c1c --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration_rule_definitions_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions(Model): + """Static definitions of the ProactiveDetection configuration rule (same + values for all components). + + :param name: The rule name + :type name: str + :param display_name: The rule name as it is displayed in UI + :type display_name: str + :param description: The rule description + :type description: str + :param help_url: URL which displays additional info about the proactive + detection rule + :type help_url: str + :param is_hidden: A flag indicating whether the rule is hidden (from the + UI) + :type is_hidden: bool + :param is_enabled_by_default: A flag indicating whether the rule is + enabled by default + :type is_enabled_by_default: bool + :param is_in_preview: A flag indicating whether the rule is in preview + :type is_in_preview: bool + :param supports_email_notifications: A flag indicating whether email + notifications are supported for detections for this rule + :type supports_email_notifications: bool + """ + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'display_name': {'key': 'DisplayName', 'type': 'str'}, + 'description': {'key': 'Description', 'type': 'str'}, + 'help_url': {'key': 'HelpUrl', 'type': 'str'}, + 'is_hidden': {'key': 'IsHidden', 'type': 'bool'}, + 'is_enabled_by_default': {'key': 'IsEnabledByDefault', 'type': 'bool'}, + 'is_in_preview': {'key': 'IsInPreview', 'type': 'bool'}, + 'supports_email_notifications': {'key': 'SupportsEmailNotifications', 'type': 'bool'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, description: str=None, help_url: str=None, is_hidden: bool=None, is_enabled_by_default: bool=None, is_in_preview: bool=None, supports_email_notifications: bool=None, **kwargs) -> None: + super(ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.description = description + self.help_url = help_url + self.is_hidden = is_hidden + self.is_enabled_by_default = is_enabled_by_default + self.is_in_preview = is_in_preview + self.supports_email_notifications = supports_email_notifications diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_py3.py new file mode 100644 index 000000000000..30a77745810b --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_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 .components_resource_py3 import ComponentsResource + + +class ApplicationInsightsComponent(ComponentsResource): + """An Application Insights component 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. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: Required. The kind of application that this component refers + 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 + :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 + :param application_type: Required. Type of application being monitored. + Possible values include: 'web', 'other'. Default value: "web" . + :type application_type: str or + ~azure.mgmt.applicationinsights.models.ApplicationType + :param flow_type: Used by the Application Insights system to determine + what kind of flow this component was created by. This is to be set to + 'Bluefield' when creating/updating a component via the REST API. Possible + values include: 'Bluefield'. Default value: "Bluefield" . + :type flow_type: str or ~azure.mgmt.applicationinsights.models.FlowType + :param request_source: Describes what tool created this Application + Insights component. Customers using this API should set this to the + default 'rest'. Possible values include: 'rest'. Default value: "rest" . + :type request_source: str or + ~azure.mgmt.applicationinsights.models.RequestSource + :ivar instrumentation_key: Application Insights Instrumentation key. A + read-only value that applications can use to identify the destination for + all telemetry sent to Azure Application Insights. This value will be + supplied upon construction of each new Application Insights component. + :vartype instrumentation_key: str + :ivar creation_date: Creation Date for the Application Insights component, + in ISO 8601 format. + :vartype creation_date: datetime + :ivar tenant_id: Azure Tenant Id. + :vartype tenant_id: str + :param hockey_app_id: The unique application ID created when a new + application is added to HockeyApp, used for communications with HockeyApp. + :type hockey_app_id: str + :ivar hockey_app_token: Token used to authenticate communications with + between Application Insights and HockeyApp. + :vartype hockey_app_token: str + :ivar provisioning_state: Current state of this component: whether or not + is has been provisioned within the resource group it is defined. Users + cannot change this value but are able to read from it. Values will include + Succeeded, Deploying, Canceled, and Failed. + :vartype provisioning_state: str + :param sampling_percentage: Percentage of the data produced by the + application being monitored that is being sampled for Application Insights + telemetry. + :type sampling_percentage: float + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + 'application_id': {'readonly': True}, + 'app_id': {'readonly': True}, + 'application_type': {'required': True}, + 'instrumentation_key': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'hockey_app_token': {'readonly': True}, + 'provisioning_state': {'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'}, + 'application_id': {'key': 'properties.ApplicationId', 'type': 'str'}, + 'app_id': {'key': 'properties.AppId', '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'}, + 'instrumentation_key': {'key': 'properties.InstrumentationKey', 'type': 'str'}, + 'creation_date': {'key': 'properties.CreationDate', 'type': 'iso-8601'}, + 'tenant_id': {'key': 'properties.TenantId', 'type': 'str'}, + 'hockey_app_id': {'key': 'properties.HockeyAppId', 'type': 'str'}, + 'hockey_app_token': {'key': 'properties.HockeyAppToken', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sampling_percentage': {'key': 'properties.SamplingPercentage', 'type': 'float'}, + } + + 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, **kwargs) -> None: + super(ApplicationInsightsComponent, self).__init__(location=location, tags=tags, **kwargs) + self.kind = kind + self.application_id = None + self.app_id = None + self.application_type = application_type + self.flow_type = flow_type + self.request_source = request_source + self.instrumentation_key = None + self.creation_date = None + self.tenant_id = None + self.hockey_app_id = hockey_app_id + self.hockey_app_token = None + self.provisioning_state = None + self.sampling_percentage = sampling_percentage diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_quota_status.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_quota_status.py index 6b559a500614..3d9ad05948f1 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_quota_status.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_quota_status.py @@ -40,8 +40,8 @@ class ApplicationInsightsComponentQuotaStatus(Model): 'expiration_time': {'key': 'ExpirationTime', 'type': 'str'}, } - def __init__(self): - super(ApplicationInsightsComponentQuotaStatus, self).__init__() + def __init__(self, **kwargs): + super(ApplicationInsightsComponentQuotaStatus, self).__init__(**kwargs) self.app_id = None self.should_be_throttled = None self.expiration_time = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_quota_status_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_quota_status_py3.py new file mode 100644 index 000000000000..19d10c0dd902 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_quota_status_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentQuotaStatus(Model): + """An Application Insights component daily data volume cap status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar app_id: The Application ID for the Application Insights component. + :vartype app_id: str + :ivar should_be_throttled: The daily data volume cap is met, and data + ingestion will be stopped. + :vartype should_be_throttled: bool + :ivar expiration_time: Date and time when the daily data volume cap will + be reset, and data ingestion will resume. + :vartype expiration_time: str + """ + + _validation = { + 'app_id': {'readonly': True}, + 'should_be_throttled': {'readonly': True}, + 'expiration_time': {'readonly': True}, + } + + _attribute_map = { + 'app_id': {'key': 'AppId', 'type': 'str'}, + 'should_be_throttled': {'key': 'ShouldBeThrottled', 'type': 'bool'}, + 'expiration_time': {'key': 'ExpirationTime', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ApplicationInsightsComponentQuotaStatus, self).__init__(**kwargs) + self.app_id = None + self.should_be_throttled = None + self.expiration_time = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_web_test_location.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_web_test_location.py new file mode 100644 index 000000000000..f58dd82e7eb2 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_web_test_location.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentWebTestLocation(Model): + """Properties that define a web test location available to an Application + Insights Component. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar display_name: The display name of the web test location. + :vartype display_name: str + :ivar tag: Internally defined geographic location tag. + :vartype tag: str + """ + + _validation = { + 'display_name': {'readonly': True}, + 'tag': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'DisplayName', 'type': 'str'}, + 'tag': {'key': 'Tag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentWebTestLocation, self).__init__(**kwargs) + self.display_name = None + self.tag = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_web_test_location_paged.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_web_test_location_paged.py new file mode 100644 index 000000000000..7cfba600f3f5 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_web_test_location_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ApplicationInsightsComponentWebTestLocationPaged(Paged): + """ + A paging container for iterating over a list of :class:`ApplicationInsightsComponentWebTestLocation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ApplicationInsightsComponentWebTestLocation]'} + } + + def __init__(self, *args, **kwargs): + + super(ApplicationInsightsComponentWebTestLocationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_web_test_location_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_web_test_location_py3.py new file mode 100644 index 000000000000..408b28928111 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_web_test_location_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentWebTestLocation(Model): + """Properties that define a web test location available to an Application + Insights Component. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar display_name: The display name of the web test location. + :vartype display_name: str + :ivar tag: Internally defined geographic location tag. + :vartype tag: str + """ + + _validation = { + 'display_name': {'readonly': True}, + 'tag': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'DisplayName', 'type': 'str'}, + 'tag': {'key': 'Tag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ApplicationInsightsComponentWebTestLocation, self).__init__(**kwargs) + self.display_name = None + self.tag = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_management_client_enums.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_management_client_enums.py index fdb344ca6bf3..1c2f9886c302 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_management_client_enums.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_management_client_enums.py @@ -12,23 +12,90 @@ from enum import Enum -class ApplicationType(Enum): +class ApplicationType(str, Enum): web = "web" other = "other" -class FlowType(Enum): +class FlowType(str, Enum): bluefield = "Bluefield" -class RequestSource(Enum): +class RequestSource(str, Enum): rest = "rest" -class WebTestKind(Enum): +class PurgeState(str, Enum): + + pending = "pending" + completed = "completed" + + +class FavoriteType(str, Enum): + + shared = "shared" + user = "user" + + +class WebTestKind(str, Enum): ping = "ping" multistep = "multistep" + + +class ItemScope(str, Enum): + + shared = "shared" + user = "user" + + +class ItemType(str, Enum): + + query = "query" + function = "function" + folder = "folder" + recent = "recent" + + +class SharedTypeKind(str, Enum): + + user = "user" + shared = "shared" + + +class FavoriteSourceType(str, Enum): + + retention = "retention" + notebook = "notebook" + sessions = "sessions" + events = "events" + userflows = "userflows" + funnel = "funnel" + impact = "impact" + segmentation = "segmentation" + + +class ItemScopePath(str, Enum): + + analytics_items = "analyticsItems" + myanalytics_items = "myanalyticsItems" + + +class ItemTypeParameter(str, Enum): + + none = "none" + query = "query" + function = "function" + folder = "folder" + recent = "recent" + + +class CategoryType(str, Enum): + + workbook = "workbook" + tsg = "TSG" + performance = "performance" + retention = "retention" diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_body.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body.py similarity index 83% rename from azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_body.py rename to azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body.py index 8b5c2ccb6aa9..90a0be9c9bfa 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_body.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body.py @@ -12,8 +12,8 @@ from msrest.serialization import Model -class WorkspacePurgeBody(Model): - """Describes the body of a purge request for an App Insights Workspace. +class ComponentPurgeBody(Model): + """Describes the body of a purge request for an App Insights component. All required parameters must be populated in order to send to Azure. @@ -22,7 +22,7 @@ class WorkspacePurgeBody(Model): :param filters: Required. The set of columns and filters (queries) to run over them to purge the resulting data. :type filters: - list[~azure.mgmt.loganalytics.models.WorkspacePurgeBodyFilters] + list[~azure.mgmt.applicationinsights.models.ComponentPurgeBodyFilters] """ _validation = { @@ -32,10 +32,10 @@ class WorkspacePurgeBody(Model): _attribute_map = { 'table': {'key': 'table', 'type': 'str'}, - 'filters': {'key': 'filters', 'type': '[WorkspacePurgeBodyFilters]'}, + 'filters': {'key': 'filters', 'type': '[ComponentPurgeBodyFilters]'}, } def __init__(self, **kwargs): - super(WorkspacePurgeBody, self).__init__(**kwargs) + super(ComponentPurgeBody, self).__init__(**kwargs) self.table = kwargs.get('table', None) self.filters = kwargs.get('filters', None) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_body_filters.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body_filters.py similarity index 74% rename from azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_body_filters.py rename to azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body_filters.py index 0a9672178f6a..a79d73f55d46 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_body_filters.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body_filters.py @@ -12,29 +12,35 @@ from msrest.serialization import Model -class WorkspacePurgeBodyFilters(Model): +class ComponentPurgeBodyFilters(Model): """User-defined filters to return data which will be purged from the table. :param column: The column of the table over which the given query should run :type column: str :param operator: A query operator to evaluate over the provided column and - value(s). + value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, + and have the same behavior as they would in a KQL query. :type operator: str :param value: the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of values. :type value: object + :param key: When filtering over custom dimensions, this key will be used + as the name of the custom dimension. + :type key: str """ _attribute_map = { 'column': {'key': 'column', 'type': 'str'}, 'operator': {'key': 'operator', 'type': 'str'}, 'value': {'key': 'value', 'type': 'object'}, + 'key': {'key': 'key', 'type': 'str'}, } def __init__(self, **kwargs): - super(WorkspacePurgeBodyFilters, self).__init__(**kwargs) + super(ComponentPurgeBodyFilters, self).__init__(**kwargs) self.column = kwargs.get('column', None) self.operator = kwargs.get('operator', None) self.value = kwargs.get('value', None) + self.key = kwargs.get('key', None) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_body_filters_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body_filters_py3.py similarity index 73% rename from azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_body_filters_py3.py rename to azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body_filters_py3.py index e5813d8d8c71..9a079b753f96 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_body_filters_py3.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body_filters_py3.py @@ -12,29 +12,35 @@ from msrest.serialization import Model -class WorkspacePurgeBodyFilters(Model): +class ComponentPurgeBodyFilters(Model): """User-defined filters to return data which will be purged from the table. :param column: The column of the table over which the given query should run :type column: str :param operator: A query operator to evaluate over the provided column and - value(s). + value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, + and have the same behavior as they would in a KQL query. :type operator: str :param value: the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of values. :type value: object + :param key: When filtering over custom dimensions, this key will be used + as the name of the custom dimension. + :type key: str """ _attribute_map = { 'column': {'key': 'column', 'type': 'str'}, 'operator': {'key': 'operator', 'type': 'str'}, 'value': {'key': 'value', 'type': 'object'}, + 'key': {'key': 'key', 'type': 'str'}, } - def __init__(self, *, column: str=None, operator: str=None, value=None, **kwargs) -> None: - super(WorkspacePurgeBodyFilters, self).__init__(**kwargs) + def __init__(self, *, column: str=None, operator: str=None, value=None, key: str=None, **kwargs) -> None: + super(ComponentPurgeBodyFilters, self).__init__(**kwargs) self.column = column self.operator = operator self.value = value + self.key = key diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_body_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body_py3.py similarity index 83% rename from azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_body_py3.py rename to azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body_py3.py index 5112daee22c5..d5dae00d2c93 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_body_py3.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body_py3.py @@ -12,8 +12,8 @@ from msrest.serialization import Model -class WorkspacePurgeBody(Model): - """Describes the body of a purge request for an App Insights Workspace. +class ComponentPurgeBody(Model): + """Describes the body of a purge request for an App Insights component. All required parameters must be populated in order to send to Azure. @@ -22,7 +22,7 @@ class WorkspacePurgeBody(Model): :param filters: Required. The set of columns and filters (queries) to run over them to purge the resulting data. :type filters: - list[~azure.mgmt.loganalytics.models.WorkspacePurgeBodyFilters] + list[~azure.mgmt.applicationinsights.models.ComponentPurgeBodyFilters] """ _validation = { @@ -32,10 +32,10 @@ class WorkspacePurgeBody(Model): _attribute_map = { 'table': {'key': 'table', 'type': 'str'}, - 'filters': {'key': 'filters', 'type': '[WorkspacePurgeBodyFilters]'}, + 'filters': {'key': 'filters', 'type': '[ComponentPurgeBodyFilters]'}, } def __init__(self, *, table: str, filters, **kwargs) -> None: - super(WorkspacePurgeBody, self).__init__(**kwargs) + super(ComponentPurgeBody, self).__init__(**kwargs) self.table = table self.filters = filters diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_response.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_response.py similarity index 91% rename from azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_response.py rename to azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_response.py index 35d54f2167a6..fda99b2a52fb 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_response.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_response.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class WorkspacePurgeResponse(Model): +class ComponentPurgeResponse(Model): """Response containing operationId for a specific purge action. All required parameters must be populated in order to send to Azure. @@ -31,5 +31,5 @@ class WorkspacePurgeResponse(Model): } def __init__(self, **kwargs): - super(WorkspacePurgeResponse, self).__init__(**kwargs) + super(ComponentPurgeResponse, self).__init__(**kwargs) self.operation_id = kwargs.get('operation_id', None) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_response_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_response_py3.py similarity index 91% rename from azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_response_py3.py rename to azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_response_py3.py index 26f7fbc448ae..4ba086b30add 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_response_py3.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_response_py3.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class WorkspacePurgeResponse(Model): +class ComponentPurgeResponse(Model): """Response containing operationId for a specific purge action. All required parameters must be populated in order to send to Azure. @@ -31,5 +31,5 @@ class WorkspacePurgeResponse(Model): } def __init__(self, *, operation_id: str, **kwargs) -> None: - super(WorkspacePurgeResponse, self).__init__(**kwargs) + super(ComponentPurgeResponse, self).__init__(**kwargs) self.operation_id = operation_id diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_status_response.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_status_response.py similarity index 79% rename from azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_status_response.py rename to azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_status_response.py index 52216b115125..f45c559d30c5 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_status_response.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_status_response.py @@ -12,14 +12,14 @@ from msrest.serialization import Model -class WorkspacePurgeStatusResponse(Model): +class ComponentPurgeStatusResponse(Model): """Response containing status for a specific purge operation. All required parameters must be populated in order to send to Azure. :param status: Required. Status of the operation represented by the - requested Id. Possible values include: 'Pending', 'Completed' - :type status: str or ~azure.mgmt.loganalytics.models.PurgeState + requested Id. Possible values include: 'pending', 'completed' + :type status: str or ~azure.mgmt.applicationinsights.models.PurgeState """ _validation = { @@ -31,5 +31,5 @@ class WorkspacePurgeStatusResponse(Model): } def __init__(self, **kwargs): - super(WorkspacePurgeStatusResponse, self).__init__(**kwargs) + super(ComponentPurgeStatusResponse, self).__init__(**kwargs) self.status = kwargs.get('status', None) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_status_response_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_status_response_py3.py similarity index 79% rename from azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_status_response_py3.py rename to azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_status_response_py3.py index 09c2dcb4410f..ced738baf8a8 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/workspace_purge_status_response_py3.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_status_response_py3.py @@ -12,14 +12,14 @@ from msrest.serialization import Model -class WorkspacePurgeStatusResponse(Model): +class ComponentPurgeStatusResponse(Model): """Response containing status for a specific purge operation. All required parameters must be populated in order to send to Azure. :param status: Required. Status of the operation represented by the - requested Id. Possible values include: 'Pending', 'Completed' - :type status: str or ~azure.mgmt.loganalytics.models.PurgeState + requested Id. Possible values include: 'pending', 'completed' + :type status: str or ~azure.mgmt.applicationinsights.models.PurgeState """ _validation = { @@ -31,5 +31,5 @@ class WorkspacePurgeStatusResponse(Model): } def __init__(self, *, status, **kwargs) -> None: - super(WorkspacePurgeStatusResponse, self).__init__(**kwargs) + super(ComponentPurgeStatusResponse, self).__init__(**kwargs) self.status = status diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/components_resource.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/components_resource.py new file mode 100644 index 000000000000..23e2f8e06a54 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/components_resource.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ComponentsResource(Model): + """An azure resource object. + + 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: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ComponentsResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/components_resource_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/components_resource_py3.py new file mode 100644 index 000000000000..565bbcbdfab9 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/components_resource_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ComponentsResource(Model): + """An azure resource object. + + 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: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(ComponentsResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_error.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/error_field_contract.py similarity index 58% rename from azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_error.py rename to azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/error_field_contract.py index 159823f38749..f376b6292b73 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_error.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/error_field_contract.py @@ -12,21 +12,25 @@ from msrest.serialization import Model -class SearchError(Model): - """Details for a search error. +class ErrorFieldContract(Model): + """Error Field contract. - :param type: The error type. - :type type: str - :param message: The error message. + :param code: Property level error code. + :type code: str + :param message: Human-readable representation of property-level error. :type message: str + :param target: Property name. + :type target: str """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, } def __init__(self, **kwargs): - super(SearchError, self).__init__(**kwargs) - self.type = kwargs.get('type', None) + super(ErrorFieldContract, self).__init__(**kwargs) + self.code = kwargs.get('code', None) self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/error_field_contract_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/error_field_contract_py3.py new file mode 100644 index 000000000000..f5c5e28d94d8 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/error_field_contract_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorFieldContract(Model): + """Error Field contract. + + :param code: Property level error code. + :type code: str + :param message: Human-readable representation of property-level error. + :type message: str + :param target: Property name. + :type target: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, **kwargs) -> None: + super(ErrorFieldContract, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/error_response.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/error_response.py index ba4967dac93c..89631521edd0 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/error_response.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/error_response.py @@ -14,7 +14,7 @@ class ErrorResponse(Model): - """Error reponse indicates Insights service is not able to process the + """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. @@ -28,10 +28,10 @@ class ErrorResponse(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code=None, message=None): - super(ErrorResponse, self).__init__() - self.code = code - self.message = message + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) class ErrorResponseException(HttpOperationError): diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/error_response_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/error_response_py3.py new file mode 100644 index 000000000000..c9d57472c9a9 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/error_response_py3.py @@ -0,0 +1,46 @@ +# 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 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) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_metadata_schema.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/inner_error.py similarity index 54% rename from azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_metadata_schema.py rename to azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/inner_error.py index 81238273f963..c6a045d11a9b 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_metadata_schema.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/inner_error.py @@ -12,21 +12,21 @@ from msrest.serialization import Model -class SearchMetadataSchema(Model): - """Schema metadata for search. +class InnerError(Model): + """Inner error. - :param name: The name of the metadata schema. - :type name: str - :param version: The version of the metadata schema. - :type version: int + :param diagnosticcontext: Provides correlation for request + :type diagnosticcontext: str + :param time: Request time + :type time: datetime """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'int'}, + 'diagnosticcontext': {'key': 'diagnosticcontext', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, } def __init__(self, **kwargs): - super(SearchMetadataSchema, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.version = kwargs.get('version', None) + super(InnerError, self).__init__(**kwargs) + self.diagnosticcontext = kwargs.get('diagnosticcontext', None) + self.time = kwargs.get('time', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/inner_error_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/inner_error_py3.py new file mode 100644 index 000000000000..3d49c7d88df6 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/inner_error_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InnerError(Model): + """Inner error. + + :param diagnosticcontext: Provides correlation for request + :type diagnosticcontext: str + :param time: Request time + :type time: datetime + """ + + _attribute_map = { + 'diagnosticcontext': {'key': 'diagnosticcontext', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + } + + def __init__(self, *, diagnosticcontext: str=None, time=None, **kwargs) -> None: + super(InnerError, self).__init__(**kwargs) + self.diagnosticcontext = diagnosticcontext + self.time = time diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/link_properties.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/link_properties.py new file mode 100644 index 000000000000..daf15acf5f1f --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/link_properties.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LinkProperties(Model): + """Contains a sourceId and workbook resource id to link two resources. + + :param source_id: The source Azure resource id + :type source_id: str + :param target_id: The workbook Azure resource id + :type target_id: str + :param category: The category of workbook + :type category: str + """ + + _attribute_map = { + 'source_id': {'key': 'sourceId', 'type': 'str'}, + 'target_id': {'key': 'targetId', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LinkProperties, self).__init__(**kwargs) + self.source_id = kwargs.get('source_id', None) + self.target_id = kwargs.get('target_id', None) + self.category = kwargs.get('category', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/link_properties_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/link_properties_py3.py new file mode 100644 index 000000000000..e7612f593cf8 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/link_properties_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LinkProperties(Model): + """Contains a sourceId and workbook resource id to link two resources. + + :param source_id: The source Azure resource id + :type source_id: str + :param target_id: The workbook Azure resource id + :type target_id: str + :param category: The category of workbook + :type category: str + """ + + _attribute_map = { + 'source_id': {'key': 'sourceId', 'type': 'str'}, + 'target_id': {'key': 'targetId', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + } + + def __init__(self, *, source_id: str=None, target_id: str=None, category: str=None, **kwargs) -> None: + super(LinkProperties, self).__init__(**kwargs) + self.source_id = source_id + self.target_id = target_id + self.category = category diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation.py index ff52ee65e1f9..994037f48c03 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation.py @@ -26,7 +26,7 @@ class Operation(Model): 'display': {'key': 'display', 'type': 'OperationDisplay'}, } - def __init__(self, name=None, display=None): - super(Operation, self).__init__() - self.name = name - self.display = display + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation_display.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation_display.py index 1bd751e13fab..2ff48a6ea9fe 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation_display.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation_display.py @@ -30,8 +30,8 @@ class OperationDisplay(Model): 'operation': {'key': 'operation', 'type': 'str'}, } - def __init__(self, provider=None, resource=None, operation=None): - super(OperationDisplay, self).__init__() - self.provider = provider - self.resource = resource - self.operation = operation + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation_display_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation_display_py3.py new file mode 100644 index 000000000000..5ea914f161e4 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation_display_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Cdn + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_metadata_schema_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation_py3.py similarity index 57% rename from azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_metadata_schema_py3.py rename to azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation_py3.py index 530524c2606d..852ec7479e5e 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_metadata_schema_py3.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation_py3.py @@ -12,21 +12,21 @@ from msrest.serialization import Model -class SearchMetadataSchema(Model): - """Schema metadata for search. +class Operation(Model): + """CDN REST API operation. - :param name: The name of the metadata schema. + :param name: Operation name: {provider}/{resource}/{operation} :type name: str - :param version: The version of the metadata schema. - :type version: int + :param display: The object that represents the operation. + :type display: ~azure.mgmt.applicationinsights.models.OperationDisplay """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'int'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, } - def __init__(self, *, name: str=None, version: int=None, **kwargs) -> None: - super(SearchMetadataSchema, self).__init__(**kwargs) + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) self.name = name - self.version = version + self.display = display diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/tags_resource.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/tags_resource.py index b00182fe1ed6..2c5923e9194b 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/tags_resource.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/tags_resource.py @@ -24,6 +24,6 @@ class TagsResource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, tags=None): - super(TagsResource, self).__init__() - self.tags = tags + def __init__(self, **kwargs): + super(TagsResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_error_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/tags_resource_py3.py similarity index 54% rename from azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_error_py3.py rename to azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/tags_resource_py3.py index 9b093afea61d..999720dda2fd 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_error_py3.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/tags_resource_py3.py @@ -12,21 +12,18 @@ from msrest.serialization import Model -class SearchError(Model): - """Details for a search error. +class TagsResource(Model): + """A container holding only the Tags for a resource, allowing the user to + update the tags on a WebTest instance. - :param type: The error type. - :type type: str - :param message: The error message. - :type message: str + :param tags: Resource tags + :type tags: dict[str, str] """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, type: str=None, message: str=None, **kwargs) -> None: - super(SearchError, self).__init__(**kwargs) - self.type = type - self.message = message + def __init__(self, *, tags=None, **kwargs) -> None: + super(TagsResource, self).__init__(**kwargs) + self.tags = tags diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test.py index 103aa8c9c064..9c825ecf5a3e 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test.py @@ -9,22 +9,24 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .webtests_resource import WebtestsResource -class WebTest(Resource): +class WebTest(WebtestsResource): """An Application Insights web test 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. + :ivar id: Azure resource Id :vartype id: str :ivar name: Azure resource name :vartype name: str :ivar type: Azure resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -32,10 +34,10 @@ class WebTest(Resource): ping and multistep. Possible values include: 'ping', 'multistep'. Default value: "ping" . :type kind: str or ~azure.mgmt.applicationinsights.models.WebTestKind - :param synthetic_monitor_id: Unique ID of this WebTest. This is typically - the same value as the Name field. + :param synthetic_monitor_id: Required. Unique ID of this WebTest. This is + typically the same value as the Name field. :type synthetic_monitor_id: str - :param web_test_name: User defined name if this WebTest. + :param web_test_name: Required. User defined name if this WebTest. :type web_test_name: str :param description: Purpose/user defined descriptive test for this WebTest. @@ -48,15 +50,15 @@ class WebTest(Resource): :param timeout: Seconds until this WebTest will timeout and fail. Default value is 30. Default value: 30 . :type timeout: int - :param web_test_kind: The kind of web test this is, valid choices are ping - and multistep. Possible values include: 'ping', 'multistep'. Default - value: "ping" . + :param web_test_kind: Required. The kind of web test this is, valid + choices are ping and multistep. Possible values include: 'ping', + 'multistep'. Default value: "ping" . :type web_test_kind: str or ~azure.mgmt.applicationinsights.models.WebTestKind :param retry_enabled: Allow for retries should this WebTest fail. :type retry_enabled: bool - :param locations: A list of where to physically run the tests from to give - global coverage for accessibility of your application. + :param locations: Required. A list of where to physically run the tests + from to give global coverage for accessibility of your application. :type locations: list[~azure.mgmt.applicationinsights.models.WebTestGeolocation] :param configuration: An XML configuration specification for a WebTest. @@ -101,17 +103,17 @@ class WebTest(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, location, synthetic_monitor_id, web_test_name, locations, tags=None, kind="ping", description=None, enabled=None, frequency=300, timeout=30, web_test_kind="ping", retry_enabled=None, configuration=None): - super(WebTest, self).__init__(location=location, tags=tags) - self.kind = kind - self.synthetic_monitor_id = synthetic_monitor_id - self.web_test_name = web_test_name - self.description = description - self.enabled = enabled - self.frequency = frequency - self.timeout = timeout - self.web_test_kind = web_test_kind - self.retry_enabled = retry_enabled - self.locations = locations - self.configuration = configuration + def __init__(self, **kwargs): + super(WebTest, self).__init__(**kwargs) + self.kind = kwargs.get('kind', "ping") + self.synthetic_monitor_id = kwargs.get('synthetic_monitor_id', None) + self.web_test_name = kwargs.get('web_test_name', None) + self.description = kwargs.get('description', None) + self.enabled = kwargs.get('enabled', None) + self.frequency = kwargs.get('frequency', 300) + self.timeout = kwargs.get('timeout', 30) + self.web_test_kind = kwargs.get('web_test_kind', "ping") + self.retry_enabled = kwargs.get('retry_enabled', None) + self.locations = kwargs.get('locations', None) + self.configuration = kwargs.get('configuration', None) self.provisioning_state = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_geolocation.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_geolocation.py index 8c52d9c31b80..c6560922a4e4 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_geolocation.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_geolocation.py @@ -24,6 +24,6 @@ class WebTestGeolocation(Model): 'location': {'key': 'Id', 'type': 'str'}, } - def __init__(self, location=None): - super(WebTestGeolocation, self).__init__() - self.location = location + def __init__(self, **kwargs): + super(WebTestGeolocation, self).__init__(**kwargs) + self.location = kwargs.get('location', None) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_highlight.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_geolocation_py3.py similarity index 52% rename from azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_highlight.py rename to azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_geolocation_py3.py index d4b7b292cb1c..e3483d9fa678 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_highlight.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_geolocation_py3.py @@ -12,21 +12,18 @@ from msrest.serialization import Model -class SearchHighlight(Model): - """Highlight details. +class WebTestGeolocation(Model): + """Geo-physical location to run a web test from. You must specify one or more + locations for the test to run from. - :param pre: The string that is put before a matched result. - :type pre: str - :param post: The string that is put after a matched result. - :type post: str + :param location: Location ID for the webtest to run from. + :type location: str """ _attribute_map = { - 'pre': {'key': 'pre', 'type': 'str'}, - 'post': {'key': 'post', 'type': 'str'}, + 'location': {'key': 'Id', 'type': 'str'}, } - def __init__(self, **kwargs): - super(SearchHighlight, self).__init__(**kwargs) - self.pre = kwargs.get('pre', None) - self.post = kwargs.get('post', None) + def __init__(self, *, location: str=None, **kwargs) -> None: + super(WebTestGeolocation, self).__init__(**kwargs) + self.location = location diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_properties_configuration.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_properties_configuration.py index 6ddd1ec152c1..c21de2b8a490 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_properties_configuration.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_properties_configuration.py @@ -24,6 +24,6 @@ class WebTestPropertiesConfiguration(Model): 'web_test': {'key': 'WebTest', 'type': 'str'}, } - def __init__(self, web_test=None): - super(WebTestPropertiesConfiguration, self).__init__() - self.web_test = web_test + def __init__(self, **kwargs): + super(WebTestPropertiesConfiguration, self).__init__(**kwargs) + self.web_test = kwargs.get('web_test', None) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_highlight_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_properties_configuration_py3.py similarity index 52% rename from azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_highlight_py3.py rename to azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_properties_configuration_py3.py index d427d47c3824..74e8b47f2c6b 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_highlight_py3.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_properties_configuration_py3.py @@ -12,21 +12,18 @@ from msrest.serialization import Model -class SearchHighlight(Model): - """Highlight details. +class WebTestPropertiesConfiguration(Model): + """An XML configuration specification for a WebTest. - :param pre: The string that is put before a matched result. - :type pre: str - :param post: The string that is put after a matched result. - :type post: str + :param web_test: The XML specification of a WebTest to run against an + application. + :type web_test: str """ _attribute_map = { - 'pre': {'key': 'pre', 'type': 'str'}, - 'post': {'key': 'post', 'type': 'str'}, + 'web_test': {'key': 'WebTest', 'type': 'str'}, } - def __init__(self, *, pre: str=None, post: str=None, **kwargs) -> None: - super(SearchHighlight, self).__init__(**kwargs) - self.pre = pre - self.post = post + def __init__(self, *, web_test: str=None, **kwargs) -> None: + super(WebTestPropertiesConfiguration, self).__init__(**kwargs) + self.web_test = web_test diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_py3.py new file mode 100644 index 000000000000..9bd0ec5aecf9 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_py3.py @@ -0,0 +1,119 @@ +# 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 .webtests_resource_py3 import WebtestsResource + + +class WebTest(WebtestsResource): + """An Application Insights web test 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. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: The kind of web test that this web test watches. Choices are + ping and multistep. Possible values include: 'ping', 'multistep'. Default + value: "ping" . + :type kind: str or ~azure.mgmt.applicationinsights.models.WebTestKind + :param synthetic_monitor_id: Required. Unique ID of this WebTest. This is + typically the same value as the Name field. + :type synthetic_monitor_id: str + :param web_test_name: Required. User defined name if this WebTest. + :type web_test_name: str + :param description: Purpose/user defined descriptive test for this + WebTest. + :type description: str + :param enabled: Is the test actively being monitored. + :type enabled: bool + :param frequency: Interval in seconds between test runs for this WebTest. + Default value is 300. Default value: 300 . + :type frequency: int + :param timeout: Seconds until this WebTest will timeout and fail. Default + value is 30. Default value: 30 . + :type timeout: int + :param web_test_kind: Required. The kind of web test this is, valid + choices are ping and multistep. Possible values include: 'ping', + 'multistep'. Default value: "ping" . + :type web_test_kind: str or + ~azure.mgmt.applicationinsights.models.WebTestKind + :param retry_enabled: Allow for retries should this WebTest fail. + :type retry_enabled: bool + :param locations: Required. A list of where to physically run the tests + from to give global coverage for accessibility of your application. + :type locations: + list[~azure.mgmt.applicationinsights.models.WebTestGeolocation] + :param configuration: An XML configuration specification for a WebTest. + :type configuration: + ~azure.mgmt.applicationinsights.models.WebTestPropertiesConfiguration + :ivar provisioning_state: Current state of this component, whether or not + is has been provisioned within the resource group it is defined. Users + cannot change this value but are able to read from it. Values will include + Succeeded, Deploying, Canceled, and Failed. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'synthetic_monitor_id': {'required': True}, + 'web_test_name': {'required': True}, + 'web_test_kind': {'required': True}, + 'locations': {'required': True}, + 'provisioning_state': {'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': 'WebTestKind'}, + 'synthetic_monitor_id': {'key': 'properties.SyntheticMonitorId', 'type': 'str'}, + 'web_test_name': {'key': 'properties.Name', 'type': 'str'}, + 'description': {'key': 'properties.Description', 'type': 'str'}, + 'enabled': {'key': 'properties.Enabled', 'type': 'bool'}, + 'frequency': {'key': 'properties.Frequency', 'type': 'int'}, + 'timeout': {'key': 'properties.Timeout', 'type': 'int'}, + 'web_test_kind': {'key': 'properties.Kind', 'type': 'WebTestKind'}, + 'retry_enabled': {'key': 'properties.RetryEnabled', 'type': 'bool'}, + 'locations': {'key': 'properties.Locations', 'type': '[WebTestGeolocation]'}, + 'configuration': {'key': 'properties.Configuration', 'type': 'WebTestPropertiesConfiguration'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, synthetic_monitor_id: str, web_test_name: str, locations, tags=None, kind="ping", description: str=None, enabled: bool=None, frequency: int=300, timeout: int=30, web_test_kind="ping", retry_enabled: bool=None, configuration=None, **kwargs) -> None: + super(WebTest, self).__init__(location=location, tags=tags, **kwargs) + self.kind = kind + self.synthetic_monitor_id = synthetic_monitor_id + self.web_test_name = web_test_name + self.description = description + self.enabled = enabled + self.frequency = frequency + self.timeout = timeout + self.web_test_kind = web_test_kind + self.retry_enabled = retry_enabled + self.locations = locations + self.configuration = configuration + self.provisioning_state = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/webtests_resource.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/webtests_resource.py new file mode 100644 index 000000000000..266febe3d6a6 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/webtests_resource.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WebtestsResource(Model): + """An azure resource object. + + 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: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(WebtestsResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/webtests_resource_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/webtests_resource_py3.py new file mode 100644 index 000000000000..84a3e4c9ff71 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/webtests_resource_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WebtestsResource(Model): + """An azure resource object. + + 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: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(WebtestsResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration.py new file mode 100644 index 000000000000..900129be8297 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WorkItemConfiguration(Model): + """Work item configuration associated with an application insights resource. + + :param connector_id: Connector identifier where work item is created + :type connector_id: str + :param config_display_name: Configuration friendly name + :type config_display_name: str + :param is_default: Boolean value indicating whether configuration is + default + :type is_default: bool + :param id: Unique Id for work item + :type id: str + :param config_properties: Serialized JSON object for detailed properties + :type config_properties: str + """ + + _attribute_map = { + 'connector_id': {'key': 'ConnectorId', 'type': 'str'}, + 'config_display_name': {'key': 'ConfigDisplayName', 'type': 'str'}, + 'is_default': {'key': 'IsDefault', 'type': 'bool'}, + 'id': {'key': 'Id', 'type': 'str'}, + 'config_properties': {'key': 'ConfigProperties', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkItemConfiguration, self).__init__(**kwargs) + self.connector_id = kwargs.get('connector_id', None) + self.config_display_name = kwargs.get('config_display_name', None) + self.is_default = kwargs.get('is_default', None) + self.id = kwargs.get('id', None) + self.config_properties = kwargs.get('config_properties', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_error.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_error.py new file mode 100644 index 000000000000..5552a22a16cf --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_error.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class WorkItemConfigurationError(Model): + """Error associated with trying to get work item configuration or + configurations. + + :param code: Error detail code and explanation + :type code: str + :param message: Error message + :type message: str + :param innererror: + :type innererror: ~azure.mgmt.applicationinsights.models.InnerError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + } + + def __init__(self, **kwargs): + super(WorkItemConfigurationError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.innererror = kwargs.get('innererror', None) + + +class WorkItemConfigurationErrorException(HttpOperationError): + """Server responsed with exception of type: 'WorkItemConfigurationError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(WorkItemConfigurationErrorException, self).__init__(deserialize, response, 'WorkItemConfigurationError', *args) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_error_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_error_py3.py new file mode 100644 index 000000000000..dcffcf9da20e --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_error_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class WorkItemConfigurationError(Model): + """Error associated with trying to get work item configuration or + configurations. + + :param code: Error detail code and explanation + :type code: str + :param message: Error message + :type message: str + :param innererror: + :type innererror: ~azure.mgmt.applicationinsights.models.InnerError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + } + + def __init__(self, *, code: str=None, message: str=None, innererror=None, **kwargs) -> None: + super(WorkItemConfigurationError, self).__init__(**kwargs) + self.code = code + self.message = message + self.innererror = innererror + + +class WorkItemConfigurationErrorException(HttpOperationError): + """Server responsed with exception of type: 'WorkItemConfigurationError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(WorkItemConfigurationErrorException, self).__init__(deserialize, response, 'WorkItemConfigurationError', *args) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_paged.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_paged.py new file mode 100644 index 000000000000..6543cadd6a76 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class WorkItemConfigurationPaged(Paged): + """ + A paging container for iterating over a list of :class:`WorkItemConfiguration ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WorkItemConfiguration]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkItemConfigurationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_py3.py new file mode 100644 index 000000000000..b0b85fff7ac7 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WorkItemConfiguration(Model): + """Work item configuration associated with an application insights resource. + + :param connector_id: Connector identifier where work item is created + :type connector_id: str + :param config_display_name: Configuration friendly name + :type config_display_name: str + :param is_default: Boolean value indicating whether configuration is + default + :type is_default: bool + :param id: Unique Id for work item + :type id: str + :param config_properties: Serialized JSON object for detailed properties + :type config_properties: str + """ + + _attribute_map = { + 'connector_id': {'key': 'ConnectorId', 'type': 'str'}, + 'config_display_name': {'key': 'ConfigDisplayName', 'type': 'str'}, + 'is_default': {'key': 'IsDefault', 'type': 'bool'}, + 'id': {'key': 'Id', 'type': 'str'}, + 'config_properties': {'key': 'ConfigProperties', 'type': 'str'}, + } + + def __init__(self, *, connector_id: str=None, config_display_name: str=None, is_default: bool=None, id: str=None, config_properties: str=None, **kwargs) -> None: + super(WorkItemConfiguration, self).__init__(**kwargs) + self.connector_id = connector_id + self.config_display_name = config_display_name + self.is_default = is_default + self.id = id + self.config_properties = config_properties diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_create_configuration.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_create_configuration.py new file mode 100644 index 000000000000..b12c2d044d09 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_create_configuration.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WorkItemCreateConfiguration(Model): + """Work item configuration creation payload. + + :param connector_id: Unique connector id + :type connector_id: str + :param connector_data_configuration: Serialized JSON object for detailed + properties + :type connector_data_configuration: str + :param validate_only: Boolean indicating validate only + :type validate_only: bool + :param work_item_properties: Custom work item properties + :type work_item_properties: str + """ + + _attribute_map = { + 'connector_id': {'key': 'ConnectorId', 'type': 'str'}, + 'connector_data_configuration': {'key': 'ConnectorDataConfiguration', 'type': 'str'}, + 'validate_only': {'key': 'ValidateOnly', 'type': 'bool'}, + 'work_item_properties': {'key': 'WorkItemProperties', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkItemCreateConfiguration, self).__init__(**kwargs) + self.connector_id = kwargs.get('connector_id', None) + self.connector_data_configuration = kwargs.get('connector_data_configuration', None) + self.validate_only = kwargs.get('validate_only', None) + self.work_item_properties = kwargs.get('work_item_properties', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_create_configuration_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_create_configuration_py3.py new file mode 100644 index 000000000000..4a27f575e889 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_create_configuration_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WorkItemCreateConfiguration(Model): + """Work item configuration creation payload. + + :param connector_id: Unique connector id + :type connector_id: str + :param connector_data_configuration: Serialized JSON object for detailed + properties + :type connector_data_configuration: str + :param validate_only: Boolean indicating validate only + :type validate_only: bool + :param work_item_properties: Custom work item properties + :type work_item_properties: str + """ + + _attribute_map = { + 'connector_id': {'key': 'ConnectorId', 'type': 'str'}, + 'connector_data_configuration': {'key': 'ConnectorDataConfiguration', 'type': 'str'}, + 'validate_only': {'key': 'ValidateOnly', 'type': 'bool'}, + 'work_item_properties': {'key': 'WorkItemProperties', 'type': 'str'}, + } + + def __init__(self, *, connector_id: str=None, connector_data_configuration: str=None, validate_only: bool=None, work_item_properties: str=None, **kwargs) -> None: + super(WorkItemCreateConfiguration, self).__init__(**kwargs) + self.connector_id = connector_id + self.connector_data_configuration = connector_data_configuration + self.validate_only = validate_only + self.work_item_properties = work_item_properties diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/workbook.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/workbook.py new file mode 100644 index 000000000000..2133163369ca --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/workbook.py @@ -0,0 +1,113 @@ +# 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 .workbook_resource import WorkbookResource + + +class Workbook(WorkbookResource): + """An Application Insights 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. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype 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.models.SharedTypeKind + :param workbook_name: Required. The user-defined name of the workbook. + :type workbook_name: str + :param serialized_data: Required. Configuration of this particular + 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 workbook. + :type version: str + :param workbook_id: Required. Internally assigned unique id of the + workbook definition. + :type workbook_id: str + :param shared_type_kind: Required. Enum indicating if this workbook + definition is owned by a specific user or is shared between all users with + access to the Application Insights component. Possible values include: + 'user', 'shared'. Default value: "shared" . + :type shared_type_kind: str or + ~azure.mgmt.applicationinsights.models.SharedTypeKind + :ivar time_modified: Date and time in UTC of the last modification that + was made to this workbook definition. + :vartype time_modified: str + :param category: Required. Workbook category, as defined by the user at + creation time. + :type category: str + :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 + :param source_resource_id: Optional resourceId for a source resource. + :type source_resource_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'workbook_name': {'required': True}, + 'serialized_data': {'required': True}, + 'workbook_id': {'required': True}, + 'shared_type_kind': {'required': True}, + 'time_modified': {'readonly': True}, + 'category': {'required': True}, + 'user_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'workbook_name': {'key': 'properties.name', 'type': 'str'}, + 'serialized_data': {'key': 'properties.serializedData', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'workbook_id': {'key': 'properties.workbookId', 'type': 'str'}, + 'shared_type_kind': {'key': 'properties.kind', 'type': 'str'}, + 'time_modified': {'key': 'properties.timeModified', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'workbook_tags': {'key': 'properties.tags', 'type': '[str]'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'source_resource_id': {'key': 'properties.sourceResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Workbook, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.workbook_name = kwargs.get('workbook_name', None) + self.serialized_data = kwargs.get('serialized_data', None) + self.version = kwargs.get('version', None) + self.workbook_id = kwargs.get('workbook_id', None) + self.shared_type_kind = kwargs.get('shared_type_kind', "shared") + self.time_modified = None + self.category = kwargs.get('category', None) + self.workbook_tags = kwargs.get('workbook_tags', None) + self.user_id = kwargs.get('user_id', None) + self.source_resource_id = kwargs.get('source_resource_id', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/workbook_error.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/workbook_error.py new file mode 100644 index 000000000000..bc970ed4d755 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/workbook_error.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.serialization import Model +from msrest.exceptions import HttpOperationError + + +class WorkbookError(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.models.ErrorFieldContract] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, + } + + def __init__(self, **kwargs): + super(WorkbookError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) + + +class WorkbookErrorException(HttpOperationError): + """Server responsed with exception of type: 'WorkbookError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(WorkbookErrorException, self).__init__(deserialize, response, 'WorkbookError', *args) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/workbook_error_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/workbook_error_py3.py new file mode 100644 index 000000000000..bc44a7f9db55 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/workbook_error_py3.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.serialization import Model +from msrest.exceptions import HttpOperationError + + +class WorkbookError(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.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(WorkbookError, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + + +class WorkbookErrorException(HttpOperationError): + """Server responsed with exception of type: 'WorkbookError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(WorkbookErrorException, self).__init__(deserialize, response, 'WorkbookError', *args) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/workbook_paged.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/workbook_paged.py new file mode 100644 index 000000000000..5487b5ce3e32 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/workbook_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class WorkbookPaged(Paged): + """ + A paging container for iterating over a list of :class:`Workbook ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Workbook]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkbookPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/workbook_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/workbook_py3.py new file mode 100644 index 000000000000..1513836a9ff6 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/workbook_py3.py @@ -0,0 +1,113 @@ +# 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 .workbook_resource_py3 import WorkbookResource + + +class Workbook(WorkbookResource): + """An Application Insights 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. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype 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.models.SharedTypeKind + :param workbook_name: Required. The user-defined name of the workbook. + :type workbook_name: str + :param serialized_data: Required. Configuration of this particular + 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 workbook. + :type version: str + :param workbook_id: Required. Internally assigned unique id of the + workbook definition. + :type workbook_id: str + :param shared_type_kind: Required. Enum indicating if this workbook + definition is owned by a specific user or is shared between all users with + access to the Application Insights component. Possible values include: + 'user', 'shared'. Default value: "shared" . + :type shared_type_kind: str or + ~azure.mgmt.applicationinsights.models.SharedTypeKind + :ivar time_modified: Date and time in UTC of the last modification that + was made to this workbook definition. + :vartype time_modified: str + :param category: Required. Workbook category, as defined by the user at + creation time. + :type category: str + :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 + :param source_resource_id: Optional resourceId for a source resource. + :type source_resource_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'workbook_name': {'required': True}, + 'serialized_data': {'required': True}, + 'workbook_id': {'required': True}, + 'shared_type_kind': {'required': True}, + 'time_modified': {'readonly': True}, + 'category': {'required': True}, + 'user_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'workbook_name': {'key': 'properties.name', 'type': 'str'}, + 'serialized_data': {'key': 'properties.serializedData', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'workbook_id': {'key': 'properties.workbookId', 'type': 'str'}, + 'shared_type_kind': {'key': 'properties.kind', 'type': 'str'}, + 'time_modified': {'key': 'properties.timeModified', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'workbook_tags': {'key': 'properties.tags', 'type': '[str]'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'source_resource_id': {'key': 'properties.sourceResourceId', 'type': 'str'}, + } + + def __init__(self, *, workbook_name: str, serialized_data: str, workbook_id: str, category: str, user_id: str, location: str=None, tags=None, kind=None, version: str=None, shared_type_kind="shared", workbook_tags=None, source_resource_id: str=None, **kwargs) -> None: + super(Workbook, self).__init__(location=location, tags=tags, **kwargs) + self.kind = kind + self.workbook_name = workbook_name + self.serialized_data = serialized_data + self.version = version + self.workbook_id = workbook_id + self.shared_type_kind = shared_type_kind + self.time_modified = None + self.category = category + self.workbook_tags = workbook_tags + self.user_id = user_id + self.source_resource_id = source_resource_id diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_results_response.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/workbook_resource.py similarity index 50% rename from azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_results_response.py rename to azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/workbook_resource.py index 88b9f99bcfe0..93469ee6ca6f 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_results_response.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/workbook_resource.py @@ -12,36 +12,42 @@ from msrest.serialization import Model -class SearchResultsResponse(Model): - """The get search result operation response. +class WorkbookResource(Model): + """An azure resource object. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The id of the search, which includes the full url. + :ivar id: Azure resource Id :vartype id: str - :param metadata: The metadata from search results. - :type metadata: ~azure.mgmt.loganalytics.models.SearchMetadata - :param value: The array of result values. - :type value: list[object] - :param error: The error. - :type error: ~azure.mgmt.loganalytics.models.SearchError + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] """ _validation = { 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'metadata': {'key': 'metaData', 'type': 'SearchMetadata'}, - 'value': {'key': 'value', 'type': '[object]'}, - 'error': {'key': 'error', 'type': 'SearchError'}, + '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(SearchResultsResponse, self).__init__(**kwargs) + super(WorkbookResource, self).__init__(**kwargs) self.id = None - self.metadata = kwargs.get('metadata', None) - self.value = kwargs.get('value', None) - self.error = kwargs.get('error', None) + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/resource.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/workbook_resource_py3.py similarity index 90% rename from azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/resource.py rename to azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/workbook_resource_py3.py index 1552cf70c86d..24f2b8e726dd 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/resource.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/workbook_resource_py3.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class Resource(Model): +class WorkbookResource(Model): """An azure resource object. Variables are only populated by the server, and will be ignored when @@ -34,7 +34,6 @@ class Resource(Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, } _attribute_map = { @@ -45,8 +44,8 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location, tags=None): - super(Resource, self).__init__() + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(WorkbookResource, self).__init__(**kwargs) self.id = None self.name = None self.type = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/__init__.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/__init__.py index d8de45a083e4..dadfea943845 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/__init__.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/__init__.py @@ -10,21 +10,37 @@ # -------------------------------------------------------------------------- from .operations import Operations -from .components_operations import ComponentsOperations -from .web_tests_operations import WebTestsOperations +from .annotations_operations import AnnotationsOperations +from .api_keys_operations import APIKeysOperations from .export_configurations_operations import ExportConfigurationsOperations -from .proactive_detection_configurations_operations import ProactiveDetectionConfigurationsOperations from .component_current_billing_features_operations import ComponentCurrentBillingFeaturesOperations from .component_quota_status_operations import ComponentQuotaStatusOperations -from .api_keys_operations import APIKeysOperations +from .component_feature_capabilities_operations import ComponentFeatureCapabilitiesOperations +from .component_available_features_operations import ComponentAvailableFeaturesOperations +from .proactive_detection_configurations_operations import ProactiveDetectionConfigurationsOperations +from .components_operations import ComponentsOperations +from .work_item_configurations_operations import WorkItemConfigurationsOperations +from .favorites_operations import FavoritesOperations +from .web_test_locations_operations import WebTestLocationsOperations +from .web_tests_operations import WebTestsOperations +from .analytics_items_operations import AnalyticsItemsOperations +from .workbooks_operations import WorkbooksOperations __all__ = [ 'Operations', - 'ComponentsOperations', - 'WebTestsOperations', + 'AnnotationsOperations', + 'APIKeysOperations', 'ExportConfigurationsOperations', - 'ProactiveDetectionConfigurationsOperations', 'ComponentCurrentBillingFeaturesOperations', 'ComponentQuotaStatusOperations', - 'APIKeysOperations', + 'ComponentFeatureCapabilitiesOperations', + 'ComponentAvailableFeaturesOperations', + 'ProactiveDetectionConfigurationsOperations', + 'ComponentsOperations', + 'WorkItemConfigurationsOperations', + 'FavoritesOperations', + 'WebTestLocationsOperations', + 'WebTestsOperations', + 'AnalyticsItemsOperations', + 'WorkbooksOperations', ] diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/analytics_items_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/analytics_items_operations.py new file mode 100644 index 000000000000..dc51748f12a0 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/analytics_items_operations.py @@ -0,0 +1,374 @@ +# 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 AnalyticsItemsOperations(object): + """AnalyticsItemsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: 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( + self, resource_group_name, resource_name, scope_path, scope="shared", type="none", include_content=None, custom_headers=None, raw=False, **operation_config): + """Gets a list of Analytics Items defined within an Application Insights + component. + + :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 scope_path: Enum indicating if this item definition is owned by + a specific user or is shared between all users with access to the + Application Insights component. Possible values include: + 'analyticsItems', 'myanalyticsItems' + :type scope_path: str or + ~azure.mgmt.applicationinsights.models.ItemScopePath + :param scope: Enum indicating if this item definition is owned by a + specific user or is shared between all users with access to the + Application Insights component. Possible values include: 'shared', + 'user' + :type scope: str or ~azure.mgmt.applicationinsights.models.ItemScope + :param type: Enum indicating the type of the Analytics item. Possible + values include: 'none', 'query', 'function', 'folder', 'recent' + :type type: str or + ~azure.mgmt.applicationinsights.models.ItemTypeParameter + :param include_content: Flag indicating whether or not to return the + content of each applicable item. If false, only return the item + information. + :type include_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: list or ClientRawResponse if raw=true + :rtype: + list[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentAnalyticsItem] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.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'), + 'scopePath': self._serialize.url("scope_path", scope_path, '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) + if scope is not None: + query_parameters['scope'] = self._serialize.query("scope", scope, 'str') + if type is not None: + query_parameters['type'] = self._serialize.query("type", type, 'str') + if include_content is not None: + query_parameters['includeContent'] = self._serialize.query("include_content", include_content, 'bool') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[ApplicationInsightsComponentAnalyticsItem]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}'} + + def get( + self, resource_group_name, resource_name, scope_path, id=None, name=None, custom_headers=None, raw=False, **operation_config): + """Gets a specific Analytics Items defined within an Application Insights + component. + + :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 scope_path: Enum indicating if this item definition is owned by + a specific user or is shared between all users with access to the + Application Insights component. Possible values include: + 'analyticsItems', 'myanalyticsItems' + :type scope_path: str or + ~azure.mgmt.applicationinsights.models.ItemScopePath + :param id: The Id of a specific item defined in the Application + Insights component + :type id: str + :param name: The name of a specific item defined in the Application + Insights component + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApplicationInsightsComponentAnalyticsItem or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentAnalyticsItem + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'scopePath': self._serialize.url("scope_path", scope_path, '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) + if id is not None: + query_parameters['id'] = self._serialize.query("id", id, 'str') + if name is not None: + query_parameters['name'] = self._serialize.query("name", name, 'str') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentAnalyticsItem', 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/components/{resourceName}/{scopePath}/item'} + + def put( + self, resource_group_name, resource_name, scope_path, item_properties, override_item=None, custom_headers=None, raw=False, **operation_config): + """Adds or Updates a specific Analytics Item within an Application + Insights component. + + :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 scope_path: Enum indicating if this item definition is owned by + a specific user or is shared between all users with access to the + Application Insights component. Possible values include: + 'analyticsItems', 'myanalyticsItems' + :type scope_path: str or + ~azure.mgmt.applicationinsights.models.ItemScopePath + :param item_properties: Properties that need to be specified to create + a new item and add it to an Application Insights component. + :type item_properties: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentAnalyticsItem + :param override_item: Flag indicating whether or not to force save an + item. This allows overriding an item if it already exists. + :type override_item: 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: ApplicationInsightsComponentAnalyticsItem or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentAnalyticsItem + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.put.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'), + 'scopePath': self._serialize.url("scope_path", scope_path, '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) + if override_item is not None: + query_parameters['overrideItem'] = self._serialize.query("override_item", override_item, 'bool') + + # 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(item_properties, 'ApplicationInsightsComponentAnalyticsItem') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentAnalyticsItem', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item'} + + def delete( + self, resource_group_name, resource_name, scope_path, id=None, name=None, custom_headers=None, raw=False, **operation_config): + """Deletes a specific Analytics Items defined within an Application + Insights component. + + :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 scope_path: Enum indicating if this item definition is owned by + a specific user or is shared between all users with access to the + Application Insights component. Possible values include: + 'analyticsItems', 'myanalyticsItems' + :type scope_path: str or + ~azure.mgmt.applicationinsights.models.ItemScopePath + :param id: The Id of a specific item defined in the Application + Insights component + :type id: str + :param name: The name of a specific item defined in the Application + Insights component + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + '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'), + 'scopePath': self._serialize.url("scope_path", scope_path, '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) + if id is not None: + query_parameters['id'] = self._serialize.query("id", id, 'str') + if name is not None: + query_parameters['name'] = self._serialize.query("name", name, 'str') + + # 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 [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/annotations_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/annotations_operations.py new file mode 100644 index 000000000000..1ccc8a802733 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/annotations_operations.py @@ -0,0 +1,321 @@ +# 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 AnnotationsOperations(object): + """AnnotationsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: 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( + self, resource_group_name, resource_name, start, end, custom_headers=None, raw=False, **operation_config): + """Gets the list of annotations for a component for given time range. + + :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 start: The start time to query from for annotations, cannot be + older than 90 days from current date. + :type start: str + :param end: The end time to query for annotations. + :type end: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Annotation + :rtype: + ~azure.mgmt.applicationinsights.models.AnnotationPaged[~azure.mgmt.applicationinsights.models.Annotation] + :raises: + :class:`AnnotationErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + '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) + query_parameters['start'] = self._serialize.query("start", start, 'str') + query_parameters['end'] = self._serialize.query("end", end, 'str') + + 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) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.AnnotationErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.AnnotationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AnnotationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations'} + + def create( + self, resource_group_name, resource_name, annotation_properties, custom_headers=None, raw=False, **operation_config): + """Create an Annotation of an Application Insights component. + + :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 annotation_properties: Properties that need to be specified to + create an annotation of a Application Insights component. + :type annotation_properties: + ~azure.mgmt.applicationinsights.models.Annotation + :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: list or ClientRawResponse if raw=true + :rtype: list[~azure.mgmt.applicationinsights.models.Annotation] or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`AnnotationErrorException` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + '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(annotation_properties, 'Annotation') + + # 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]: + raise models.AnnotationErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[Annotation]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations'} + + def delete( + self, resource_group_name, resource_name, annotation_id, custom_headers=None, raw=False, **operation_config): + """Delete an Annotation of an Application Insights component. + + :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 annotation_id: The unique annotation ID. This is unique within + a Application Insights component. + :type annotation_id: 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: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'annotationId': self._serialize.url("annotation_id", annotation_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', 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.delete(url, query_parameters, header_parameters) + 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 + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('object', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations/{annotationId}'} + + def get( + self, resource_group_name, resource_name, annotation_id, custom_headers=None, raw=False, **operation_config): + """Get the annotation for given id. + + :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 annotation_id: The unique annotation ID. This is unique within + a Application Insights component. + :type annotation_id: 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: list or ClientRawResponse if raw=true + :rtype: list[~azure.mgmt.applicationinsights.models.Annotation] or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`AnnotationErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'annotationId': self._serialize.url("annotation_id", annotation_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', 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.AnnotationErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[Annotation]', 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/components/{resourceName}/Annotations/{annotationId}'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/api_keys_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/api_keys_operations.py index a80e2eddf565..578a76b50aae 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/api_keys_operations.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/api_keys_operations.py @@ -22,8 +22,8 @@ class APIKeysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: Client Api Version. Constant value: "2015-05-01". + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2015-05-01". """ models = models @@ -41,7 +41,8 @@ def list( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): """Gets a list of API keys of an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -61,17 +62,17 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ApiKeys' + url = self.list.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), '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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -79,7 +80,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -88,9 +89,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -108,12 +108,14 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ApiKeys'} def create( self, resource_group_name, resource_name, api_key_properties, custom_headers=None, raw=False, **operation_config): """Create an API Key of an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -135,20 +137,21 @@ def create( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ApiKeys' + url = self.create.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), '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') + 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()) @@ -161,9 +164,8 @@ def create( body_content = self._serialize.body(api_key_properties, 'APIKeyRequest') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -180,12 +182,14 @@ def create( return client_raw_response return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ApiKeys'} def delete( self, resource_group_name, resource_name, key_id, custom_headers=None, raw=False, **operation_config): """Delete an API Key of an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -206,10 +210,10 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/APIKeys/{keyId}' + url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'keyId': self._serialize.url("key_id", key_id, 'str') } @@ -217,11 +221,11 @@ def delete( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -230,8 +234,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -248,12 +252,14 @@ def delete( return client_raw_response return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/APIKeys/{keyId}'} def get( self, resource_group_name, resource_name, key_id, custom_headers=None, raw=False, **operation_config): """Get the API Key for this key id. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -274,10 +280,10 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/APIKeys/{keyId}' + url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'keyId': self._serialize.url("key_id", key_id, 'str') } @@ -285,11 +291,11 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -298,8 +304,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -316,3 +322,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/APIKeys/{keyId}'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_available_features_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_available_features_operations.py new file mode 100644 index 000000000000..f90bdf9b27c0 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_available_features_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 ComponentAvailableFeaturesOperations(object): + """ComponentAvailableFeaturesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: 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 get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Returns all available features of the application insights component. + + :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: ApplicationInsightsComponentAvailableFeatures or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentAvailableFeatures + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + '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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentAvailableFeatures', 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/components/{resourceName}/getavailablebillingfeatures'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_current_billing_features_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_current_billing_features_operations.py index 16cade55aa9c..92261d281f10 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_current_billing_features_operations.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_current_billing_features_operations.py @@ -22,8 +22,8 @@ class ComponentCurrentBillingFeaturesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: Client Api Version. Constant value: "2015-05-01". + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2015-05-01". """ models = models @@ -41,7 +41,8 @@ def get( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): """Returns current billing features for an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -59,21 +60,21 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures' + url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), '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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -82,8 +83,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -100,18 +101,20 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/currentbillingfeatures'} def update( self, resource_group_name, resource_name, data_volume_cap=None, current_billing_features=None, custom_headers=None, raw=False, **operation_config): """Update current billing features for an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. :type resource_name: str :param data_volume_cap: An Application Insights component daily data - volumne cap + volume cap :type data_volume_cap: ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentDataVolumeCap :param current_billing_features: Current enabled pricing plan. When @@ -133,20 +136,21 @@ def update( billing_features_properties = models.ApplicationInsightsComponentBillingFeatures(data_volume_cap=data_volume_cap, current_billing_features=current_billing_features) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures' + url = self.update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), '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') + 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()) @@ -159,9 +163,8 @@ def update( body_content = self._serialize.body(billing_features_properties, 'ApplicationInsightsComponentBillingFeatures') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -178,3 +181,4 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/currentbillingfeatures'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_feature_capabilities_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_feature_capabilities_operations.py new file mode 100644 index 000000000000..e3f6e169f0fe --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_feature_capabilities_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 ComponentFeatureCapabilitiesOperations(object): + """ComponentFeatureCapabilitiesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: 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 get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Returns feature capabilities of the application insights component. + + :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: ApplicationInsightsComponentFeatureCapabilities or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFeatureCapabilities + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + '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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentFeatureCapabilities', 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/components/{resourceName}/featurecapabilities'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_quota_status_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_quota_status_operations.py index 13771c68a22a..f31665321b6d 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_quota_status_operations.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_quota_status_operations.py @@ -22,8 +22,8 @@ class ComponentQuotaStatusOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: Client Api Version. Constant value: "2015-05-01". + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2015-05-01". """ models = models @@ -42,7 +42,8 @@ def get( """Returns daily data volume cap (quota) status for an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -60,21 +61,21 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/quotastatus' + url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), '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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -83,8 +84,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -101,3 +102,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/quotastatus'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/components_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/components_operations.py index a8ed3b023375..b133e0d68e5f 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/components_operations.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/components_operations.py @@ -22,8 +22,8 @@ class ComponentsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: Client Api Version. Constant value: "2015-05-01". + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2015-05-01". """ models = models @@ -56,15 +56,15 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/microsoft.insights/components' + url = self.list.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + '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['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -72,7 +72,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -81,9 +81,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -101,12 +100,14 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/components'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): """Gets a list of Application Insights components within a resource group. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -122,16 +123,16 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } 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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -139,7 +140,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -148,9 +149,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -168,12 +168,14 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components'} def delete( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): """Deletes an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -188,21 +190,20 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}' + url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), '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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -211,8 +212,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -222,12 +223,14 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} def get( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): """Returns an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -244,21 +247,21 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}' + url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), '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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -267,8 +270,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -285,6 +288,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} def create_or_update( self, resource_group_name, resource_name, insight_properties, custom_headers=None, raw=False, **operation_config): @@ -292,7 +296,8 @@ def create_or_update( cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -313,20 +318,21 @@ def create_or_update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), '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') + 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()) @@ -339,9 +345,8 @@ def create_or_update( body_content = self._serialize.body(insight_properties, 'ApplicationInsightsComponent') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -358,13 +363,15 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} def update_tags( self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): """Updates an existing component's tags. To update other fields use the CreateOrUpdate method. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -385,20 +392,21 @@ def update_tags( component_tags = models.TagsResource(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}' + url = self.update_tags.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), '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') + 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()) @@ -411,9 +419,8 @@ def update_tags( body_content = self._serialize.body(component_tags, 'TagsResource') # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -430,3 +437,150 @@ def update_tags( return client_raw_response return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} + + def purge( + self, resource_group_name, resource_name, table, filters, custom_headers=None, raw=False, **operation_config): + """Purges data in an Application Insights component by a set of + user-defined filters. + + :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 table: Table from which to purge data. + :type table: str + :param filters: The set of columns and filters (queries) to run over + them to purge the resulting data. + :type filters: + list[~azure.mgmt.applicationinsights.models.ComponentPurgeBodyFilters] + :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: ComponentPurgeResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.applicationinsights.models.ComponentPurgeResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + body = models.ComponentPurgeBody(table=table, filters=filters) + + # Construct URL + url = self.purge.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + '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(body, 'ComponentPurgeBody') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 202: + deserialized = self._deserialize('ComponentPurgeResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/purge'} + + def get_purge_status( + self, resource_group_name, resource_name, purge_id, custom_headers=None, raw=False, **operation_config): + """Get status for an ongoing purge operation. + + :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 purge_id: In a purge status request, this is the Id of the + operation the status of which is returned. + :type purge_id: 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: ComponentPurgeStatusResponse or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.models.ComponentPurgeStatusResponse or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_purge_status.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'purgeId': self._serialize.url("purge_id", purge_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ComponentPurgeStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_purge_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/operations/{purgeId}'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/export_configurations_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/export_configurations_operations.py index 8f5cd9f601e5..676984225b87 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/export_configurations_operations.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/export_configurations_operations.py @@ -22,8 +22,8 @@ class ExportConfigurationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: Client Api Version. Constant value: "2015-05-01". + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2015-05-01". """ models = models @@ -42,7 +42,8 @@ def list( """Gets a list of Continuous Export configuration of an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -59,21 +60,21 @@ def list( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration' + url = self.list.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), '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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -82,8 +83,8 @@ def list( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -100,13 +101,15 @@ def list( return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration'} def create( self, resource_group_name, resource_name, export_properties, custom_headers=None, raw=False, **operation_config): """Create a Continuous Export configuration of an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -128,20 +131,21 @@ def create( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration' + url = self.create.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), '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') + 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()) @@ -154,9 +158,8 @@ def create( body_content = self._serialize.body(export_properties, 'ApplicationInsightsComponentExportRequest') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -173,13 +176,15 @@ def create( return client_raw_response return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration'} def delete( self, resource_group_name, resource_name, export_id, custom_headers=None, raw=False, **operation_config): """Delete a Continuous Export configuration of an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -200,10 +205,10 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}' + url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'exportId': self._serialize.url("export_id", export_id, 'str') } @@ -211,11 +216,11 @@ def delete( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -224,8 +229,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -242,12 +247,14 @@ def delete( return client_raw_response return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}'} def get( self, resource_group_name, resource_name, export_id, custom_headers=None, raw=False, **operation_config): """Get the Continuous Export configuration for this export id. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -268,10 +275,10 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}' + url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'exportId': self._serialize.url("export_id", export_id, 'str') } @@ -279,11 +286,11 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -292,8 +299,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -310,12 +317,14 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}'} def update( self, resource_group_name, resource_name, export_id, export_properties, custom_headers=None, raw=False, **operation_config): """Update the Continuous Export configuration for this export id. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -340,10 +349,10 @@ def update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}' + url = self.update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'exportId': self._serialize.url("export_id", export_id, 'str') } @@ -351,10 +360,11 @@ def update( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + 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()) @@ -367,9 +377,8 @@ def update( body_content = self._serialize.body(export_properties, 'ApplicationInsightsComponentExportRequest') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -386,3 +395,4 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}'} diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/saved_searches_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/favorites_operations.py similarity index 52% rename from azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/saved_searches_operations.py rename to azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/favorites_operations.py index 95bbe17347cb..6d95c8aba102 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/saved_searches_operations.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/favorites_operations.py @@ -16,14 +16,14 @@ from .. import models -class SavedSearchesOperations(object): - """SavedSearchesOperations operations. +class FavoritesOperations(object): + """FavoritesOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2015-03-20". + :ivar api_version: The API version to use for this operation. Constant value: "2015-05-01". """ models = models @@ -33,47 +33,72 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-03-20" + self.api_version = "2015-05-01" self.config = config - def delete( - self, resource_group_name, workspace_name, saved_search_name, custom_headers=None, raw=False, **operation_config): - """Deletes the specified saved search in a given workspace. + def list( + self, resource_group_name, resource_name, favorite_type="shared", source_type=None, can_fetch_content=None, tags=None, custom_headers=None, raw=False, **operation_config): + """Gets a list of favorites defined within an Application Insights + component. - :param resource_group_name: The name of the resource group to get. The - name is case insensitive. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str - :param workspace_name: Log Analytics workspace name - :type workspace_name: str - :param saved_search_name: Name of the saved search. - :type saved_search_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param favorite_type: The type of favorite. Value can be either shared + or user. Possible values include: 'shared', 'user' + :type favorite_type: str or + ~azure.mgmt.applicationinsights.models.FavoriteType + :param source_type: Source type of favorite to return. When left out, + the source type defaults to 'other' (not present in this enum). + Possible values include: 'retention', 'notebook', 'sessions', + 'events', 'userflows', 'funnel', 'impact', 'segmentation' + :type source_type: str or + ~azure.mgmt.applicationinsights.models.FavoriteSourceType + :param can_fetch_content: Flag indicating whether or not to return the + full content for each applicable favorite. If false, only return + summary content for favorites. + :type can_fetch_content: bool + :param tags: Tags that must be present on each favorite returned. + :type tags: list[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 + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFavorite] + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.delete.metadata['url'] + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), - 'savedSearchName': self._serialize.url("saved_search_name", saved_search_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + '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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + if favorite_type is not None: + query_parameters['favoriteType'] = self._serialize.query("favorite_type", favorite_type, 'FavoriteType') + if source_type is not None: + query_parameters['sourceType'] = self._serialize.query("source_type", source_type, 'str') + if can_fetch_content is not None: + query_parameters['canFetchContent'] = self._serialize.query("can_fetch_content", can_fetch_content, 'bool') + if tags is not None: + query_parameters['tags'] = self._serialize.query("tags", tags, '[str]', div=',') # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -82,59 +107,69 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[ApplicationInsightsComponentFavorite]', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchName}'} - def create_or_update( - self, resource_group_name, workspace_name, saved_search_name, parameters, custom_headers=None, raw=False, **operation_config): - """Creates or updates a saved search for a given workspace. + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites'} - :param resource_group_name: The name of the resource group to get. The - name is case insensitive. + def get( + self, resource_group_name, resource_name, favorite_id, custom_headers=None, raw=False, **operation_config): + """Get a single favorite by its FavoriteId, defined within an Application + Insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str - :param workspace_name: Log Analytics workspace name - :type workspace_name: str - :param saved_search_name: The id of the saved search. - :type saved_search_name: str - :param parameters: The parameters required to save a search. - :type parameters: ~azure.mgmt.loganalytics.models.SavedSearch + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param favorite_id: The Id of a specific favorite defined in the + Application Insights component + :type favorite_id: 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: SavedSearch or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.loganalytics.models.SavedSearch or - ~msrest.pipeline.ClientRawResponse + :return: ApplicationInsightsComponentFavorite or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFavorite + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.create_or_update.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), - 'savedSearchName': self._serialize.url("saved_search_name", saved_search_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'favoriteId': self._serialize.url("favorite_id", favorite_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -142,13 +177,9 @@ def create_or_update( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - # Construct body - body_content = self._serialize.body(parameters, 'SavedSearch') - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -158,52 +189,61 @@ def create_or_update( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SavedSearch', response) + deserialized = self._deserialize('ApplicationInsightsComponentFavorite', 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.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'} - def get( - self, resource_group_name, workspace_name, saved_search_name, custom_headers=None, raw=False, **operation_config): - """Gets the specified saved search for a given workspace. + def add( + self, resource_group_name, resource_name, favorite_id, favorite_properties, custom_headers=None, raw=False, **operation_config): + """Adds a new favorites to an Application Insights component. - :param resource_group_name: The name of the resource group to get. The - name is case insensitive. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str - :param workspace_name: Log Analytics workspace name - :type workspace_name: str - :param saved_search_name: The id of the saved search. - :type saved_search_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param favorite_id: The Id of a specific favorite defined in the + Application Insights component + :type favorite_id: str + :param favorite_properties: Properties that need to be specified to + create a new favorite and add it to an Application Insights component. + :type favorite_properties: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFavorite :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: SavedSearch or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.loganalytics.models.SavedSearch or - ~msrest.pipeline.ClientRawResponse + :return: ApplicationInsightsComponentFavorite or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFavorite + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.get.metadata['url'] + url = self.add.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), - 'savedSearchName': self._serialize.url("saved_search_name", saved_search_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'favoriteId': self._serialize.url("favorite_id", favorite_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + 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()) @@ -212,9 +252,12 @@ def get( 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(favorite_properties, 'ApplicationInsightsComponentFavorite') + # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -224,49 +267,62 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SavedSearch', response) + deserialized = self._deserialize('ApplicationInsightsComponentFavorite', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchName}'} + add.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'} - def list_by_workspace( - self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): - """Gets the saved searches for a given Log Analytics Workspace. + def update( + self, resource_group_name, resource_name, favorite_id, favorite_properties, custom_headers=None, raw=False, **operation_config): + """Updates a favorite that has already been added to an Application + Insights component. - :param resource_group_name: The name of the resource group to get. The - name is case insensitive. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str - :param workspace_name: Log Analytics workspace name - :type workspace_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param favorite_id: The Id of a specific favorite defined in the + Application Insights component + :type favorite_id: str + :param favorite_properties: Properties that need to be specified to + update the existing favorite. + :type favorite_properties: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFavorite :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: SavedSearchesListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.loganalytics.models.SavedSearchesListResult or - ~msrest.pipeline.ClientRawResponse + :return: ApplicationInsightsComponentFavorite or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFavorite + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.list_by_workspace.metadata['url'] + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'favoriteId': self._serialize.url("favorite_id", favorite_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + 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()) @@ -275,9 +331,12 @@ def list_by_workspace( 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(favorite_properties, 'ApplicationInsightsComponentFavorite') + # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -287,53 +346,54 @@ def list_by_workspace( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SavedSearchesListResult', response) + deserialized = self._deserialize('ApplicationInsightsComponentFavorite', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'} - def get_results( - self, resource_group_name, workspace_name, saved_search_name, custom_headers=None, raw=False, **operation_config): - """Gets the results from a saved search for a given workspace. + def delete( + self, resource_group_name, resource_name, favorite_id, custom_headers=None, raw=False, **operation_config): + """Remove a favorite that is associated to an Application Insights + component. - :param resource_group_name: The name of the resource group to get. The - name is case insensitive. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str - :param workspace_name: Log Analytics workspace name - :type workspace_name: str - :param saved_search_name: The name of the saved search. - :type saved_search_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param favorite_id: The Id of a specific favorite defined in the + Application Insights component + :type favorite_id: 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: SearchResultsResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.loganalytics.models.SearchResultsResponse or - ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.get_results.metadata['url'] + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), - 'savedSearchName': self._serialize.url("saved_search_name", saved_search_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'favoriteId': self._serialize.url("favorite_id", favorite_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -342,22 +402,15 @@ def get_results( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + 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 - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('SearchResultsResponse', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - - return deserialized - get_results.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchName}/results'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/operations.py index 8c6c4ab58dec..126ca2eca5bf 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/operations.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/operations.py @@ -21,8 +21,8 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: Client Api Version. Constant value: "2015-05-01". + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2015-05-01". """ models = models @@ -55,11 +55,11 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/microsoft.insights/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -67,7 +67,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -76,9 +76,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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.ErrorResponseException(self._deserialize, response) @@ -94,3 +93,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.Insights/operations'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/proactive_detection_configurations_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/proactive_detection_configurations_operations.py index 3a5f0b763667..cf7384327518 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/proactive_detection_configurations_operations.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/proactive_detection_configurations_operations.py @@ -22,8 +22,8 @@ class ProactiveDetectionConfigurationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: Client Api Version. Constant value: "2015-05-01". + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2015-05-01". """ models = models @@ -42,7 +42,8 @@ def list( """Gets a list of ProactiveDetection configurations of an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -59,21 +60,21 @@ def list( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ProactiveDetectionConfigs' + url = self.list.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), '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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -82,8 +83,8 @@ def list( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -100,12 +101,14 @@ def list( return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs'} def get( self, resource_group_name, resource_name, configuration_id, custom_headers=None, raw=False, **operation_config): """Get the ProactiveDetection configuration for this configuration id. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -126,10 +129,10 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}' + url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'ConfigurationId': self._serialize.url("configuration_id", configuration_id, 'str') } @@ -137,11 +140,11 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -150,8 +153,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -168,12 +171,14 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}'} def update( self, resource_group_name, resource_name, configuration_id, proactive_detection_properties, custom_headers=None, raw=False, **operation_config): """Update the ProactiveDetection configuration for this configuration id. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -198,10 +203,10 @@ def update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}' + url = self.update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'ConfigurationId': self._serialize.url("configuration_id", configuration_id, 'str') } @@ -209,10 +214,11 @@ def update( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + 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()) @@ -225,9 +231,8 @@ def update( body_content = self._serialize.body(proactive_detection_properties, 'ApplicationInsightsComponentProactiveDetectionConfiguration') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -244,3 +249,4 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/web_test_locations_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/web_test_locations_operations.py new file mode 100644 index 000000000000..5890c5fd7daf --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/web_test_locations_operations.py @@ -0,0 +1,112 @@ +# 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 WebTestLocationsOperations(object): + """WebTestLocationsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: 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( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of web test locations available to this Application + Insights component. + + :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: An iterator like instance of + ApplicationInsightsComponentWebTestLocation + :rtype: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentWebTestLocationPaged[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentWebTestLocation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + '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) + + 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) + 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 + deserialized = models.ApplicationInsightsComponentWebTestLocationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ApplicationInsightsComponentWebTestLocationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/syntheticmonitorlocations'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/web_tests_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/web_tests_operations.py index 44a6e74d6e24..8a6f068bc047 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/web_tests_operations.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/web_tests_operations.py @@ -22,8 +22,8 @@ class WebTestsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: Client Api Version. Constant value: "2015-05-01". + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2015-05-01". """ models = models @@ -42,7 +42,8 @@ def list_by_resource_group( """Get all Application Insights web tests defined within a specified resource group. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -58,16 +59,16 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } 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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -75,7 +76,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -84,9 +85,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -104,12 +104,14 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests'} def get( self, resource_group_name, web_test_name, custom_headers=None, raw=False, **operation_config): """Get a specific Application Insights web test definition. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param web_test_name: The name of the Application Insights webtest resource. @@ -125,21 +127,21 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}' + url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'webTestName': self._serialize.url("web_test_name", web_test_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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -148,8 +150,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -166,12 +168,14 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}'} def create_or_update( self, resource_group_name, web_test_name, web_test_definition, custom_headers=None, raw=False, **operation_config): """Creates or updates an Application Insights web test definition. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param web_test_name: The name of the Application Insights webtest resource. @@ -191,20 +195,21 @@ def create_or_update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'webTestName': self._serialize.url("web_test_name", web_test_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') + 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()) @@ -217,9 +222,8 @@ def create_or_update( body_content = self._serialize.body(web_test_definition, 'WebTest') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -236,12 +240,14 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}'} def update_tags( self, resource_group_name, web_test_name, tags=None, custom_headers=None, raw=False, **operation_config): """Creates or updates an Application Insights web test definition. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param web_test_name: The name of the Application Insights webtest resource. @@ -261,20 +267,21 @@ def update_tags( web_test_tags = models.TagsResource(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}' + url = self.update_tags.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'webTestName': self._serialize.url("web_test_name", web_test_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') + 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()) @@ -287,9 +294,8 @@ def update_tags( body_content = self._serialize.body(web_test_tags, 'TagsResource') # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -306,12 +312,14 @@ def update_tags( return client_raw_response return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}'} def delete( self, resource_group_name, web_test_name, custom_headers=None, raw=False, **operation_config): """Deletes an Application Insights web test. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param web_test_name: The name of the Application Insights webtest resource. @@ -326,21 +334,20 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}' + url = self.delete.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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\._\(\)]+$'), 'webTestName': self._serialize.url("web_test_name", web_test_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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -349,8 +356,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -360,10 +367,11 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}'} def list( self, custom_headers=None, raw=False, **operation_config): - """Get all Application Insights web test alerts definitioned within a + """Get all Application Insights web test alerts definitions within a subscription. :param dict custom_headers: headers that will be added to the request @@ -380,15 +388,88 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/microsoft.insights/webtests' + url = self.list.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['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) + 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 + deserialized = models.WebTestPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.WebTestPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/webtests'} + + def list_by_component( + self, component_name, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Get all Application Insights web tests defined for the specified + component. + + :param component_name: The name of the Application Insights component + resource. + :type component_name: str + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of WebTest + :rtype: + ~azure.mgmt.applicationinsights.models.WebTestPaged[~azure.mgmt.applicationinsights.models.WebTest] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_component.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'componentName': self._serialize.url("component_name", component_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } 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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -396,7 +477,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -405,9 +486,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -425,3 +505,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_component.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{componentName}/webtests'} diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/storage_insights_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/work_item_configurations_operations.py similarity index 55% rename from azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/storage_insights_operations.py rename to azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/work_item_configurations_operations.py index 3cd3adc2ed36..1a9641ff6bc5 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/storage_insights_operations.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/work_item_configurations_operations.py @@ -16,14 +16,14 @@ from .. import models -class StorageInsightsOperations(object): - """StorageInsightsOperations operations. +class WorkItemConfigurationsOperations(object): + """WorkItemConfigurationsOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2015-03-20". + :ivar api_version: The API version to use for this operation. Constant value: "2015-05-01". """ models = models @@ -33,52 +33,122 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-03-20" + self.api_version = "2015-05-01" self.config = config - def create_or_update( - self, resource_group_name, workspace_name, storage_insight_name, parameters, custom_headers=None, raw=False, **operation_config): - """Create or update a storage insight. + def list( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets the list work item configurations that exist for the application. - :param resource_group_name: The name of the resource group to get. The - name is case insensitive. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str - :param workspace_name: Log Analytics Workspace name that will contain - the storageInsightsConfigs resource - :type workspace_name: str - :param storage_insight_name: Name of the storageInsightsConfigs - resource - :type storage_insight_name: str - :param parameters: The parameters required to create or update a - storage insight. - :type parameters: ~azure.mgmt.loganalytics.models.StorageInsight + :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: StorageInsight or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.loganalytics.models.StorageInsight or - ~msrest.pipeline.ClientRawResponse + :return: An iterator like instance of WorkItemConfiguration + :rtype: + ~azure.mgmt.applicationinsights.models.WorkItemConfigurationPaged[~azure.mgmt.applicationinsights.models.WorkItemConfiguration] + :raises: + :class:`WorkItemConfigurationErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + '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) + + 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) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.WorkItemConfigurationErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.WorkItemConfigurationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.WorkItemConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs'} + + def create( + self, resource_group_name, resource_name, work_item_configuration_properties, custom_headers=None, raw=False, **operation_config): + """Create a work item configuration for an Application Insights component. + + :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 work_item_configuration_properties: Properties that need to be + specified to create a work item configuration of a Application + Insights component. + :type work_item_configuration_properties: + ~azure.mgmt.applicationinsights.models.WorkItemCreateConfiguration + :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: WorkItemConfiguration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.applicationinsights.models.WorkItemConfiguration + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.create_or_update.metadata['url'] + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), - 'storageInsightName': self._serialize.url("storage_insight_name", storage_insight_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + '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') + 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()) @@ -88,14 +158,13 @@ def create_or_update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'StorageInsight') + body_content = self._serialize.body(work_item_configuration_properties, 'WorkItemCreateConfiguration') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 201]: + if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -103,57 +172,51 @@ def create_or_update( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('StorageInsight', response) - if response.status_code == 201: - deserialized = self._deserialize('StorageInsight', response) + deserialized = self._deserialize('WorkItemConfiguration', 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.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}'} + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs'} - def get( - self, resource_group_name, workspace_name, storage_insight_name, custom_headers=None, raw=False, **operation_config): - """Gets a storage insight instance. + def get_default( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets default work item configurations that exist for the application. - :param resource_group_name: The name of the resource group to get. The - name is case insensitive. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str - :param workspace_name: Log Analytics Workspace name that contains the - storageInsightsConfigs resource - :type workspace_name: str - :param storage_insight_name: Name of the storageInsightsConfigs - resource - :type storage_insight_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: StorageInsight or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.loganalytics.models.StorageInsight or - ~msrest.pipeline.ClientRawResponse + :return: WorkItemConfiguration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.applicationinsights.models.WorkItemConfiguration + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.get.metadata['url'] + url = self.get_default.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), - 'storageInsightName': self._serialize.url("storage_insight_name", storage_insight_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + '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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -162,8 +225,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -173,54 +236,55 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('StorageInsight', response) + deserialized = self._deserialize('WorkItemConfiguration', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}'} + get_default.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/DefaultWorkItemConfig'} def delete( - self, resource_group_name, workspace_name, storage_insight_name, custom_headers=None, raw=False, **operation_config): - """Deletes a storageInsightsConfigs resource. + self, resource_group_name, resource_name, work_item_config_id, custom_headers=None, raw=False, **operation_config): + """Delete a work item configuration of an Application Insights component. - :param resource_group_name: The name of the resource group to get. The - name is case insensitive. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str - :param workspace_name: Log Analytics Workspace name that contains the - storageInsightsConfigs resource - :type workspace_name: str - :param storage_insight_name: Name of the storageInsightsConfigs - resource - :type storage_insight_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param work_item_config_id: The unique work item configuration Id. + This can be either friendly name of connector as defined in connector + configuration + :type work_item_config_id: 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 + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), - 'storageInsightName': self._serialize.url("storage_insight_name", storage_insight_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'workItemConfigId': self._serialize.url("work_item_config_id", work_item_config_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -229,88 +293,22 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 204]: + if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}'} - - def list_by_workspace( - self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): - """Lists the storage insight instances within a workspace. - - :param resource_group_name: The name of the resource group to get. The - name is case insensitive. - :type resource_group_name: str - :param workspace_name: Log Analytics Workspace name that will contain - the storageInsightsConfigs resource - :type workspace_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of StorageInsight - :rtype: - ~azure.mgmt.loganalytics.models.StorageInsightPaged[~azure.mgmt.loganalytics.models.StorageInsight] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_workspace.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + deserialized = None - # Deserialize response - deserialized = models.StorageInsightPaged(internal_paging, self._deserialize.dependencies) + if response.status_code == 200: + deserialized = self._deserialize('object', response) if raw: - header_dict = {} - client_raw_response = models.StorageInsightPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/workbooks_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/workbooks_operations.py new file mode 100644 index 000000000000..89a6b02d5949 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/workbooks_operations.py @@ -0,0 +1,381 @@ +# 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 WorkbooksOperations(object): + """WorkbooksOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: 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 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.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 Workbook + :rtype: + ~azure.mgmt.applicationinsights.models.WorkbookPaged[~azure.mgmt.applicationinsights.models.Workbook] + :raises: + :class:`WorkbookErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + '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) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.WorkbookErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.WorkbookPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.WorkbookPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks'} + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Get a single 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: Workbook or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.applicationinsights.models.Workbook or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`WorkbookErrorException` + """ + # 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.WorkbookErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Workbook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} + + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Delete a 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:`WorkbookErrorException` + """ + # 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.WorkbookErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{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): + """Create a new 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 workbook. + :type workbook_properties: + ~azure.mgmt.applicationinsights.models.Workbook + :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: Workbook or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.applicationinsights.models.Workbook or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`WorkbookErrorException` + """ + # 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, 'Workbook') + + # 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.WorkbookErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Workbook', response) + if response.status_code == 201: + deserialized = self._deserialize('Workbook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} + + def update( + self, resource_group_name, resource_name, workbook_properties, custom_headers=None, raw=False, **operation_config): + """Updates a 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 workbook. + :type workbook_properties: + ~azure.mgmt.applicationinsights.models.Workbook + :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: Workbook or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.applicationinsights.models.Workbook or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`WorkbookErrorException` + """ + # 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, 'Workbook') + + # 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.WorkbookErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Workbook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/version.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/version.py index e7efe25ea7e0..e0ec669828cb 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/version.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.1" +VERSION = "0.1.0" diff --git a/azure-mgmt-applicationinsights/setup.py b/azure-mgmt-applicationinsights/setup.py index 5f95dcc02668..574bc7f2bf4c 100644 --- a/azure-mgmt-applicationinsights/setup.py +++ b/azure-mgmt-applicationinsights/setup.py @@ -53,6 +53,7 @@ version=version, description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', license='MIT License', author='Microsoft Corporation', author_email='azpysdkhelp@microsoft.com', diff --git a/azure-mgmt-loganalytics/MANIFEST.in b/azure-mgmt-loganalytics/MANIFEST.in index bb37a2723dae..e4884efef41b 100644 --- a/azure-mgmt-loganalytics/MANIFEST.in +++ b/azure-mgmt-loganalytics/MANIFEST.in @@ -1 +1,5 @@ +recursive-include tests *.py *.yaml include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-loganalytics/README.rst b/azure-mgmt-loganalytics/README.rst index b5a30d4f7307..45beb2b8c465 100644 --- a/azure-mgmt-loganalytics/README.rst +++ b/azure-mgmt-loganalytics/README.rst @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see For a more complete set of Azure libraries, see the `azure `__ bundle package. -Compatibility -============= - -**IMPORTANT**: If you have an earlier version of the azure package -(version < 1.0), you should uninstall it before installing this package. - -You can check the version using pip: - -.. code:: shell - - pip freeze - -If you see azure==0.11.0 (or any version below 1.0), uninstall it first: - -.. code:: shell - - pip uninstall azure - - Usage ===== diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/__init__.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/__init__.py index 9a73494da9ba..acf344a86746 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/__init__.py +++ b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/__init__.py @@ -9,10 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .log_analytics_management_client import LogAnalyticsManagementClient +from .operational_insights_management_client import OperationalInsightsManagementClient from .version import VERSION -__all__ = ['LogAnalyticsManagementClient'] +__all__ = ['OperationalInsightsManagementClient'] __version__ = VERSION diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/__init__.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/__init__.py index 10363263f00d..1090115d9be7 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/__init__.py +++ b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/__init__.py @@ -10,29 +10,6 @@ # -------------------------------------------------------------------------- try: - from .link_target_py3 import LinkTarget - from .tag_py3 import Tag - from .core_summary_py3 import CoreSummary - from .search_sort_py3 import SearchSort - from .search_metadata_schema_py3 import SearchMetadataSchema - from .search_metadata_py3 import SearchMetadata - from .saved_search_py3 import SavedSearch - from .saved_searches_list_result_py3 import SavedSearchesListResult - from .search_error_py3 import SearchError - from .search_results_response_py3 import SearchResultsResponse - from .search_schema_value_py3 import SearchSchemaValue - from .search_get_schema_response_py3 import SearchGetSchemaResponse - from .search_highlight_py3 import SearchHighlight - from .search_parameters_py3 import SearchParameters - from .storage_account_py3 import StorageAccount - from .storage_insight_status_py3 import StorageInsightStatus - from .storage_insight_py3 import StorageInsight - from .resource_py3 import Resource - from .proxy_resource_py3 import ProxyResource - from .workspace_purge_body_filters_py3 import WorkspacePurgeBodyFilters - from .workspace_purge_body_py3 import WorkspacePurgeBody - from .workspace_purge_response_py3 import WorkspacePurgeResponse - from .workspace_purge_status_response_py3 import WorkspacePurgeStatusResponse from .operation_display_py3 import OperationDisplay from .operation_py3 import Operation from .linked_service_py3 import LinkedService @@ -45,30 +22,9 @@ from .management_group_py3 import ManagementGroup from .sku_py3 import Sku from .workspace_py3 import Workspace + from .resource_py3 import Resource + from .proxy_resource_py3 import ProxyResource except (SyntaxError, ImportError): - from .link_target import LinkTarget - from .tag import Tag - from .core_summary import CoreSummary - from .search_sort import SearchSort - from .search_metadata_schema import SearchMetadataSchema - from .search_metadata import SearchMetadata - from .saved_search import SavedSearch - from .saved_searches_list_result import SavedSearchesListResult - from .search_error import SearchError - from .search_results_response import SearchResultsResponse - from .search_schema_value import SearchSchemaValue - from .search_get_schema_response import SearchGetSchemaResponse - from .search_highlight import SearchHighlight - from .search_parameters import SearchParameters - from .storage_account import StorageAccount - from .storage_insight_status import StorageInsightStatus - from .storage_insight import StorageInsight - from .resource import Resource - from .proxy_resource import ProxyResource - from .workspace_purge_body_filters import WorkspacePurgeBodyFilters - from .workspace_purge_body import WorkspacePurgeBody - from .workspace_purge_response import WorkspacePurgeResponse - from .workspace_purge_status_response import WorkspacePurgeStatusResponse from .operation_display import OperationDisplay from .operation import Operation from .linked_service import LinkedService @@ -81,46 +37,21 @@ from .management_group import ManagementGroup from .sku import Sku from .workspace import Workspace -from .storage_insight_paged import StorageInsightPaged + from .resource import Resource + from .proxy_resource import ProxyResource +from .linked_service_paged import LinkedServicePaged +from .data_source_paged import DataSourcePaged from .usage_metric_paged import UsageMetricPaged from .management_group_paged import ManagementGroupPaged from .workspace_paged import WorkspacePaged -from .linked_service_paged import LinkedServicePaged -from .data_source_paged import DataSourcePaged from .operation_paged import OperationPaged -from .log_analytics_management_client_enums import ( - SearchSortEnum, - StorageInsightState, - PurgeState, +from .operational_insights_management_client_enums import ( DataSourceKind, SkuNameEnum, EntityStatus, ) __all__ = [ - 'LinkTarget', - 'Tag', - 'CoreSummary', - 'SearchSort', - 'SearchMetadataSchema', - 'SearchMetadata', - 'SavedSearch', - 'SavedSearchesListResult', - 'SearchError', - 'SearchResultsResponse', - 'SearchSchemaValue', - 'SearchGetSchemaResponse', - 'SearchHighlight', - 'SearchParameters', - 'StorageAccount', - 'StorageInsightStatus', - 'StorageInsight', - 'Resource', - 'ProxyResource', - 'WorkspacePurgeBodyFilters', - 'WorkspacePurgeBody', - 'WorkspacePurgeResponse', - 'WorkspacePurgeStatusResponse', 'OperationDisplay', 'Operation', 'LinkedService', @@ -133,16 +64,14 @@ 'ManagementGroup', 'Sku', 'Workspace', - 'StorageInsightPaged', + 'Resource', + 'ProxyResource', + 'LinkedServicePaged', + 'DataSourcePaged', 'UsageMetricPaged', 'ManagementGroupPaged', 'WorkspacePaged', - 'LinkedServicePaged', - 'DataSourcePaged', 'OperationPaged', - 'SearchSortEnum', - 'StorageInsightState', - 'PurgeState', 'DataSourceKind', 'SkuNameEnum', 'EntityStatus', diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/core_summary.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/core_summary.py deleted file mode 100644 index 8facbdb80089..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/core_summary.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CoreSummary(Model): - """The core summary of a search. - - All required parameters must be populated in order to send to Azure. - - :param status: The status of a core summary. - :type status: str - :param number_of_documents: Required. The number of documents of a core - summary. - :type number_of_documents: long - """ - - _validation = { - 'number_of_documents': {'required': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'number_of_documents': {'key': 'numberOfDocuments', 'type': 'long'}, - } - - def __init__(self, **kwargs): - super(CoreSummary, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.number_of_documents = kwargs.get('number_of_documents', None) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/core_summary_py3.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/core_summary_py3.py deleted file mode 100644 index adb9e80f5479..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/core_summary_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CoreSummary(Model): - """The core summary of a search. - - All required parameters must be populated in order to send to Azure. - - :param status: The status of a core summary. - :type status: str - :param number_of_documents: Required. The number of documents of a core - summary. - :type number_of_documents: long - """ - - _validation = { - 'number_of_documents': {'required': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'number_of_documents': {'key': 'numberOfDocuments', 'type': 'long'}, - } - - def __init__(self, *, number_of_documents: int, status: str=None, **kwargs) -> None: - super(CoreSummary, self).__init__(**kwargs) - self.status = status - self.number_of_documents = number_of_documents diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/link_target.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/link_target.py deleted file mode 100644 index bd3839982bd6..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/link_target.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class LinkTarget(Model): - """Metadata for a workspace that isn't linked to an Azure subscription. - - :param customer_id: The GUID that uniquely identifies the workspace. - :type customer_id: str - :param display_name: The display name of the workspace. - :type display_name: str - :param workspace_name: The DNS valid workspace name. - :type workspace_name: str - :param location: The location of the workspace. - :type location: str - """ - - _attribute_map = { - 'customer_id': {'key': 'customerId', 'type': 'str'}, - 'display_name': {'key': 'accountName', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(LinkTarget, self).__init__(**kwargs) - self.customer_id = kwargs.get('customer_id', None) - self.display_name = kwargs.get('display_name', None) - self.workspace_name = kwargs.get('workspace_name', None) - self.location = kwargs.get('location', None) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/link_target_py3.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/link_target_py3.py deleted file mode 100644 index cbc600ad0573..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/link_target_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class LinkTarget(Model): - """Metadata for a workspace that isn't linked to an Azure subscription. - - :param customer_id: The GUID that uniquely identifies the workspace. - :type customer_id: str - :param display_name: The display name of the workspace. - :type display_name: str - :param workspace_name: The DNS valid workspace name. - :type workspace_name: str - :param location: The location of the workspace. - :type location: str - """ - - _attribute_map = { - 'customer_id': {'key': 'customerId', 'type': 'str'}, - 'display_name': {'key': 'accountName', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__(self, *, customer_id: str=None, display_name: str=None, workspace_name: str=None, location: str=None, **kwargs) -> None: - super(LinkTarget, self).__init__(**kwargs) - self.customer_id = customer_id - self.display_name = display_name - self.workspace_name = workspace_name - self.location = location diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/log_analytics_management_client_enums.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/operational_insights_management_client_enums.py similarity index 86% rename from azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/log_analytics_management_client_enums.py rename to azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/operational_insights_management_client_enums.py index 22641d5bc333..2e5fba5de75d 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/log_analytics_management_client_enums.py +++ b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/operational_insights_management_client_enums.py @@ -12,24 +12,6 @@ from enum import Enum -class SearchSortEnum(str, Enum): - - asc = "asc" - desc = "desc" - - -class StorageInsightState(str, Enum): - - ok = "OK" - error = "ERROR" - - -class PurgeState(str, Enum): - - pending = "Pending" - completed = "Completed" - - class DataSourceKind(str, Enum): azure_activity_log = "AzureActivityLog" @@ -54,7 +36,6 @@ class SkuNameEnum(str, Enum): free = "Free" standard = "Standard" premium = "Premium" - unlimited = "Unlimited" per_node = "PerNode" per_gb2018 = "PerGB2018" standalone = "Standalone" diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/saved_search.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/saved_search.py deleted file mode 100644 index 7617dcd99070..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/saved_search.py +++ /dev/null @@ -1,80 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SavedSearch(Model): - """Value object for saved search results. - - 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: The id of the saved search. - :vartype id: str - :ivar name: The name of the saved search. - :vartype name: str - :ivar type: The type of the saved search. - :vartype type: str - :param e_tag: The etag of the saved search. - :type e_tag: str - :param category: Required. The category of the saved search. This helps - the user to find a saved search faster. - :type category: str - :param display_name: Required. Saved search display name. - :type display_name: str - :param query: Required. The query expression for the saved search. Please - see - https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-search-reference - for reference. - :type query: str - :param version: Required. The version number of the query lanuage. Only - verion 1 is allowed here. - :type version: long - :param tags: The tags attached to the saved search. - :type tags: list[~azure.mgmt.loganalytics.models.Tag] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'category': {'required': True}, - 'display_name': {'required': True}, - 'query': {'required': True}, - 'version': {'required': True, 'maximum': 1, 'minimum': 1}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - 'category': {'key': 'properties.category', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'query': {'key': 'properties.query', 'type': 'str'}, - 'version': {'key': 'properties.version', 'type': 'long'}, - 'tags': {'key': 'properties.tags', 'type': '[Tag]'}, - } - - def __init__(self, **kwargs): - super(SavedSearch, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.e_tag = kwargs.get('e_tag', None) - self.category = kwargs.get('category', None) - self.display_name = kwargs.get('display_name', None) - self.query = kwargs.get('query', None) - self.version = kwargs.get('version', None) - self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/saved_search_py3.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/saved_search_py3.py deleted file mode 100644 index a994394bfc7a..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/saved_search_py3.py +++ /dev/null @@ -1,80 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SavedSearch(Model): - """Value object for saved search results. - - 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: The id of the saved search. - :vartype id: str - :ivar name: The name of the saved search. - :vartype name: str - :ivar type: The type of the saved search. - :vartype type: str - :param e_tag: The etag of the saved search. - :type e_tag: str - :param category: Required. The category of the saved search. This helps - the user to find a saved search faster. - :type category: str - :param display_name: Required. Saved search display name. - :type display_name: str - :param query: Required. The query expression for the saved search. Please - see - https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-search-reference - for reference. - :type query: str - :param version: Required. The version number of the query lanuage. Only - verion 1 is allowed here. - :type version: long - :param tags: The tags attached to the saved search. - :type tags: list[~azure.mgmt.loganalytics.models.Tag] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'category': {'required': True}, - 'display_name': {'required': True}, - 'query': {'required': True}, - 'version': {'required': True, 'maximum': 1, 'minimum': 1}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - 'category': {'key': 'properties.category', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'query': {'key': 'properties.query', 'type': 'str'}, - 'version': {'key': 'properties.version', 'type': 'long'}, - 'tags': {'key': 'properties.tags', 'type': '[Tag]'}, - } - - def __init__(self, *, category: str, display_name: str, query: str, version: int, e_tag: str=None, tags=None, **kwargs) -> None: - super(SavedSearch, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.e_tag = e_tag - self.category = category - self.display_name = display_name - self.query = query - self.version = version - self.tags = tags diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/saved_searches_list_result.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/saved_searches_list_result.py deleted file mode 100644 index 74509ad4e0d2..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/saved_searches_list_result.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SavedSearchesListResult(Model): - """The saved search operation response. - - :param metadata: The metadata from search results. - :type metadata: ~azure.mgmt.loganalytics.models.SearchMetadata - :param value: The array of result values. - :type value: list[~azure.mgmt.loganalytics.models.SavedSearch] - """ - - _attribute_map = { - 'metadata': {'key': 'metaData', 'type': 'SearchMetadata'}, - 'value': {'key': 'value', 'type': '[SavedSearch]'}, - } - - def __init__(self, **kwargs): - super(SavedSearchesListResult, self).__init__(**kwargs) - self.metadata = kwargs.get('metadata', None) - self.value = kwargs.get('value', None) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/saved_searches_list_result_py3.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/saved_searches_list_result_py3.py deleted file mode 100644 index 10f174732fdc..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/saved_searches_list_result_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SavedSearchesListResult(Model): - """The saved search operation response. - - :param metadata: The metadata from search results. - :type metadata: ~azure.mgmt.loganalytics.models.SearchMetadata - :param value: The array of result values. - :type value: list[~azure.mgmt.loganalytics.models.SavedSearch] - """ - - _attribute_map = { - 'metadata': {'key': 'metaData', 'type': 'SearchMetadata'}, - 'value': {'key': 'value', 'type': '[SavedSearch]'}, - } - - def __init__(self, *, metadata=None, value=None, **kwargs) -> None: - super(SavedSearchesListResult, self).__init__(**kwargs) - self.metadata = metadata - self.value = value diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_get_schema_response.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_get_schema_response.py deleted file mode 100644 index 91e914734fc0..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_get_schema_response.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SearchGetSchemaResponse(Model): - """The get schema operation response. - - :param metadata: The metadata from search results. - :type metadata: ~azure.mgmt.loganalytics.models.SearchMetadata - :param value: The array of result values. - :type value: list[~azure.mgmt.loganalytics.models.SearchSchemaValue] - """ - - _attribute_map = { - 'metadata': {'key': 'metadata', 'type': 'SearchMetadata'}, - 'value': {'key': 'value', 'type': '[SearchSchemaValue]'}, - } - - def __init__(self, **kwargs): - super(SearchGetSchemaResponse, self).__init__(**kwargs) - self.metadata = kwargs.get('metadata', None) - self.value = kwargs.get('value', None) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_get_schema_response_py3.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_get_schema_response_py3.py deleted file mode 100644 index 7d64e05b18df..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_get_schema_response_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SearchGetSchemaResponse(Model): - """The get schema operation response. - - :param metadata: The metadata from search results. - :type metadata: ~azure.mgmt.loganalytics.models.SearchMetadata - :param value: The array of result values. - :type value: list[~azure.mgmt.loganalytics.models.SearchSchemaValue] - """ - - _attribute_map = { - 'metadata': {'key': 'metadata', 'type': 'SearchMetadata'}, - 'value': {'key': 'value', 'type': '[SearchSchemaValue]'}, - } - - def __init__(self, *, metadata=None, value=None, **kwargs) -> None: - super(SearchGetSchemaResponse, self).__init__(**kwargs) - self.metadata = metadata - self.value = value diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_metadata.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_metadata.py deleted file mode 100644 index ba7f7a3dcffc..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_metadata.py +++ /dev/null @@ -1,92 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SearchMetadata(Model): - """Metadata for search results. - - :param search_id: The request id of the search. - :type search_id: str - :param result_type: The search result type. - :type result_type: str - :param total: The total number of search results. - :type total: long - :param top: The number of top search results. - :type top: long - :param id: The id of the search results request. - :type id: str - :param core_summaries: The core summaries. - :type core_summaries: list[~azure.mgmt.loganalytics.models.CoreSummary] - :param status: The status of the search results. - :type status: str - :param start_time: The start time for the search. - :type start_time: datetime - :param last_updated: The time of last update. - :type last_updated: datetime - :param e_tag: The ETag of the search results. - :type e_tag: str - :param sort: How the results are sorted. - :type sort: list[~azure.mgmt.loganalytics.models.SearchSort] - :param request_time: The request time. - :type request_time: long - :param aggregated_value_field: The aggregated value field. - :type aggregated_value_field: str - :param aggregated_grouping_fields: The aggregated grouping fields. - :type aggregated_grouping_fields: str - :param sum: The sum of all aggregates returned in the result set. - :type sum: long - :param max: The max of all aggregates returned in the result set. - :type max: long - :param schema: The schema. - :type schema: ~azure.mgmt.loganalytics.models.SearchMetadataSchema - """ - - _attribute_map = { - 'search_id': {'key': 'requestId', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'total': {'key': 'total', 'type': 'long'}, - 'top': {'key': 'top', 'type': 'long'}, - 'id': {'key': 'id', 'type': 'str'}, - 'core_summaries': {'key': 'coreSummaries', 'type': '[CoreSummary]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - 'sort': {'key': 'sort', 'type': '[SearchSort]'}, - 'request_time': {'key': 'requestTime', 'type': 'long'}, - 'aggregated_value_field': {'key': 'aggregatedValueField', 'type': 'str'}, - 'aggregated_grouping_fields': {'key': 'aggregatedGroupingFields', 'type': 'str'}, - 'sum': {'key': 'sum', 'type': 'long'}, - 'max': {'key': 'max', 'type': 'long'}, - 'schema': {'key': 'schema', 'type': 'SearchMetadataSchema'}, - } - - def __init__(self, **kwargs): - super(SearchMetadata, self).__init__(**kwargs) - self.search_id = kwargs.get('search_id', None) - self.result_type = kwargs.get('result_type', None) - self.total = kwargs.get('total', None) - self.top = kwargs.get('top', None) - self.id = kwargs.get('id', None) - self.core_summaries = kwargs.get('core_summaries', None) - self.status = kwargs.get('status', None) - self.start_time = kwargs.get('start_time', None) - self.last_updated = kwargs.get('last_updated', None) - self.e_tag = kwargs.get('e_tag', None) - self.sort = kwargs.get('sort', None) - self.request_time = kwargs.get('request_time', None) - self.aggregated_value_field = kwargs.get('aggregated_value_field', None) - self.aggregated_grouping_fields = kwargs.get('aggregated_grouping_fields', None) - self.sum = kwargs.get('sum', None) - self.max = kwargs.get('max', None) - self.schema = kwargs.get('schema', None) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_metadata_py3.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_metadata_py3.py deleted file mode 100644 index 11793a3e9b88..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_metadata_py3.py +++ /dev/null @@ -1,92 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SearchMetadata(Model): - """Metadata for search results. - - :param search_id: The request id of the search. - :type search_id: str - :param result_type: The search result type. - :type result_type: str - :param total: The total number of search results. - :type total: long - :param top: The number of top search results. - :type top: long - :param id: The id of the search results request. - :type id: str - :param core_summaries: The core summaries. - :type core_summaries: list[~azure.mgmt.loganalytics.models.CoreSummary] - :param status: The status of the search results. - :type status: str - :param start_time: The start time for the search. - :type start_time: datetime - :param last_updated: The time of last update. - :type last_updated: datetime - :param e_tag: The ETag of the search results. - :type e_tag: str - :param sort: How the results are sorted. - :type sort: list[~azure.mgmt.loganalytics.models.SearchSort] - :param request_time: The request time. - :type request_time: long - :param aggregated_value_field: The aggregated value field. - :type aggregated_value_field: str - :param aggregated_grouping_fields: The aggregated grouping fields. - :type aggregated_grouping_fields: str - :param sum: The sum of all aggregates returned in the result set. - :type sum: long - :param max: The max of all aggregates returned in the result set. - :type max: long - :param schema: The schema. - :type schema: ~azure.mgmt.loganalytics.models.SearchMetadataSchema - """ - - _attribute_map = { - 'search_id': {'key': 'requestId', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'total': {'key': 'total', 'type': 'long'}, - 'top': {'key': 'top', 'type': 'long'}, - 'id': {'key': 'id', 'type': 'str'}, - 'core_summaries': {'key': 'coreSummaries', 'type': '[CoreSummary]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - 'sort': {'key': 'sort', 'type': '[SearchSort]'}, - 'request_time': {'key': 'requestTime', 'type': 'long'}, - 'aggregated_value_field': {'key': 'aggregatedValueField', 'type': 'str'}, - 'aggregated_grouping_fields': {'key': 'aggregatedGroupingFields', 'type': 'str'}, - 'sum': {'key': 'sum', 'type': 'long'}, - 'max': {'key': 'max', 'type': 'long'}, - 'schema': {'key': 'schema', 'type': 'SearchMetadataSchema'}, - } - - def __init__(self, *, search_id: str=None, result_type: str=None, total: int=None, top: int=None, id: str=None, core_summaries=None, status: str=None, start_time=None, last_updated=None, e_tag: str=None, sort=None, request_time: int=None, aggregated_value_field: str=None, aggregated_grouping_fields: str=None, sum: int=None, max: int=None, schema=None, **kwargs) -> None: - super(SearchMetadata, self).__init__(**kwargs) - self.search_id = search_id - self.result_type = result_type - self.total = total - self.top = top - self.id = id - self.core_summaries = core_summaries - self.status = status - self.start_time = start_time - self.last_updated = last_updated - self.e_tag = e_tag - self.sort = sort - self.request_time = request_time - self.aggregated_value_field = aggregated_value_field - self.aggregated_grouping_fields = aggregated_grouping_fields - self.sum = sum - self.max = max - self.schema = schema diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_parameters.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_parameters.py deleted file mode 100644 index 721438021b2d..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_parameters.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SearchParameters(Model): - """Parameters specifying the search query and range. - - All required parameters must be populated in order to send to Azure. - - :param top: The number to get from the top. - :type top: long - :param highlight: The highlight that looks for all occurences of a string. - :type highlight: ~azure.mgmt.loganalytics.models.SearchHighlight - :param query: Required. The query to search. - :type query: str - :param start: The start date filter, so the only query results returned - are after this date. - :type start: datetime - :param end: The end date filter, so the only query results returned are - before this date. - :type end: datetime - """ - - _validation = { - 'query': {'required': True}, - } - - _attribute_map = { - 'top': {'key': 'top', 'type': 'long'}, - 'highlight': {'key': 'highlight', 'type': 'SearchHighlight'}, - 'query': {'key': 'query', 'type': 'str'}, - 'start': {'key': 'start', 'type': 'iso-8601'}, - 'end': {'key': 'end', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(SearchParameters, self).__init__(**kwargs) - self.top = kwargs.get('top', None) - self.highlight = kwargs.get('highlight', None) - self.query = kwargs.get('query', None) - self.start = kwargs.get('start', None) - self.end = kwargs.get('end', None) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_parameters_py3.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_parameters_py3.py deleted file mode 100644 index 8789f694abfc..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_parameters_py3.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SearchParameters(Model): - """Parameters specifying the search query and range. - - All required parameters must be populated in order to send to Azure. - - :param top: The number to get from the top. - :type top: long - :param highlight: The highlight that looks for all occurences of a string. - :type highlight: ~azure.mgmt.loganalytics.models.SearchHighlight - :param query: Required. The query to search. - :type query: str - :param start: The start date filter, so the only query results returned - are after this date. - :type start: datetime - :param end: The end date filter, so the only query results returned are - before this date. - :type end: datetime - """ - - _validation = { - 'query': {'required': True}, - } - - _attribute_map = { - 'top': {'key': 'top', 'type': 'long'}, - 'highlight': {'key': 'highlight', 'type': 'SearchHighlight'}, - 'query': {'key': 'query', 'type': 'str'}, - 'start': {'key': 'start', 'type': 'iso-8601'}, - 'end': {'key': 'end', 'type': 'iso-8601'}, - } - - def __init__(self, *, query: str, top: int=None, highlight=None, start=None, end=None, **kwargs) -> None: - super(SearchParameters, self).__init__(**kwargs) - self.top = top - self.highlight = highlight - self.query = query - self.start = start - self.end = end diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_results_response_py3.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_results_response_py3.py deleted file mode 100644 index 414d2aae709b..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_results_response_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SearchResultsResponse(Model): - """The get search result operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The id of the search, which includes the full url. - :vartype id: str - :param metadata: The metadata from search results. - :type metadata: ~azure.mgmt.loganalytics.models.SearchMetadata - :param value: The array of result values. - :type value: list[object] - :param error: The error. - :type error: ~azure.mgmt.loganalytics.models.SearchError - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'metadata': {'key': 'metaData', 'type': 'SearchMetadata'}, - 'value': {'key': 'value', 'type': '[object]'}, - 'error': {'key': 'error', 'type': 'SearchError'}, - } - - def __init__(self, *, metadata=None, value=None, error=None, **kwargs) -> None: - super(SearchResultsResponse, self).__init__(**kwargs) - self.id = None - self.metadata = metadata - self.value = value - self.error = error diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_schema_value.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_schema_value.py deleted file mode 100644 index 56fe3e7089a6..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_schema_value.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SearchSchemaValue(Model): - """Value object for schema results. - - All required parameters must be populated in order to send to Azure. - - :param name: The name of the schema. - :type name: str - :param display_name: The display name of the schema. - :type display_name: str - :param type: The type. - :type type: str - :param indexed: Required. The boolean that indicates the field is - searchable as free text. - :type indexed: bool - :param stored: Required. The boolean that indicates whether or not the - field is stored. - :type stored: bool - :param facet: Required. The boolean that indicates whether or not the - field is a facet. - :type facet: bool - :param owner_type: The array of workflows containing the field. - :type owner_type: list[str] - """ - - _validation = { - 'indexed': {'required': True}, - 'stored': {'required': True}, - 'facet': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'indexed': {'key': 'indexed', 'type': 'bool'}, - 'stored': {'key': 'stored', 'type': 'bool'}, - 'facet': {'key': 'facet', 'type': 'bool'}, - 'owner_type': {'key': 'ownerType', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(SearchSchemaValue, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.type = kwargs.get('type', None) - self.indexed = kwargs.get('indexed', None) - self.stored = kwargs.get('stored', None) - self.facet = kwargs.get('facet', None) - self.owner_type = kwargs.get('owner_type', None) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_schema_value_py3.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_schema_value_py3.py deleted file mode 100644 index f29fd92f0aa4..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_schema_value_py3.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SearchSchemaValue(Model): - """Value object for schema results. - - All required parameters must be populated in order to send to Azure. - - :param name: The name of the schema. - :type name: str - :param display_name: The display name of the schema. - :type display_name: str - :param type: The type. - :type type: str - :param indexed: Required. The boolean that indicates the field is - searchable as free text. - :type indexed: bool - :param stored: Required. The boolean that indicates whether or not the - field is stored. - :type stored: bool - :param facet: Required. The boolean that indicates whether or not the - field is a facet. - :type facet: bool - :param owner_type: The array of workflows containing the field. - :type owner_type: list[str] - """ - - _validation = { - 'indexed': {'required': True}, - 'stored': {'required': True}, - 'facet': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'indexed': {'key': 'indexed', 'type': 'bool'}, - 'stored': {'key': 'stored', 'type': 'bool'}, - 'facet': {'key': 'facet', 'type': 'bool'}, - 'owner_type': {'key': 'ownerType', 'type': '[str]'}, - } - - def __init__(self, *, indexed: bool, stored: bool, facet: bool, name: str=None, display_name: str=None, type: str=None, owner_type=None, **kwargs) -> None: - super(SearchSchemaValue, self).__init__(**kwargs) - self.name = name - self.display_name = display_name - self.type = type - self.indexed = indexed - self.stored = stored - self.facet = facet - self.owner_type = owner_type diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_sort_py3.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_sort_py3.py deleted file mode 100644 index 2e6c85535685..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/search_sort_py3.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SearchSort(Model): - """The sort parameters for search. - - :param name: The name of the field the search query is sorted on. - :type name: str - :param order: The sort order of the search. Possible values include: - 'asc', 'desc' - :type order: str or ~azure.mgmt.loganalytics.models.SearchSortEnum - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'order': {'key': 'order', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, order=None, **kwargs) -> None: - super(SearchSort, self).__init__(**kwargs) - self.name = name - self.order = order diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/sku.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/sku.py index 73f09793dec9..2503a0c4acd4 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/sku.py +++ b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/sku.py @@ -18,8 +18,7 @@ class Sku(Model): All required parameters must be populated in order to send to Azure. :param name: Required. The name of the SKU. Possible values include: - 'Free', 'Standard', 'Premium', 'Unlimited', 'PerNode', 'PerGB2018', - 'Standalone' + 'Free', 'Standard', 'Premium', 'PerNode', 'PerGB2018', 'Standalone' :type name: str or ~azure.mgmt.loganalytics.models.SkuNameEnum """ diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/sku_py3.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/sku_py3.py index 41a0c3d4b36b..20809cd9e380 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/sku_py3.py +++ b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/sku_py3.py @@ -18,8 +18,7 @@ class Sku(Model): All required parameters must be populated in order to send to Azure. :param name: Required. The name of the SKU. Possible values include: - 'Free', 'Standard', 'Premium', 'Unlimited', 'PerNode', 'PerGB2018', - 'Standalone' + 'Free', 'Standard', 'Premium', 'PerNode', 'PerGB2018', 'Standalone' :type name: str or ~azure.mgmt.loganalytics.models.SkuNameEnum """ diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_account.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_account.py deleted file mode 100644 index d336824ca20c..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_account.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class StorageAccount(Model): - """Describes a storage account connection. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The Azure Resource Manager ID of the storage account - resource. - :type id: str - :param key: Required. The storage account key. - :type key: str - """ - - _validation = { - 'id': {'required': True}, - 'key': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(StorageAccount, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.key = kwargs.get('key', None) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_account_py3.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_account_py3.py deleted file mode 100644 index 1df1cc8e83bb..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_account_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class StorageAccount(Model): - """Describes a storage account connection. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The Azure Resource Manager ID of the storage account - resource. - :type id: str - :param key: Required. The storage account key. - :type key: str - """ - - _validation = { - 'id': {'required': True}, - 'key': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__(self, *, id: str, key: str, **kwargs) -> None: - super(StorageAccount, self).__init__(**kwargs) - self.id = id - self.key = key diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_insight.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_insight.py deleted file mode 100644 index ce9b749756c2..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_insight.py +++ /dev/null @@ -1,71 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .proxy_resource import ProxyResource - - -class StorageInsight(ProxyResource): - """The top level storage insight resource container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param tags: Resource tags - :type tags: dict[str, str] - :param containers: The names of the blob containers that the workspace - should read - :type containers: list[str] - :param tables: The names of the Azure tables that the workspace should - read - :type tables: list[str] - :param storage_account: Required. The storage account connection details - :type storage_account: ~azure.mgmt.loganalytics.models.StorageAccount - :ivar status: The status of the storage insight - :vartype status: ~azure.mgmt.loganalytics.models.StorageInsightStatus - :param e_tag: The ETag of the storage insight. - :type e_tag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'storage_account': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'containers': {'key': 'properties.containers', 'type': '[str]'}, - 'tables': {'key': 'properties.tables', 'type': '[str]'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccount'}, - 'status': {'key': 'properties.status', 'type': 'StorageInsightStatus'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(StorageInsight, self).__init__(**kwargs) - self.containers = kwargs.get('containers', None) - self.tables = kwargs.get('tables', None) - self.storage_account = kwargs.get('storage_account', None) - self.status = None - self.e_tag = kwargs.get('e_tag', None) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_insight_py3.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_insight_py3.py deleted file mode 100644 index 17c3f9624aa9..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_insight_py3.py +++ /dev/null @@ -1,71 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .proxy_resource_py3 import ProxyResource - - -class StorageInsight(ProxyResource): - """The top level storage insight resource container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param tags: Resource tags - :type tags: dict[str, str] - :param containers: The names of the blob containers that the workspace - should read - :type containers: list[str] - :param tables: The names of the Azure tables that the workspace should - read - :type tables: list[str] - :param storage_account: Required. The storage account connection details - :type storage_account: ~azure.mgmt.loganalytics.models.StorageAccount - :ivar status: The status of the storage insight - :vartype status: ~azure.mgmt.loganalytics.models.StorageInsightStatus - :param e_tag: The ETag of the storage insight. - :type e_tag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'storage_account': {'required': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'containers': {'key': 'properties.containers', 'type': '[str]'}, - 'tables': {'key': 'properties.tables', 'type': '[str]'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccount'}, - 'status': {'key': 'properties.status', 'type': 'StorageInsightStatus'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - } - - def __init__(self, *, storage_account, tags=None, containers=None, tables=None, e_tag: str=None, **kwargs) -> None: - super(StorageInsight, self).__init__(tags=tags, **kwargs) - self.containers = containers - self.tables = tables - self.storage_account = storage_account - self.status = None - self.e_tag = e_tag diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_insight_status.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_insight_status.py deleted file mode 100644 index 06af6f749f74..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_insight_status.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class StorageInsightStatus(Model): - """The status of the storage insight. - - All required parameters must be populated in order to send to Azure. - - :param state: Required. The state of the storage insight connection to the - workspace. Possible values include: 'OK', 'ERROR' - :type state: str or ~azure.mgmt.loganalytics.models.StorageInsightState - :param description: Description of the state of the storage insight. - :type description: str - """ - - _validation = { - 'state': {'required': True}, - } - - _attribute_map = { - 'state': {'key': 'state', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(StorageInsightStatus, self).__init__(**kwargs) - self.state = kwargs.get('state', None) - self.description = kwargs.get('description', None) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_insight_status_py3.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_insight_status_py3.py deleted file mode 100644 index b30d58481193..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/storage_insight_status_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class StorageInsightStatus(Model): - """The status of the storage insight. - - All required parameters must be populated in order to send to Azure. - - :param state: Required. The state of the storage insight connection to the - workspace. Possible values include: 'OK', 'ERROR' - :type state: str or ~azure.mgmt.loganalytics.models.StorageInsightState - :param description: Description of the state of the storage insight. - :type description: str - """ - - _validation = { - 'state': {'required': True}, - } - - _attribute_map = { - 'state': {'key': 'state', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__(self, *, state, description: str=None, **kwargs) -> None: - super(StorageInsightStatus, self).__init__(**kwargs) - self.state = state - self.description = description diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/tag.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/tag.py deleted file mode 100644 index 416b195fd329..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/tag.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Tag(Model): - """A tag of a saved search. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The tag name. - :type name: str - :param value: Required. The tag value. - :type value: str - """ - - _validation = { - 'name': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Tag, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.value = kwargs.get('value', None) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/tag_py3.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/tag_py3.py deleted file mode 100644 index cf70eba079bb..000000000000 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/tag_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Tag(Model): - """A tag of a saved search. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The tag name. - :type name: str - :param value: Required. The tag value. - :type value: str - """ - - _validation = { - 'name': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, *, name: str, value: str, **kwargs) -> None: - super(Tag, self).__init__(**kwargs) - self.name = name - self.value = value diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/log_analytics_management_client.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operational_insights_management_client.py similarity index 75% rename from azure-mgmt-loganalytics/azure/mgmt/loganalytics/log_analytics_management_client.py rename to azure-mgmt-loganalytics/azure/mgmt/loganalytics/operational_insights_management_client.py index 25d5d8a10b9a..3d8f7dd9cb3b 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/log_analytics_management_client.py +++ b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operational_insights_management_client.py @@ -13,17 +13,15 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION -from .operations.storage_insights_operations import StorageInsightsOperations -from .operations.workspaces_operations import WorkspacesOperations -from .operations.saved_searches_operations import SavedSearchesOperations from .operations.linked_services_operations import LinkedServicesOperations from .operations.data_sources_operations import DataSourcesOperations +from .operations.workspaces_operations import WorkspacesOperations from .operations.operations import Operations from . import models -class LogAnalyticsManagementClientConfiguration(AzureConfiguration): - """Configuration for LogAnalyticsManagementClient +class OperationalInsightsManagementClientConfiguration(AzureConfiguration): + """Configuration for OperationalInsightsManagementClient Note that all parameters used to create this instance are saved as instance attributes. @@ -47,7 +45,7 @@ def __init__( if not base_url: base_url = 'https://management.azure.com' - super(LogAnalyticsManagementClientConfiguration, self).__init__(base_url) + super(OperationalInsightsManagementClientConfiguration, self).__init__(base_url) self.add_user_agent('azure-mgmt-loganalytics/{}'.format(VERSION)) self.add_user_agent('Azure-SDK-For-Python') @@ -56,22 +54,18 @@ def __init__( self.subscription_id = subscription_id -class LogAnalyticsManagementClient(SDKClient): - """The Log Analytics Client. +class OperationalInsightsManagementClient(SDKClient): + """Operational Insights Client :ivar config: Configuration for client. - :vartype config: LogAnalyticsManagementClientConfiguration + :vartype config: OperationalInsightsManagementClientConfiguration - :ivar storage_insights: StorageInsights operations - :vartype storage_insights: azure.mgmt.loganalytics.operations.StorageInsightsOperations - :ivar workspaces: Workspaces operations - :vartype workspaces: azure.mgmt.loganalytics.operations.WorkspacesOperations - :ivar saved_searches: SavedSearches operations - :vartype saved_searches: azure.mgmt.loganalytics.operations.SavedSearchesOperations :ivar linked_services: LinkedServices operations :vartype linked_services: azure.mgmt.loganalytics.operations.LinkedServicesOperations :ivar data_sources: DataSources operations :vartype data_sources: azure.mgmt.loganalytics.operations.DataSourcesOperations + :ivar workspaces: Workspaces operations + :vartype workspaces: azure.mgmt.loganalytics.operations.WorkspacesOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.loganalytics.operations.Operations @@ -88,22 +82,19 @@ class LogAnalyticsManagementClient(SDKClient): def __init__( self, credentials, subscription_id, base_url=None): - self.config = LogAnalyticsManagementClientConfiguration(credentials, subscription_id, base_url) - super(LogAnalyticsManagementClient, self).__init__(self.config.credentials, self.config) + self.config = OperationalInsightsManagementClientConfiguration(credentials, subscription_id, base_url) + super(OperationalInsightsManagementClient, 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 = '2015-11-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.storage_insights = StorageInsightsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.saved_searches = SavedSearchesOperations( - self._client, self.config, self._serialize, self._deserialize) self.linked_services = LinkedServicesOperations( self._client, self.config, self._serialize, self._deserialize) self.data_sources = DataSourcesOperations( self._client, self.config, self._serialize, self._deserialize) + self.workspaces = WorkspacesOperations( + self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/__init__.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/__init__.py index c5ba8a2e6ecf..876704345f4f 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/__init__.py +++ b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/__init__.py @@ -9,18 +9,14 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_insights_operations import StorageInsightsOperations -from .workspaces_operations import WorkspacesOperations -from .saved_searches_operations import SavedSearchesOperations from .linked_services_operations import LinkedServicesOperations from .data_sources_operations import DataSourcesOperations +from .workspaces_operations import WorkspacesOperations from .operations import Operations __all__ = [ - 'StorageInsightsOperations', - 'WorkspacesOperations', - 'SavedSearchesOperations', 'LinkedServicesOperations', 'DataSourcesOperations', + 'WorkspacesOperations', 'Operations', ] diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/data_sources_operations.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/data_sources_operations.py index 24b70947dd5b..b4ca9da728fd 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/data_sources_operations.py +++ b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/data_sources_operations.py @@ -78,6 +78,7 @@ def create_or_update( # 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()) @@ -90,9 +91,8 @@ def create_or_update( body_content = self._serialize.body(parameters, 'DataSource') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -150,7 +150,6 @@ def delete( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -159,8 +158,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -210,7 +209,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -219,8 +218,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -289,7 +288,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -298,9 +297,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/linked_services_operations.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/linked_services_operations.py index 397183f80a36..da7e34925988 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/linked_services_operations.py +++ b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/linked_services_operations.py @@ -82,6 +82,7 @@ def create_or_update( # 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()) @@ -94,9 +95,8 @@ def create_or_update( body_content = self._serialize.body(parameters, 'LinkedService') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -154,7 +154,6 @@ def delete( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -163,8 +162,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -214,7 +213,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -223,8 +222,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -285,7 +284,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -294,9 +293,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/operations.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/operations.py index 42e218c978a0..6191e47425ce 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/operations.py +++ b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/operations.py @@ -67,7 +67,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -76,9 +76,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/workspaces_operations.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/workspaces_operations.py index 50f97070acc1..123496359167 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/workspaces_operations.py +++ b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/workspaces_operations.py @@ -25,6 +25,7 @@ class WorkspacesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-11-01-preview". """ models = models @@ -34,420 +35,10 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.api_version = "2015-11-01-preview" self.config = config - def list_link_targets( - self, custom_headers=None, raw=False, **operation_config): - """Get a list of workspaces which the current user has administrator - privileges and are not associated with an Azure Subscription. The - subscriptionId parameter in the Url is ignored. - - :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: list or ClientRawResponse if raw=true - :rtype: list[~azure.mgmt.loganalytics.models.LinkTarget] or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2015-03-20" - - # Construct URL - url = self.list_link_targets.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[LinkTarget]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_link_targets.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/linkTargets'} - - def get_schema( - self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): - """Gets the schema for a given workspace. - - :param resource_group_name: The name of the resource group to get. The - name is case insensitive. - :type resource_group_name: str - :param workspace_name: Log Analytics workspace name - :type workspace_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: SearchGetSchemaResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.loganalytics.models.SearchGetSchemaResponse or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2015-03-20" - - # Construct URL - url = self.get_schema.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('SearchGetSchemaResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_schema.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/schema'} - - - def _get_search_results_initial( - self, resource_group_name, workspace_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2015-03-20" - - # Construct URL - url = self.get_search_results.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'SearchParameters') - - # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('SearchResultsResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def get_search_results( - self, resource_group_name, workspace_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Submit a search for a given workspace. The response will contain an id - to track the search. User can use the id to poll the search status and - get the full search result later if the search takes long time to - finish. . - - :param resource_group_name: The name of the resource group to get. The - name is case insensitive. - :type resource_group_name: str - :param workspace_name: Log Analytics workspace name - :type workspace_name: str - :param parameters: The parameters required to execute a search query. - :type parameters: ~azure.mgmt.loganalytics.models.SearchParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns SearchResultsResponse - or ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.loganalytics.models.SearchResultsResponse] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.loganalytics.models.SearchResultsResponse]] - :raises: :class:`CloudError` - """ - raw_result = self._get_search_results_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('SearchResultsResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - get_search_results.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/search'} - - def update_search_results( - self, resource_group_name, workspace_name, id, custom_headers=None, raw=False, **operation_config): - """Gets updated search results for a given search query. - - :param resource_group_name: The name of the resource group to get. The - name is case insensitive. - :type resource_group_name: str - :param workspace_name: Log Analytics workspace name - :type workspace_name: str - :param id: The id of the search that will have results updated. You - can get the id from the response of the GetResults call. - :type id: 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: SearchResultsResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.loganalytics.models.SearchResultsResponse or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2015-03-20" - - # Construct URL - url = self.update_search_results.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), - 'id': self._serialize.url("id", id, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('SearchResultsResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update_search_results.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/search/{id}'} - - - def _purge_initial( - self, resource_group_name, workspace_name, table, filters, custom_headers=None, raw=False, **operation_config): - body = models.WorkspacePurgeBody(table=table, filters=filters) - - api_version = "2015-03-20" - - # Construct URL - url = self.purge.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['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(body, 'WorkspacePurgeBody') - - # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('WorkspacePurgeStatusResponse', response) - if response.status_code == 202: - deserialized = self._deserialize('WorkspacePurgeResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def purge( - self, resource_group_name, workspace_name, table, filters, custom_headers=None, raw=False, polling=True, **operation_config): - """Purges data in an Log Analytics workspace by a set of user-defined - filters. - - :param resource_group_name: The name of the resource group to get. The - name is case insensitive. - :type resource_group_name: str - :param workspace_name: Log Analytics workspace name - :type workspace_name: str - :param table: Table from which to purge data. - :type table: str - :param filters: The set of columns and filters (queries) to run over - them to purge the resulting data. - :type filters: - list[~azure.mgmt.loganalytics.models.WorkspacePurgeBodyFilters] - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns object or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[object] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[object]] - :raises: :class:`CloudError` - """ - raw_result = self._purge_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - table=table, - filters=filters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('object', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/purge'} - def disable_intelligence_pack( self, resource_group_name, workspace_name, intelligence_pack_name, custom_headers=None, raw=False, **operation_config): """Disables an intelligence pack for a given workspace. @@ -469,8 +60,6 @@ def disable_intelligence_pack( :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2015-11-01-preview" - # Construct URL url = self.disable_intelligence_pack.metadata['url'] path_format_arguments = { @@ -483,11 +72,10 @@ def disable_intelligence_pack( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -496,8 +84,8 @@ def disable_intelligence_pack( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -530,8 +118,6 @@ def enable_intelligence_pack( :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2015-11-01-preview" - # Construct URL url = self.enable_intelligence_pack.metadata['url'] path_format_arguments = { @@ -544,11 +130,10 @@ def enable_intelligence_pack( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -557,8 +142,8 @@ def enable_intelligence_pack( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -590,8 +175,6 @@ def list_intelligence_packs( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2015-11-01-preview" - # Construct URL url = self.list_intelligence_packs.metadata['url'] path_format_arguments = { @@ -603,11 +186,11 @@ def list_intelligence_packs( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -616,8 +199,8 @@ def list_intelligence_packs( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -655,8 +238,6 @@ def get_shared_keys( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2015-11-01-preview" - # Construct URL url = self.get_shared_keys.metadata['url'] path_format_arguments = { @@ -668,11 +249,11 @@ def get_shared_keys( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -681,8 +262,8 @@ def get_shared_keys( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -720,8 +301,6 @@ def list_usages( ~azure.mgmt.loganalytics.models.UsageMetricPaged[~azure.mgmt.loganalytics.models.UsageMetric] :raises: :class:`CloudError` """ - api_version = "2015-11-01-preview" - def internal_paging(next_link=None, raw=False): if not next_link: @@ -736,7 +315,7 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: url = next_link @@ -744,7 +323,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -753,9 +332,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -794,8 +372,6 @@ def list_management_groups( ~azure.mgmt.loganalytics.models.ManagementGroupPaged[~azure.mgmt.loganalytics.models.ManagementGroup] :raises: :class:`CloudError` """ - api_version = "2015-11-01-preview" - def internal_paging(next_link=None, raw=False): if not next_link: @@ -810,7 +386,7 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: url = next_link @@ -818,7 +394,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -827,9 +403,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -866,8 +441,6 @@ def list_by_resource_group( ~azure.mgmt.loganalytics.models.WorkspacePaged[~azure.mgmt.loganalytics.models.Workspace] :raises: :class:`CloudError` """ - api_version = "2015-11-01-preview" - def internal_paging(next_link=None, raw=False): if not next_link: @@ -881,7 +454,7 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: url = next_link @@ -889,7 +462,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -898,9 +471,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -934,8 +506,6 @@ def list( ~azure.mgmt.loganalytics.models.WorkspacePaged[~azure.mgmt.loganalytics.models.Workspace] :raises: :class:`CloudError` """ - api_version = "2015-11-01-preview" - def internal_paging(next_link=None, raw=False): if not next_link: @@ -948,7 +518,7 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: url = next_link @@ -956,7 +526,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -965,9 +535,8 @@ def internal_paging(next_link=None, raw=False): header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -990,8 +559,6 @@ def internal_paging(next_link=None, raw=False): def _create_or_update_initial( self, resource_group_name, workspace_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2015-11-01-preview" - # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -1003,10 +570,11 @@ def _create_or_update_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -1019,9 +587,8 @@ def _create_or_update_initial( body_content = self._serialize.body(parameters, 'Workspace') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -1109,8 +676,6 @@ def delete( :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2015-11-01-preview" - # Construct URL url = self.delete.metadata['url'] path_format_arguments = { @@ -1122,11 +687,10 @@ def delete( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -1135,8 +699,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: exp = CloudError(response) @@ -1166,8 +730,6 @@ def get( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2015-11-01-preview" - # Construct URL url = self.get.metadata['url'] path_format_arguments = { @@ -1179,11 +741,11 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -1192,8 +754,8 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -1232,8 +794,6 @@ def update( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2015-11-01-preview" - # Construct URL url = self.update.metadata['url'] path_format_arguments = { @@ -1245,10 +805,11 @@ def update( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -1261,9 +822,8 @@ def update( body_content = self._serialize.body(parameters, 'Workspace') # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) diff --git a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/version.py b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/version.py index 9bd1dfac7ecb..d5ac4dd14e3f 100644 --- a/azure-mgmt-loganalytics/azure/mgmt/loganalytics/version.py +++ b/azure-mgmt-loganalytics/azure/mgmt/loganalytics/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.2.0" +VERSION = "2015-11-01-preview" diff --git a/azure-mgmt-loganalytics/setup.py b/azure-mgmt-loganalytics/setup.py index 1b9006391b22..b2a7e9191233 100644 --- a/azure-mgmt-loganalytics/setup.py +++ b/azure-mgmt-loganalytics/setup.py @@ -53,6 +53,7 @@ version=version, description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', license='MIT License', author='Microsoft Corporation', author_email='azpysdkhelp@microsoft.com',