diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/_alerts_management_client.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/_alerts_management_client.py index af7ad075b8c6..c8e580d53764 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/_alerts_management_client.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/_alerts_management_client.py @@ -13,10 +13,10 @@ from msrest import Serializer, Deserializer from ._configuration import AlertsManagementClientConfiguration +from .operations import ActionRulesOperations from .operations import Operations from .operations import AlertsOperations from .operations import SmartGroupsOperations -from .operations import ActionRulesOperations from .operations import SmartDetectorAlertRulesOperations from . import models @@ -27,14 +27,14 @@ class AlertsManagementClient(SDKClient): :ivar config: Configuration for client. :vartype config: AlertsManagementClientConfiguration + :ivar action_rules: ActionRules operations + :vartype action_rules: azure.mgmt.alertsmanagement.operations.ActionRulesOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.alertsmanagement.operations.Operations :ivar alerts: Alerts operations :vartype alerts: azure.mgmt.alertsmanagement.operations.AlertsOperations :ivar smart_groups: SmartGroups operations :vartype smart_groups: azure.mgmt.alertsmanagement.operations.SmartGroupsOperations - :ivar action_rules: ActionRules operations - :vartype action_rules: azure.mgmt.alertsmanagement.operations.ActionRulesOperations :ivar smart_detector_alert_rules: SmartDetectorAlertRules operations :vartype smart_detector_alert_rules: azure.mgmt.alertsmanagement.operations.SmartDetectorAlertRulesOperations @@ -43,26 +43,28 @@ class AlertsManagementClient(SDKClient): object` :param subscription_id: The ID of the target subscription. :type subscription_id: str + :param subscription_id1: The ID of the target subscription. + :type subscription_id1: str :param str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): + self, credentials, subscription_id, subscription_id1, base_url=None): - self.config = AlertsManagementClientConfiguration(credentials, subscription_id, base_url) + self.config = AlertsManagementClientConfiguration(credentials, subscription_id, subscription_id1, base_url) super(AlertsManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) + self.action_rules = ActionRulesOperations( + self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) self.alerts = AlertsOperations( self._client, self.config, self._serialize, self._deserialize) self.smart_groups = SmartGroupsOperations( self._client, self.config, self._serialize, self._deserialize) - self.action_rules = ActionRulesOperations( - self._client, self.config, self._serialize, self._deserialize) self.smart_detector_alert_rules = SmartDetectorAlertRulesOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/_configuration.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/_configuration.py index c42d0ce4b9cf..8e987865b32e 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/_configuration.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/_configuration.py @@ -23,16 +23,20 @@ class AlertsManagementClientConfiguration(AzureConfiguration): object` :param subscription_id: The ID of the target subscription. :type subscription_id: str + :param subscription_id1: The ID of the target subscription. + :type subscription_id1: str :param str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): + self, credentials, subscription_id, subscription_id1, base_url=None): if credentials is None: raise ValueError("Parameter 'credentials' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") + if subscription_id1 is None: + raise ValueError("Parameter 'subscription_id1' must not be None.") if not base_url: base_url = 'https://management.azure.com' @@ -46,3 +50,4 @@ def __init__( self.credentials = credentials self.subscription_id = subscription_id + self.subscription_id1 = subscription_id1 diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/__init__.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/__init__.py index 84870cf01aa0..3850e14f0d98 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/__init__.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/__init__.py @@ -32,7 +32,6 @@ from ._models_py3 import Detector from ._models_py3 import Diagnostics from ._models_py3 import ErrorResponse, ErrorResponseException - from ._models_py3 import ErrorResponse1, ErrorResponse1Exception from ._models_py3 import ErrorResponseBody from ._models_py3 import Essentials from ._models_py3 import ManagedResource @@ -43,6 +42,7 @@ from ._models_py3 import PatchObject from ._models_py3 import Resource from ._models_py3 import Scope + from ._models_py3 import SmartDetectorErrorResponse, SmartDetectorErrorResponseException from ._models_py3 import SmartGroup from ._models_py3 import SmartGroupAggregatedProperty from ._models_py3 import SmartGroupModification @@ -75,7 +75,6 @@ from ._models import Detector from ._models import Diagnostics from ._models import ErrorResponse, ErrorResponseException - from ._models import ErrorResponse1, ErrorResponse1Exception from ._models import ErrorResponseBody from ._models import Essentials from ._models import ManagedResource @@ -86,6 +85,7 @@ from ._models import PatchObject from ._models import Resource from ._models import Scope + from ._models import SmartDetectorErrorResponse, SmartDetectorErrorResponseException from ._models import SmartGroup from ._models import SmartGroupAggregatedProperty from ._models import SmartGroupModification @@ -101,6 +101,10 @@ from ._paged_models import OperationPaged from ._paged_models import SmartGroupPaged from ._alerts_management_client_enums import ( + ScopeType, + Operator, + SuppressionType, + ActionRuleStatus, Severity, SignalType, AlertState, @@ -109,10 +113,6 @@ AlertModificationEvent, SmartGroupModificationEvent, State, - ScopeType, - Operator, - SuppressionType, - ActionRuleStatus, AlertRuleState, TimeRange, AlertsSortByFields, @@ -143,7 +143,6 @@ 'Detector', 'Diagnostics', 'ErrorResponse', 'ErrorResponseException', - 'ErrorResponse1', 'ErrorResponse1Exception', 'ErrorResponseBody', 'Essentials', 'ManagedResource', @@ -154,6 +153,7 @@ 'PatchObject', 'Resource', 'Scope', + 'SmartDetectorErrorResponse', 'SmartDetectorErrorResponseException', 'SmartGroup', 'SmartGroupAggregatedProperty', 'SmartGroupModification', @@ -163,11 +163,15 @@ 'SuppressionConfig', 'SuppressionSchedule', 'ThrottlingInformation', + 'ActionRulePaged', 'OperationPaged', 'AlertPaged', 'SmartGroupPaged', - 'ActionRulePaged', 'AlertRulePaged', + 'ScopeType', + 'Operator', + 'SuppressionType', + 'ActionRuleStatus', 'Severity', 'SignalType', 'AlertState', @@ -176,10 +180,6 @@ 'AlertModificationEvent', 'SmartGroupModificationEvent', 'State', - 'ScopeType', - 'Operator', - 'SuppressionType', - 'ActionRuleStatus', 'AlertRuleState', 'TimeRange', 'AlertsSortByFields', diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_alerts_management_client_enums.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_alerts_management_client_enums.py index 2d9334e583c7..ec67e80ea670 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_alerts_management_client_enums.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_alerts_management_client_enums.py @@ -12,6 +12,36 @@ from enum import Enum +class ScopeType(str, Enum): + + resource_group = "ResourceGroup" + resource = "Resource" + subscription = "Subscription" + + +class Operator(str, Enum): + + equals = "Equals" + not_equals = "NotEquals" + contains = "Contains" + does_not_contain = "DoesNotContain" + + +class SuppressionType(str, Enum): + + always = "Always" + once = "Once" + daily = "Daily" + weekly = "Weekly" + monthly = "Monthly" + + +class ActionRuleStatus(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + class Severity(str, Enum): sev0 = "Sev0" @@ -64,6 +94,12 @@ class AlertModificationEvent(str, Enum): alert_created = "AlertCreated" state_change = "StateChange" monitor_condition_change = "MonitorConditionChange" + severity_change = "SeverityChange" + action_rule_triggered = "ActionRuleTriggered" + action_rule_suppressed = "ActionRuleSuppressed" + actions_triggered = "ActionsTriggered" + actions_suppressed = "ActionsSuppressed" + actions_failed = "ActionsFailed" class SmartGroupModificationEvent(str, Enum): @@ -81,35 +117,6 @@ class State(str, Enum): closed = "Closed" -class ScopeType(str, Enum): - - resource_group = "ResourceGroup" - resource = "Resource" - - -class Operator(str, Enum): - - equals = "Equals" - not_equals = "NotEquals" - contains = "Contains" - does_not_contain = "DoesNotContain" - - -class SuppressionType(str, Enum): - - always = "Always" - once = "Once" - daily = "Daily" - weekly = "Weekly" - monthly = "Monthly" - - -class ActionRuleStatus(str, Enum): - - enabled = "Enabled" - disabled = "Disabled" - - class AlertRuleState(str, Enum): enabled = "Enabled" diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_models.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_models.py index a602fe2c9347..0e50bc35fc5c 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_models.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_models.py @@ -372,7 +372,9 @@ class AlertModificationItem(Model): """Alert modification item. :param modification_event: Reason for the modification. Possible values - include: 'AlertCreated', 'StateChange', 'MonitorConditionChange' + include: 'AlertCreated', 'StateChange', 'MonitorConditionChange', + 'SeverityChange', 'ActionRuleTriggered', 'ActionRuleSuppressed', + 'ActionsTriggered', 'ActionsSuppressed', 'ActionsFailed' :type modification_event: str or ~azure.mgmt.alertsmanagement.models.AlertModificationEvent :param old_value: Old value @@ -993,38 +995,6 @@ def __init__(self, deserialize, response, *args): super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) -class ErrorResponse1(Model): - """Describe the format of an Error response. - - :param code: Error code - :type code: str - :param message: Error message indicating why the operation failed. - :type message: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ErrorResponse1, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - - -class ErrorResponse1Exception(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse1'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponse1Exception, self).__init__(deserialize, response, 'ErrorResponse1', *args) - - class ErrorResponseBody(Model): """Details of error response. @@ -1306,7 +1276,7 @@ class Scope(Model): resources from the scope subscription as well. :param scope_type: type of target scope. Possible values include: - 'ResourceGroup', 'Resource' + 'ResourceGroup', 'Resource', 'Subscription' :type scope_type: str or ~azure.mgmt.alertsmanagement.models.ScopeType :param values: list of ARM IDs of the given scope type which will be the target of the given action rule. @@ -1324,6 +1294,38 @@ def __init__(self, **kwargs): self.values = kwargs.get('values', None) +class SmartDetectorErrorResponse(Model): + """Describe the format of an Error response. + + :param code: Error code + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SmartDetectorErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class SmartDetectorErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'SmartDetectorErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(SmartDetectorErrorResponseException, self).__init__(deserialize, response, 'SmartDetectorErrorResponse', *args) + + class SmartGroup(Resource): """Set of related alerts grouped together smartly by AMS. diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_models_py3.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_models_py3.py index 635be9d76f8e..e7c9eeea021d 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_models_py3.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_models_py3.py @@ -372,7 +372,9 @@ class AlertModificationItem(Model): """Alert modification item. :param modification_event: Reason for the modification. Possible values - include: 'AlertCreated', 'StateChange', 'MonitorConditionChange' + include: 'AlertCreated', 'StateChange', 'MonitorConditionChange', + 'SeverityChange', 'ActionRuleTriggered', 'ActionRuleSuppressed', + 'ActionsTriggered', 'ActionsSuppressed', 'ActionsFailed' :type modification_event: str or ~azure.mgmt.alertsmanagement.models.AlertModificationEvent :param old_value: Old value @@ -993,38 +995,6 @@ def __init__(self, deserialize, response, *args): super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) -class ErrorResponse1(Model): - """Describe the format of an Error response. - - :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(ErrorResponse1, self).__init__(**kwargs) - self.code = code - self.message = message - - -class ErrorResponse1Exception(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse1'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponse1Exception, self).__init__(deserialize, response, 'ErrorResponse1', *args) - - class ErrorResponseBody(Model): """Details of error response. @@ -1306,7 +1276,7 @@ class Scope(Model): resources from the scope subscription as well. :param scope_type: type of target scope. Possible values include: - 'ResourceGroup', 'Resource' + 'ResourceGroup', 'Resource', 'Subscription' :type scope_type: str or ~azure.mgmt.alertsmanagement.models.ScopeType :param values: list of ARM IDs of the given scope type which will be the target of the given action rule. @@ -1324,6 +1294,38 @@ def __init__(self, *, scope_type=None, values=None, **kwargs) -> None: self.values = values +class SmartDetectorErrorResponse(Model): + """Describe the format of an Error response. + + :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(SmartDetectorErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + + +class SmartDetectorErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'SmartDetectorErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(SmartDetectorErrorResponseException, self).__init__(deserialize, response, 'SmartDetectorErrorResponse', *args) + + class SmartGroup(Resource): """Set of related alerts grouped together smartly by AMS. diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_paged_models.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_paged_models.py index aece7093df75..dbb12d962ad9 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_paged_models.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_paged_models.py @@ -12,6 +12,19 @@ from msrest.paging import Paged +class ActionRulePaged(Paged): + """ + A paging container for iterating over a list of :class:`ActionRule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ActionRule]'} + } + + def __init__(self, *args, **kwargs): + + super(ActionRulePaged, self).__init__(*args, **kwargs) class OperationPaged(Paged): """ A paging container for iterating over a list of :class:`Operation ` object @@ -51,19 +64,6 @@ class SmartGroupPaged(Paged): def __init__(self, *args, **kwargs): super(SmartGroupPaged, self).__init__(*args, **kwargs) -class ActionRulePaged(Paged): - """ - A paging container for iterating over a list of :class:`ActionRule ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ActionRule]'} - } - - def __init__(self, *args, **kwargs): - - super(ActionRulePaged, self).__init__(*args, **kwargs) class AlertRulePaged(Paged): """ A paging container for iterating over a list of :class:`AlertRule ` object diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/__init__.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/__init__.py index 946b389ce5fb..39ae7cd93bac 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/__init__.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/__init__.py @@ -9,16 +9,16 @@ # regenerated. # -------------------------------------------------------------------------- +from ._action_rules_operations import ActionRulesOperations from ._operations import Operations from ._alerts_operations import AlertsOperations from ._smart_groups_operations import SmartGroupsOperations -from ._action_rules_operations import ActionRulesOperations from ._smart_detector_alert_rules_operations import SmartDetectorAlertRulesOperations __all__ = [ + 'ActionRulesOperations', 'Operations', 'AlertsOperations', 'SmartGroupsOperations', - 'ActionRulesOperations', 'SmartDetectorAlertRulesOperations', ] diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/_smart_detector_alert_rules_operations.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/_smart_detector_alert_rules_operations.py index 8119e32986ff..a0f0792e8be1 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/_smart_detector_alert_rules_operations.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/_smart_detector_alert_rules_operations.py @@ -55,7 +55,7 @@ def list( :rtype: ~azure.mgmt.alertsmanagement.models.AlertRulePaged[~azure.mgmt.alertsmanagement.models.AlertRule] :raises: - :class:`ErrorResponse1Exception` + :class:`SmartDetectorErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -96,7 +96,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorResponse1Exception(self._deserialize, response) + raise models.SmartDetectorErrorResponseException(self._deserialize, response) return response @@ -128,7 +128,7 @@ def list_by_resource_group( :rtype: ~azure.mgmt.alertsmanagement.models.AlertRulePaged[~azure.mgmt.alertsmanagement.models.AlertRule] :raises: - :class:`ErrorResponse1Exception` + :class:`SmartDetectorErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -170,7 +170,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorResponse1Exception(self._deserialize, response) + raise models.SmartDetectorErrorResponseException(self._deserialize, response) return response @@ -203,7 +203,7 @@ def get( :rtype: ~azure.mgmt.alertsmanagement.models.AlertRule or ~msrest.pipeline.ClientRawResponse :raises: - :class:`ErrorResponse1Exception` + :class:`SmartDetectorErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -235,7 +235,7 @@ def get( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorResponse1Exception(self._deserialize, response) + raise models.SmartDetectorErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -267,7 +267,7 @@ def create_or_update( :rtype: ~azure.mgmt.alertsmanagement.models.AlertRule or ~msrest.pipeline.ClientRawResponse :raises: - :class:`ErrorResponse1Exception` + :class:`SmartDetectorErrorResponseException` """ # Construct URL url = self.create_or_update.metadata['url'] @@ -301,7 +301,7 @@ def create_or_update( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: - raise models.ErrorResponse1Exception(self._deserialize, response) + raise models.SmartDetectorErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -336,7 +336,7 @@ def patch( :rtype: ~azure.mgmt.alertsmanagement.models.AlertRule or ~msrest.pipeline.ClientRawResponse :raises: - :class:`ErrorResponse1Exception` + :class:`SmartDetectorErrorResponseException` """ # Construct URL url = self.patch.metadata['url'] @@ -370,7 +370,7 @@ def patch( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorResponse1Exception(self._deserialize, response) + raise models.SmartDetectorErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -399,7 +399,7 @@ def delete( :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: - :class:`ErrorResponse1Exception` + :class:`SmartDetectorErrorResponseException` """ # Construct URL url = self.delete.metadata['url'] @@ -428,7 +428,7 @@ def delete( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: - raise models.ErrorResponse1Exception(self._deserialize, response) + raise models.SmartDetectorErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/setup.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/setup.py index 014f250f6e3f..85847c38e80f 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/setup.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/setup.py @@ -36,7 +36,9 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1)