Skip to content
Merged
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 @@ -16,6 +16,7 @@
from .operations.operations import Operations
from .operations.alerts_operations import AlertsOperations
from .operations.smart_groups_operations import SmartGroupsOperations
from .operations.action_rules_operations import ActionRulesOperations
from . import models


Expand All @@ -27,15 +28,18 @@ class AlertsManagementClientConfiguration(AzureConfiguration):
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Subscription credentials which uniquely identify
:param subscription_id: subscription credentials which uniquely identify
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param api_version1: client API version. Possible values include:
'2019-05-05-preview', '2018-05-05'
:type api_version1: str or ~azure.mgmt.alertsmanagement.models.ApiVersion
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):
self, credentials, subscription_id, api_version1=None, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
Expand All @@ -51,6 +55,7 @@ def __init__(

self.credentials = credentials
self.subscription_id = subscription_id
self.api_version1 = api_version1


class AlertsManagementClient(SDKClient):
Expand All @@ -65,25 +70,30 @@ class AlertsManagementClient(SDKClient):
: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

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Subscription credentials which uniquely identify
:param subscription_id: subscription credentials which uniquely identify
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param api_version1: client API version. Possible values include:
'2019-05-05-preview', '2018-05-05'
:type api_version1: str or ~azure.mgmt.alertsmanagement.models.ApiVersion
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):
self, credentials, subscription_id, api_version1=None, base_url=None):

