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 62b9c2aaf442..234b702d6cc5 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 @@ -17,9 +17,14 @@ from .operations.components_operations import ComponentsOperations from .operations.web_tests_operations import WebTestsOperations 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.component_feature_capabilities_operations import ComponentFeatureCapabilitiesOperations +from .operations.component_available_features_operations import ComponentAvailableFeaturesOperations from .operations.api_keys_operations import APIKeysOperations +from .operations.annotations_operations import AnnotationsOperations +from .operations.work_item_configurations_operations import WorkItemConfigurationsOperations from . import models @@ -69,12 +74,22 @@ class ApplicationInsightsManagementClient(object): :vartype web_tests: azure.mgmt.applicationinsights.operations.WebTestsOperations :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 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 api_keys: APIKeys operations :vartype api_keys: azure.mgmt.applicationinsights.operations.APIKeysOperations + :ivar annotations: Annotations operations + :vartype annotations: azure.mgmt.applicationinsights.operations.AnnotationsOperations + :ivar work_item_configurations: WorkItemConfigurations operations + :vartype work_item_configurations: azure.mgmt.applicationinsights.operations.WorkItemConfigurationsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -103,9 +118,19 @@ def __init__( 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.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.api_keys = APIKeysOperations( self._client, self.config, self._serialize, self._deserialize) + self.annotations = AnnotationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.work_item_configurations = WorkItemConfigurationsOperations( + 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 8318a9567e80..fb667d47eb85 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/__init__.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/__init__.py @@ -20,11 +20,23 @@ 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 .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 .api_key_request import APIKeyRequest from .application_insights_component_api_key import ApplicationInsightsComponentAPIKey +from .annotation import Annotation +from .inner_error import InnerError +from .annotation_create_error import AnnotationCreateError +from .work_item_configuration import WorkItemConfiguration +from .work_item_create_configuration import WorkItemCreateConfiguration +from .work_item_configuration_error import WorkItemConfigurationError from .operation_paged import OperationPaged from .application_insights_component_paged import ApplicationInsightsComponentPaged from .web_test_paged import WebTestPaged @@ -48,11 +60,23 @@ 'WebTest', 'ApplicationInsightsComponentExportRequest', 'ApplicationInsightsComponentExportConfiguration', + 'ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions', + 'ApplicationInsightsComponentProactiveDetectionConfiguration', 'ApplicationInsightsComponentDataVolumeCap', 'ApplicationInsightsComponentBillingFeatures', 'ApplicationInsightsComponentQuotaStatus', + 'ApplicationInsightsComponentFeatureCapabilities', + 'ApplicationInsightsComponentFeatureCapability', + 'ApplicationInsightsComponentFeature', + 'ApplicationInsightsComponentAvailableFeatures', 'APIKeyRequest', 'ApplicationInsightsComponentAPIKey', + 'Annotation', + 'InnerError', + 'AnnotationCreateError', + 'WorkItemConfiguration', + 'WorkItemCreateConfiguration', + 'WorkItemConfigurationError', 'OperationPaged', 'ApplicationInsightsComponentPaged', 'WebTestPaged', 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..e20e95e4ce0e --- /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, annotation_name=None, category=None, event_time=None, id=None, properties=None, related_annotation="null"): + super(Annotation, self).__init__() + 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/annotation_create_error.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_create_error.py new file mode 100644 index 000000000000..23731bc1b22d --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_create_error.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 AnnotationCreateError(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=None, message=None, innererror=None): + super(AnnotationCreateError, self).__init__() + self.code = code + self.message = message + self.innererror = innererror 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..a7ee7642f5e6 --- /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 Insigths component feature. + :vartype result: + list[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFeature] + """ + + _validation = { + 'result': {'readonly': True}, + } + + _attribute_map = { + 'result': {'key': 'Result', 'type': '[ApplicationInsightsComponentFeature]'}, + } + + def __init__(self): + super(ApplicationInsightsComponentAvailableFeatures, self).__init__() + self.result = 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..c0eaaa378b9d --- /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 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 Insigths component feature + capability. + :vartype capabilities: + list[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFeatureCapability] + :ivar title: Desplay 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): + super(ApplicationInsightsComponentFeature, self).__init__() + 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..fd8c809e15d5 --- /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 applciation 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): + super(ApplicationInsightsComponentFeatureCapabilities, self).__init__() + 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..81693f1a745e --- /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 vaule 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): + super(ApplicationInsightsComponentFeatureCapability, self).__init__() + 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_proactive_detection_configuration.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration.py new file mode 100644 index 000000000000..14734b3c0f68 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration.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=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 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 new file mode 100644 index 000000000000..8fafb0a49a27 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration_rule_definitions.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 aditional 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=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 diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/inner_error.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/inner_error.py new file mode 100644 index 000000000000..30ba2e246ac6 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/inner_error.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=None, time=None): + super(InnerError, self).__init__() + self.diagnosticcontext = diagnosticcontext + self.time = time 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..fa78529ecc20 --- /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, connector_id=None, config_display_name=None, is_default=None, id=None, config_properties=None): + super(WorkItemConfiguration, self).__init__() + 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_configuration_error.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_error.py new file mode 100644 index 000000000000..f42e753b484c --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_error.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 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=None, message=None, innererror=None): + super(WorkItemConfigurationError, self).__init__() + self.code = code + self.message = message + self.innererror = innererror 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..2f94b5f8cb28 --- /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 detaile d + 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=None, connector_data_configuration=None, validate_only=None, work_item_properties=None): + super(WorkItemCreateConfiguration, self).__init__() + 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/operations/__init__.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/__init__.py index 7be29002d55c..c2b3367f2ad2 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/__init__.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/__init__.py @@ -13,16 +13,26 @@ from .components_operations import ComponentsOperations from .web_tests_operations import WebTestsOperations 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 .component_feature_capabilities_operations import ComponentFeatureCapabilitiesOperations +from .component_available_features_operations import ComponentAvailableFeaturesOperations from .api_keys_operations import APIKeysOperations +from .annotations_operations import AnnotationsOperations +from .work_item_configurations_operations import WorkItemConfigurationsOperations __all__ = [ 'Operations', 'ComponentsOperations', 'WebTestsOperations', 'ExportConfigurationsOperations', + 'ProactiveDetectionConfigurationsOperations', 'ComponentCurrentBillingFeaturesOperations', 'ComponentQuotaStatusOperations', + 'ComponentFeatureCapabilitiesOperations', + 'ComponentAvailableFeaturesOperations', 'APIKeysOperations', + 'AnnotationsOperations', + 'WorkItemConfigurationsOperations', ] 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..3b73001d3f83 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/annotations_operations.py @@ -0,0 +1,320 @@ +# 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 objec model deserializer. + :ivar api_version: Client Api Version. 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. + :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 None + :rtype: object[None] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations' + 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'), + '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['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['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, 400]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.object(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.object(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + 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. + :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: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations' + 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'), + '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') + + # 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(annotation_properties, 'Annotation') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 400, 409]: + 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('[Annotation]', response) + if response.status_code == 400: + deserialized = self._deserialize('AnnotationCreateError', response) + if response.status_code == 409: + deserialized = self._deserialize('AnnotationCreateError', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + 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. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations/{annotationId}' + 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'), + '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') + + # 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.delete(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('object', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + 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. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/Annotations/{annotationId}' + 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'), + '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') + + # 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, 404]: + 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('[Annotation]', response) + if response.status_code == 404: + deserialized = self._deserialize('AnnotationCreateError', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized 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..d64a794c6d11 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_available_features_operations.py @@ -0,0 +1,102 @@ +# 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 objec model deserializer. + :ivar api_version: Client Api Version. 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. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/getavailablebillingfeatures' + 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'), + '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') + + # 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('ApplicationInsightsComponentAvailableFeatures', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized 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..7728ac63fd90 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_feature_capabilities_operations.py @@ -0,0 +1,102 @@ +# 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 objec model deserializer. + :ivar api_version: Client Api Version. 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 capabilites of the application insights component. + + :param resource_group_name: The name of the resource group. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/featurecapabilities' + 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'), + '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') + + # 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('ApplicationInsightsComponentFeatureCapabilities', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized 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 new file mode 100644 index 000000000000..3a5f0b763667 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/proactive_detection_configurations_operations.py @@ -0,0 +1,246 @@ +# 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 ProactiveDetectionConfigurationsOperations(object): + """ProactiveDetectionConfigurationsOperations operations. + + :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". + """ + + 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 ProactiveDetection configurations of an Application + Insights component. + + :param resource_group_name: The name of the resource group. + :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: list or ClientRawResponse if raw=true + :rtype: + list[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentProactiveDetectionConfiguration] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ProactiveDetectionConfigs' + 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'), + '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') + + # 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('[ApplicationInsightsComponentProactiveDetectionConfiguration]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + 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. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param configuration_id: The ProactiveDetection configuration ID. This + is unique within a Application Insights component. + :type configuration_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: ApplicationInsightsComponentProactiveDetectionConfiguration + or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentProactiveDetectionConfiguration + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}' + 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'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'ConfigurationId': self._serialize.url("configuration_id", configuration_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + 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('ApplicationInsightsComponentProactiveDetectionConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + 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. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param configuration_id: The ProactiveDetection configuration ID. This + is unique within a Application Insights component. + :type configuration_id: str + :param proactive_detection_properties: Properties that need to be + specified to update the ProactiveDetection configuration. + :type proactive_detection_properties: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentProactiveDetectionConfiguration + :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: ApplicationInsightsComponentProactiveDetectionConfiguration + or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentProactiveDetectionConfiguration + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}' + 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'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'ConfigurationId': self._serialize.url("configuration_id", configuration_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + 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) + + 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('ApplicationInsightsComponentProactiveDetectionConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/work_item_configurations_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/work_item_configurations_operations.py new file mode 100644 index 000000000000..86645512e825 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/work_item_configurations_operations.py @@ -0,0 +1,316 @@ +# 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 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 objec model deserializer. + :ivar api_version: Client Api Version. 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 the list work item configurations that exist for the application. + + :param resource_group_name: The name of the resource group. + :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 None + :rtype: object[None] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/WorkItemConfigs' + 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'), + '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') + + 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, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.object(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.object(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + 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. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/WorkItemConfigs' + 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'), + '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') + + # 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(work_item_configuration_properties, 'WorkItemCreateConfiguration') + + # 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]: + 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('WorkItemConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + 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. + :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 None + :rtype: + ~azure.mgmt.applicationinsights.models.WorkItemConfiguration[None] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/DefaultWorkItemConfig' + 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'), + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.WorkItemConfiguration(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.WorkItemConfiguration(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def delete( + self, resource_group_name, resource_name, work_item_config_id, custom_headers=None, raw=False, **operation_config): + """Delete an workitem configuration of an Application Insights component. + + :param resource_group_name: The name of the resource group. + :type resource_group_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: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}' + 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'), + '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') + + # 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.delete(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('object', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized