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
34 changes: 34 additions & 0 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@
from .metric_dimension_py3 import MetricDimension
from .metric_criteria_py3 import MetricCriteria
from .metric_alert_single_resource_multiple_metric_criteria_py3 import MetricAlertSingleResourceMultipleMetricCriteria
from .source_py3 import Source
from .schedule_py3 import Schedule
from .log_search_rule_resource_py3 import LogSearchRuleResource
from .trigger_condition_py3 import TriggerCondition
from .az_ns_action_group_py3 import AzNsActionGroup
from .alerting_action_py3 import AlertingAction
except (SyntaxError, ImportError):
from .resource import Resource
from .scale_capacity import ScaleCapacity
Expand Down Expand Up @@ -185,6 +191,12 @@
from .metric_dimension import MetricDimension
from .metric_criteria import MetricCriteria
from .metric_alert_single_resource_multiple_metric_criteria import MetricAlertSingleResourceMultipleMetricCriteria
from .source import Source
from .schedule import Schedule
from .log_search_rule_resource import LogSearchRuleResource
from .trigger_condition import TriggerCondition
from .az_ns_action_group import AzNsActionGroup
from .alerting_action import AlertingAction
from .autoscale_setting_resource_paged import AutoscaleSettingResourcePaged
from .incident_paged import IncidentPaged
from .alert_rule_resource_paged import AlertRuleResourcePaged
Expand All @@ -195,10 +207,13 @@
from .localizable_string_paged import LocalizableStringPaged
from .metric_definition_paged import MetricDefinitionPaged
from .metric_alert_resource_paged import MetricAlertResourcePaged
from .log_search_rule_resource_paged import LogSearchRuleResourcePaged
from .monitor_management_client_enums import (
MetricStatisticType,
TimeAggregationType,
ComparisonOperationType,
ConditionalOperator,
MetricTriggerType,
ScaleDirection,
ScaleType,
RecurrenceFrequency,
Expand All @@ -210,6 +225,11 @@
Unit,
AggregationType,
Sensitivity,
Enabled,
SkuType,
QueryType,
AlertSeverity,
AlertStatus,
ResultType,
)

Expand Down Expand Up @@ -301,6 +321,12 @@
'MetricDimension',
'MetricCriteria',
'MetricAlertSingleResourceMultipleMetricCriteria',
'Source',
'Schedule',
'LogSearchRuleResource',
'TriggerCondition',
'AzNsActionGroup',
'AlertingAction',
'AutoscaleSettingResourcePaged',
'IncidentPaged',
'AlertRuleResourcePaged',
Expand All @@ -311,9 +337,12 @@
'LocalizableStringPaged',
'MetricDefinitionPaged',
'MetricAlertResourcePaged',
'LogSearchRuleResourcePaged',
'MetricStatisticType',
'TimeAggregationType',
'ComparisonOperationType',
'ConditionalOperator',
'MetricTriggerType',
'ScaleDirection',
'ScaleType',
'RecurrenceFrequency',
Expand All @@ -325,5 +354,10 @@
'Unit',
'AggregationType',
'Sensitivity',
'Enabled',
'SkuType',
'QueryType',
'AlertSeverity',
'AlertStatus',
'ResultType',
]
17 changes: 17 additions & 0 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,35 @@
class Action(Model):
"""An alert action.

You probably want to use the sub-classes and not this class directly. Known
sub-classes are: AlertingAction

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

:param action_group_id: the id of the action group to use.
:type action_group_id: str
:param webhook_properties:
:type webhook_properties: dict[str, str]
:param odatatype: Required. Constant filled by server.
:type odatatype: str
"""

_validation = {
'odatatype': {'required': True},
}

_attribute_map = {
'action_group_id': {'key': 'actionGroupId', 'type': 'str'},
'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'},
'odatatype': {'key': 'odata\\.type', 'type': 'str'},
}

_subtype_map = {
'odatatype': {'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction': 'AlertingAction'}
}