self.config = AlertsManagementClientConfiguration(credentials, subscription_id, base_url)
self.config = AlertsManagementClientConfiguration(credentials, subscription_id, api_version1, 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.api_version = '2018-05-05'
self.api_version = '2019-05-05-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand All @@ -93,3 +103,5 @@ def __init__(
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)
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,95 @@
from .operation_display_py3 import OperationDisplay
from .operation_py3 import Operation
from .resource_py3 import Resource
from .essentials_py3 import Essentials
from .alert_properties_py3 import AlertProperties
from .managed_resource_py3 import ManagedResource
from .alert_py3 import Alert
from .alert_modification_item_py3 import AlertModificationItem
from .alert_modification_properties_py3 import AlertModificationProperties
from .alert_modification_py3 import AlertModification
from .smart_group_modification_item_py3 import SmartGroupModificationItem
from .smart_group_modification_properties_py3 import SmartGroupModificationProperties
from .smart_group_modification_py3 import SmartGroupModification
from .alerts_summary_group_item_py3 import AlertsSummaryGroupItem
from .alerts_summary_group_py3 import AlertsSummaryGroup
from .alerts_summary_properties_summary_by_state_py3 import AlertsSummaryPropertiesSummaryByState
from .alerts_summary_properties_summary_by_severity_sev0_py3 import AlertsSummaryPropertiesSummaryBySeveritySev0
from .alerts_summary_properties_summary_by_severity_sev1_py3 import AlertsSummaryPropertiesSummaryBySeveritySev1
from .alerts_summary_properties_summary_by_severity_sev2_py3 import AlertsSummaryPropertiesSummaryBySeveritySev2
from .alerts_summary_properties_summary_by_severity_sev3_py3 import AlertsSummaryPropertiesSummaryBySeveritySev3
from .alerts_summary_properties_summary_by_severity_sev4_py3 import AlertsSummaryPropertiesSummaryBySeveritySev4
from .alerts_summary_properties_summary_by_severity_py3 import AlertsSummaryPropertiesSummaryBySeverity
from .alerts_summary_properties_summary_by_severity_and_monitor_condition_py3 import AlertsSummaryPropertiesSummaryBySeverityAndMonitorCondition
from .alerts_summary_properties_summary_by_monitor_service_py3 import AlertsSummaryPropertiesSummaryByMonitorService
from .alerts_summary_py3 import AlertsSummary
from .alerts_summary_by_state_py3 import AlertsSummaryByState
from .alerts_summary_by_severity_and_monitor_condition_sev0_py3 import AlertsSummaryBySeverityAndMonitorConditionSev0
from .alerts_summary_by_severity_and_monitor_condition_sev1_py3 import AlertsSummaryBySeverityAndMonitorConditionSev1
from .alerts_summary_by_severity_and_monitor_condition_sev2_py3 import AlertsSummaryBySeverityAndMonitorConditionSev2
from .alerts_summary_by_severity_and_monitor_condition_sev3_py3 import AlertsSummaryBySeverityAndMonitorConditionSev3
from .alerts_summary_by_severity_and_monitor_condition_sev4_py3 import AlertsSummaryBySeverityAndMonitorConditionSev4
from .alerts_summary_by_severity_and_monitor_condition_py3 import AlertsSummaryBySeverityAndMonitorCondition
from .alerts_summary_by_monitor_condition_py3 import AlertsSummaryByMonitorCondition
from .alerts_summary_by_monitor_service_py3 import AlertsSummaryByMonitorService
from .smart_group_aggregated_property_py3 import SmartGroupAggregatedProperty
from .smart_group_py3 import SmartGroup
from .smart_groups_list_py3 import SmartGroupsList
from .scope_py3 import Scope
from .condition_py3 import Condition
from .conditions_py3 import Conditions
from .suppression_schedule_py3 import SuppressionSchedule
from .suppression_config_py3 import SuppressionConfig
from .action_rule_properties_py3 import ActionRuleProperties
from .action_rule_py3 import ActionRule
from .suppression_py3 import Suppression
from .action_group_py3 import ActionGroup
from .diagnostics_py3 import Diagnostics
from .patch_object_py3 import PatchObject
except (SyntaxError, ImportError):
from .operation_display import OperationDisplay
from .operation import Operation
from .resource import Resource
from .essentials import Essentials
from .alert_properties import AlertProperties
from .managed_resource import ManagedResource
from .alert import Alert
from .alert_modification_item import AlertModificationItem
from .alert_modification_properties import AlertModificationProperties
from .alert_modification import AlertModification
from .smart_group_modification_item import SmartGroupModificationItem
from .smart_group_modification_properties import SmartGroupModificationProperties
from .smart_group_modification import SmartGroupModification
from .alerts_summary_group_item import AlertsSummaryGroupItem
from .alerts_summary_group import AlertsSummaryGroup
from .alerts_summary_properties_summary_by_state import AlertsSummaryPropertiesSummaryByState
from .alerts_summary_properties_summary_by_severity_sev0 import AlertsSummaryPropertiesSummaryBySeveritySev0
from .alerts_summary_properties_summary_by_severity_sev1 import AlertsSummaryPropertiesSummaryBySeveritySev1
from .alerts_summary_properties_summary_by_severity_sev2 import AlertsSummaryPropertiesSummaryBySeveritySev2
from .alerts_summary_properties_summary_by_severity_sev3 import AlertsSummaryPropertiesSummaryBySeveritySev3
from .alerts_summary_properties_summary_by_severity_sev4 import AlertsSummaryPropertiesSummaryBySeveritySev4
from .alerts_summary_properties_summary_by_severity import AlertsSummaryPropertiesSummaryBySeverity
from .alerts_summary_properties_summary_by_severity_and_monitor_condition import AlertsSummaryPropertiesSummaryBySeverityAndMonitorCondition
from .alerts_summary_properties_summary_by_monitor_service import AlertsSummaryPropertiesSummaryByMonitorService
from .alerts_summary import AlertsSummary
from .alerts_summary_by_state import AlertsSummaryByState
from .alerts_summary_by_severity_and_monitor_condition_sev0 import AlertsSummaryBySeverityAndMonitorConditionSev0
from .alerts_summary_by_severity_and_monitor_condition_sev1 import AlertsSummaryBySeverityAndMonitorConditionSev1
from .alerts_summary_by_severity_and_monitor_condition_sev2 import AlertsSummaryBySeverityAndMonitorConditionSev2
from .alerts_summary_by_severity_and_monitor_condition_sev3 import AlertsSummaryBySeverityAndMonitorConditionSev3
from .alerts_summary_by_severity_and_monitor_condition_sev4 import AlertsSummaryBySeverityAndMonitorConditionSev4
from .alerts_summary_by_severity_and_monitor_condition import AlertsSummaryBySeverityAndMonitorCondition
from .alerts_summary_by_monitor_condition import AlertsSummaryByMonitorCondition
from .alerts_summary_by_monitor_service import AlertsSummaryByMonitorService
from .smart_group_aggregated_property import SmartGroupAggregatedProperty
from .smart_group import SmartGroup
from .smart_groups_list import SmartGroupsList
from .scope import Scope
from .condition import Condition
from .conditions import Conditions
from .suppression_schedule import SuppressionSchedule
from .suppression_config import SuppressionConfig
from .action_rule_properties import ActionRuleProperties
from .action_rule import ActionRule
from .suppression import Suppression
from .action_group import ActionGroup
from .diagnostics import Diagnostics
from .patch_object import PatchObject
from .operation_paged import OperationPaged
from .alert_paged import AlertPaged
from .action_rule_paged import ActionRulePaged
from .alerts_management_client_enums import (
Severity,
SignalType,
Expand All @@ -58,33 +111,64 @@
AlertModificationEvent,
SmartGroupModificationEvent,
State,
ScopeType,
Operator,
SuppressionType,
ActionRuleStatus,
ApiVersion,
TimeRange,
AlertsSortByFields,
AlertsSummaryGroupByFields,
SmartGroupsSortByFields,
)

