Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@ class AlertsManagementClient(SDKClient):
object<msrestazure.azure_active_directory>`
: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)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,20 @@ class AlertsManagementClientConfiguration(AzureConfiguration):
object<msrestazure.azure_active_directory>`
: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'

Expand All @@ -46,3 +50,4 @@ def __init__(

self.credentials = credentials
self.subscription_id = subscription_id
self.subscription_id1 = subscription_id1
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,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):
Expand All @@ -85,6 +91,7 @@ class ScopeType(str, Enum):

resource_group = "ResourceGroup"
resource = "Resource"
subscription = "Subscription"


class Operator(str, Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1306,7 +1308,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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1306,7 +1308,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.
Expand Down
4 changes: 3 additions & 1 deletion sdk/alertsmanagement/azure-mgmt-alertsmanagement/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down