def __init__(self, **kwargs):
super(Action, self).__init__(**kwargs)
self.action_group_id = kwargs.get('action_group_id', None)
self.webhook_properties = kwargs.get('webhook_properties', None)
self.odatatype = None
17 changes: 17 additions & 0 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/action_py3.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,35 @@
class Action(Model):
"""An alert action.

You probably want to use the sub-classes and not this class directly. Known
sub-classes are: AlertingAction

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

:param action_group_id: the id of the action group to use.
:type action_group_id: str
:param webhook_properties:
:type webhook_properties: dict[str, str]
:param odatatype: Required. Constant filled by server.
:type odatatype: str
"""

_validation = {
'odatatype': {'required': True},
}

_attribute_map = {
'action_group_id': {'key': 'actionGroupId', 'type': 'str'},
'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'},
'odatatype': {'key': 'odata\\.type', 'type': 'str'},
}

_subtype_map = {
'odatatype': {'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction': 'AlertingAction'}
}

def __init__(self, *, action_group_id: str=None, webhook_properties=None, **kwargs) -> None:
super(Action, self).__init__(**kwargs)
self.action_group_id = action_group_id
self.webhook_properties = webhook_properties
self.odatatype = None
74 changes: 74 additions & 0 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/alerting_action.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# 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 import Action


class AlertingAction(Action):
"""AlertingAction.

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 action_group_id: the id of the action group to use.
:type action_group_id: str
:param webhook_properties:
:type webhook_properties: dict[str, str]
:param odatatype: Required. Constant filled by server.
:type odatatype: str
:ivar last_fired_time: Last time the rule was fired in IS08601 format.
:vartype last_fired_time: str
:param severity: Severity of the alert. Possible values include: '1', '2',
'3', '4'
:type severity: str or ~azure.mgmt.monitor.models.AlertSeverity
:ivar status: Alert state. Possible values include: 'Active', 'Inactive'
:vartype status: str or ~azure.mgmt.monitor.models.AlertStatus
:param azns_action: Required. azns notification group reference.
:type azns_action: ~azure.mgmt.monitor.models.AzNsActionGroup
:param throttle_till_date: Time untill alert should not be fired in
ISO8601 format.
:type throttle_till_date: datetime
:param trigger: Required. The trigger condition that results in the alert
rule being.
:type trigger: ~azure.mgmt.monitor.models.TriggerCondition
"""

_validation = {
'odatatype': {'required': True},
'last_fired_time': {'readonly': True},
'status': {'readonly': True},
'azns_action': {'required': True},
'trigger': {'required': True},
}

_attribute_map = {
'action_group_id': {'key': 'actionGroupId', 'type': 'str'},
'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'},
'odatatype': {'key': 'odata\\.type', 'type': 'str'},
'last_fired_time': {'key': 'lastFiredTime', 'type': 'str'},
'severity': {'key': 'severity', 'type': 'str'},
'status': {'key': 'status', 'type': 'str'},
'azns_action': {'key': 'aznsAction', 'type': 'AzNsActionGroup'},
'throttle_till_date': {'key': 'throttleTillDate', 'type': 'iso-8601'},
'trigger': {'key': 'trigger', 'type': 'TriggerCondition'},
}

def __init__(self, **kwargs):
super(AlertingAction, self).__init__(**kwargs)
self.last_fired_time = None
self.severity = kwargs.get('severity', None)
self.status = None
self.azns_action = kwargs.get('azns_action', None)
self.throttle_till_date = kwargs.get('throttle_till_date', None)
self.trigger = kwargs.get('trigger', None)
self.odatatype = 'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction'
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# 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 import Action