__all__ = [
'OperationDisplay',
'Operation',
'Resource',
'Essentials',
'AlertProperties',
'ManagedResource',
'Alert',
'AlertModificationItem',
'AlertModificationProperties',
'AlertModification',
'SmartGroupModificationItem',
'SmartGroupModificationProperties',
'SmartGroupModification',
'AlertsSummaryGroupItem',
'AlertsSummaryGroup',
'AlertsSummaryPropertiesSummaryByState',
'AlertsSummaryPropertiesSummaryBySeveritySev0',
'AlertsSummaryPropertiesSummaryBySeveritySev1',
'AlertsSummaryPropertiesSummaryBySeveritySev2',
'AlertsSummaryPropertiesSummaryBySeveritySev3',
'AlertsSummaryPropertiesSummaryBySeveritySev4',
'AlertsSummaryPropertiesSummaryBySeverity',
'AlertsSummaryPropertiesSummaryBySeverityAndMonitorCondition',
'AlertsSummaryPropertiesSummaryByMonitorService',
'AlertsSummary',
'AlertsSummaryByState',
'AlertsSummaryBySeverityAndMonitorConditionSev0',
'AlertsSummaryBySeverityAndMonitorConditionSev1',
'AlertsSummaryBySeverityAndMonitorConditionSev2',
'AlertsSummaryBySeverityAndMonitorConditionSev3',
'AlertsSummaryBySeverityAndMonitorConditionSev4',
'AlertsSummaryBySeverityAndMonitorCondition',
'AlertsSummaryByMonitorCondition',
'AlertsSummaryByMonitorService',
'SmartGroupAggregatedProperty',
'SmartGroup',
'SmartGroupsList',
'Scope',
'Condition',
'Conditions',
'SuppressionSchedule',
'SuppressionConfig',
'ActionRuleProperties',
'ActionRule',
'Suppression',
'ActionGroup',
'Diagnostics',
'PatchObject',
'OperationPaged',
'AlertPaged',
'ActionRulePaged',
'Severity',
'SignalType',
'AlertState',
Expand All @@ -93,8 +177,12 @@
'AlertModificationEvent',
'SmartGroupModificationEvent',
'State',
'ScopeType',
'Operator',
'SuppressionType',
'ActionRuleStatus',
'ApiVersion',
'TimeRange',
'AlertsSortByFields',
'AlertsSummaryGroupByFields',
'SmartGroupsSortByFields',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .action_rule_properties import ActionRuleProperties


class ActionGroup(ActionRuleProperties):
"""Action Group based Action Rule.

Action rule with action group configuration.

Variables are only populated by the server, and will be ignored when
sending a request.

All required parameters must be populated in order to send to Azure.

:param scope: scope on which action rule will apply
:type scope: ~azure.mgmt.alertsmanagement.models.Scope
:param conditions: conditions on which alerts will be filtered
:type conditions: ~azure.mgmt.alertsmanagement.models.Conditions
:param description: Description of action rule
:type description: str
:ivar created_at: Creation time of action rule. Date-Time in ISO-8601
format.
:vartype created_at: datetime
:ivar last_modified_at: Last updated time of action rule. Date-Time in
ISO-8601 format.
:vartype last_modified_at: datetime
:ivar created_by: Created by user name.
:vartype created_by: str
:ivar last_modified_by: Last modified by user name.
:vartype last_modified_by: str
:param status: Indicates if the given action rule is enabled or disabled.
Possible values include: 'Enabled', 'Disabled'
:type status: str or ~azure.mgmt.alertsmanagement.models.ActionRuleStatus
:param type: Required. Constant filled by server.
:type type: str
:param action_group_id: Required. Action group to trigger if action rule
matches
:type action_group_id: str
"""

_validation = {
'created_at': {'readonly': True},
'last_modified_at': {'readonly': True},
'created_by': {'readonly': True},
'last_modified_by': {'readonly': True},
'type': {'required': True},
'action_group_id': {'required': True},
}

_attribute_map = {
'scope': {'key': 'scope', 'type': 'Scope'},
'conditions': {'key': 'conditions', 'type': 'Conditions'},
'description': {'key': 'description', 'type': 'str'},
'created_at': {'key': 'createdAt', 'type': 'iso-8601'},
'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'},
'created_by': {'key': 'createdBy', 'type': 'str'},
'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'},
'status': {'key': 'status', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'action_group_id': {'key': 'actionGroupId', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ActionGroup, self).__init__(**kwargs)
self.action_group_id = kwargs.get('action_group_id', None)
self.type = 'ActionGroup'
Loading