class AlertingAction(Action):
"""AlertingAction.

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 action_group_id: the id of the action group to use.
:type action_group_id: str
:param webhook_properties:
:type webhook_properties: dict[str, str]
:param odatatype: Required. Constant filled by server.
:type odatatype: str
:ivar last_fired_time: Last time the rule was fired in IS08601 format.
:vartype last_fired_time: str
:param severity: Severity of the alert. Possible values include: '1', '2',
'3', '4'
:type severity: str or ~azure.mgmt.monitor.models.AlertSeverity
:ivar status: Alert state. Possible values include: 'Active', 'Inactive'
:vartype status: str or ~azure.mgmt.monitor.models.AlertStatus
:param azns_action: Required. azns notification group reference.
:type azns_action: ~azure.mgmt.monitor.models.AzNsActionGroup
:param throttle_till_date: Time untill alert should not be fired in
ISO8601 format.
:type throttle_till_date: datetime
:param trigger: Required. The trigger condition that results in the alert
rule being.
:type trigger: ~azure.mgmt.monitor.models.TriggerCondition
"""

_validation = {
'odatatype': {'required': True},
'last_fired_time': {'readonly': True},
'status': {'readonly': True},
'azns_action': {'required': True},
'trigger': {'required': True},
}

_attribute_map = {
'action_group_id': {'key': 'actionGroupId', 'type': 'str'},
'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'},
'odatatype': {'key': 'odata\\.type', 'type': 'str'},
'last_fired_time': {'key': 'lastFiredTime', 'type': 'str'},
'severity': {'key': 'severity', 'type': 'str'},
'status': {'key': 'status', 'type': 'str'},
'azns_action': {'key': 'aznsAction', 'type': 'AzNsActionGroup'},
'throttle_till_date': {'key': 'throttleTillDate', 'type': 'iso-8601'},
'trigger': {'key': 'trigger', 'type': 'TriggerCondition'},
}

def __init__(self, *, azns_action, trigger, action_group_id: str=None, webhook_properties=None, severity=None, throttle_till_date=None, **kwargs) -> None:
super(AlertingAction, self).__init__(action_group_id=action_group_id, webhook_properties=webhook_properties, **kwargs)
self.last_fired_time = None
self.severity = severity
self.status = None
self.azns_action = azns_action
self.throttle_till_date = throttle_till_date
self.trigger = trigger
self.odatatype = 'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction'
37 changes: 37 additions & 0 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/az_ns_action_group.py
Original file line number Diff line number Diff line change
@@ -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 AzNsActionGroup(Model):
"""azns notification group.

:param action_group: azns notification group reference.
:type action_group: list[str]
:param email_subject: Custom subject for Azns email
:type email_subject: str
:param custom_webhook_payload: Custom webhook payload to be send to azns
action group
:type custom_webhook_payload: str
"""

_attribute_map = {
'action_group': {'key': 'actionGroup', 'type': '[str]'},
'email_subject': {'key': 'emailSubject', 'type': 'str'},
'custom_webhook_payload': {'key': 'customWebhookPayload', 'type': 'str'},
}

def __init__(self, **kwargs):
super(AzNsActionGroup, self).__init__(**kwargs)
self.action_group = kwargs.get('action_group', None)
self.email_subject = kwargs.get('email_subject', None)
self.custom_webhook_payload = kwargs.get('custom_webhook_payload', None)
Original file line number Diff line number Diff line change
@@ -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 AzNsActionGroup(Model):
"""azns notification group.

:param action_group: azns notification group reference.
:type action_group: list[str]
:param email_subject: Custom subject for Azns email
:type email_subject: str
:param custom_webhook_payload: Custom webhook payload to be send to azns
action group
:type custom_webhook_payload: str
"""

_attribute_map = {
'action_group': {'key': 'actionGroup', 'type': '[str]'},
'email_subject': {'key': 'emailSubject', 'type': 'str'},
'custom_webhook_payload': {'key': 'customWebhookPayload', 'type': 'str'},
}

def __init__(self, *, action_group=None, email_subject: str=None, custom_webhook_payload: str=None, **kwargs) -> None:
super(AzNsActionGroup, self).__init__(**kwargs)
self.action_group = action_group
self.email_subject = email_subject
self.custom_webhook_payload = custom_webhook_payload
Loading