Skip to content
Prev Previous commit
Next Next commit
[AutoPR monitor/resource-manager] Add "autoMitigate" to Metric Alert …
…API spec for 2018-03-01 (#2592)

* Generated from d5b9b4545a8d15c70d3c8318d39e2f7b43229387

AutoMitigate changes

* Generated from d5b9b4545a8d15c70d3c8318d39e2f7b43229387

AutoMitigate changes
  • Loading branch information
AutorestCI committed Jun 6, 2018
commit 8c4a4cafded2ba82b7979bd2d32af0074c5878d1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .resource import Resource
from .resource_py3 import Resource


class ActionGroupResource(Resource):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .resource import Resource
from .resource_py3 import Resource


class ActivityLogAlertResource(Resource):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .resource import Resource
from .resource_py3 import Resource


class AlertRuleResource(Resource):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class AlertingAction(Action):
:param severity: Required. Severity of the alert. Possible values include:
'0', '1', '2', '3', '4'
:type severity: str or ~azure.mgmt.monitor.models.AlertSeverity
:param azns_action: Required. Azure action group reference.
:param azns_action: Required. azns notification group reference.
:type azns_action: ~azure.mgmt.monitor.models.AzNsActionGroup
:param throttling_in_min: time (in minutes) for which Alerts should be
throttled or suppressed.
throttled
:type throttling_in_min: int
:param trigger: Required. The trigger condition that results in the alert
rule being.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .action import Action
from .action_py3 import Action


class AlertingAction(Action):
Expand All @@ -26,10 +26,10 @@ class AlertingAction(Action):
:param severity: Required. Severity of the alert. Possible values include:
'0', '1', '2', '3', '4'
:type severity: str or ~azure.mgmt.monitor.models.AlertSeverity
:param azns_action: Required. Azure action group reference.
:param azns_action: Required. azns notification group reference.
:type azns_action: ~azure.mgmt.monitor.models.AzNsActionGroup
:param throttling_in_min: time (in minutes) for which Alerts should be
throttled or suppressed.
throttled
:type throttling_in_min: int
:param trigger: Required. The trigger condition that results in the alert
rule being.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .resource import Resource
from .resource_py3 import Resource


class AutoscaleSettingResource(Resource):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@


class AzNsActionGroup(Model):
"""Azure action group.
"""azns notification group.

:param action_group: Azure Action Group reference.
:param action_group: Azure Group reference.
:type action_group: list[str]
:param email_subject: Custom subject override for all email ids in Azure
action group
:param email_subject: Custom subject for Azns email
:type email_subject: str
:param custom_webhook_payload: Custom payload to be sent for all webook
URI in Azure action group
:param custom_webhook_payload: Custom webhook payload to be send to azns
action group
:type custom_webhook_payload: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@


class AzNsActionGroup(Model):
"""Azure action group.
"""azns notification group.

:param action_group: Azure Action Group reference.
:param action_group: Azure Group reference.
:type action_group: list[str]
:param email_subject: Custom subject override for all email ids in Azure
action group
:param email_subject: Custom subject for Azns email
:type email_subject: str
:param custom_webhook_payload: Custom payload to be sent for all webook
URI in Azure action group
:param custom_webhook_payload: Custom webhook payload to be send to azns
action group
:type custom_webhook_payload: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .proxy_only_resource import ProxyOnlyResource
from .proxy_only_resource_py3 import ProxyOnlyResource


class DiagnosticSettingsCategoryResource(ProxyOnlyResource):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .proxy_only_resource import ProxyOnlyResource
from .proxy_only_resource_py3 import ProxyOnlyResource


class DiagnosticSettingsResource(ProxyOnlyResource):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .rule_condition import RuleCondition
from .rule_condition_py3 import RuleCondition


class LocationThresholdRuleCondition(RuleCondition):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .resource import Resource
from .resource_py3 import Resource


class LogProfileResource(Resource):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .resource import Resource
from .resource_py3 import Resource


class LogSearchRuleResource(Resource):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .rule_condition import RuleCondition
from .rule_condition_py3 import RuleCondition


class ManagementEventRuleCondition(RuleCondition):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ class MetricAlertResource(Resource):
:param criteria: Required. defines the specific alert criteria
information.
:type criteria: ~azure.mgmt.monitor.models.MetricAlertCriteria
:param auto_mitigate: the flag that indicates whether the alert should be
auto resolved or not.
:type auto_mitigate: bool
:param actions: the array of actions that are performed when the alert
rule becomes active, and when an alert condition is resolved.
:type actions: list[~azure.mgmt.monitor.models.Action]
Expand Down Expand Up @@ -84,6 +87,7 @@ class MetricAlertResource(Resource):
'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'},
'window_size': {'key': 'properties.windowSize', 'type': 'duration'},
'criteria': {'key': 'properties.criteria', 'type': 'MetricAlertCriteria'},
'auto_mitigate': {'key': 'properties.autoMitigate', 'type': 'bool'},
'actions': {'key': 'properties.actions', 'type': '[Action]'},
'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'},
}
Expand All @@ -97,5 +101,6 @@ def __init__(self, **kwargs):
self.evaluation_frequency = kwargs.get('evaluation_frequency', None)
self.window_size = kwargs.get('window_size', None)
self.criteria = kwargs.get('criteria', None)
self.auto_mitigate = kwargs.get('auto_mitigate', None)
self.actions = kwargs.get('actions', None)
self.last_updated_time = None
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ class MetricAlertResourcePatch(Model):
:param criteria: Required. defines the specific alert criteria
information.
:type criteria: ~azure.mgmt.monitor.models.MetricAlertCriteria
:param auto_mitigate: the flag that indicates whether the alert should be
auto resolved or not.
:type auto_mitigate: bool
:param actions: the array of actions that are performed when the alert
rule becomes active, and when an alert condition is resolved.
:type actions: list[~azure.mgmt.monitor.models.Action]
Expand All @@ -68,6 +71,7 @@ class MetricAlertResourcePatch(Model):
'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'},
'window_size': {'key': 'properties.windowSize', 'type': 'duration'},
'criteria': {'key': 'properties.criteria', 'type': 'MetricAlertCriteria'},
'auto_mitigate': {'key': 'properties.autoMitigate', 'type': 'bool'},
'actions': {'key': 'properties.actions', 'type': '[Action]'},
'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'},
}
Expand All @@ -82,5 +86,6 @@ def __init__(self, **kwargs):
self.evaluation_frequency = kwargs.get('evaluation_frequency', None)
self.window_size = kwargs.get('window_size', None)
self.criteria = kwargs.get('criteria', None)
self.auto_mitigate = kwargs.get('auto_mitigate', None)
self.actions = kwargs.get('actions', None)
self.last_updated_time = None
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ class MetricAlertResourcePatch(Model):
:param criteria: Required. defines the specific alert criteria
information.
:type criteria: ~azure.mgmt.monitor.models.MetricAlertCriteria
:param auto_mitigate: the flag that indicates whether the alert should be
auto resolved or not.
:type auto_mitigate: bool
:param actions: the array of actions that are performed when the alert
rule becomes active, and when an alert condition is resolved.
:type actions: list[~azure.mgmt.monitor.models.Action]
Expand All @@ -68,11 +71,12 @@ class MetricAlertResourcePatch(Model):
'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'},
'window_size': {'key': 'properties.windowSize', 'type': 'duration'},
'criteria': {'key': 'properties.criteria', 'type': 'MetricAlertCriteria'},
'auto_mitigate': {'key': 'properties.autoMitigate', 'type': 'bool'},
'actions': {'key': 'properties.actions', 'type': '[Action]'},
'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'},
}

def __init__(self, *, description: str, severity: int, enabled: bool, evaluation_frequency, window_size, criteria, tags=None, scopes=None, actions=None, **kwargs) -> None:
def __init__(self, *, description: str, severity: int, enabled: bool, evaluation_frequency, window_size, criteria, tags=None, scopes=None, auto_mitigate: bool=None, actions=None, **kwargs) -> None:
super(MetricAlertResourcePatch, self).__init__(**kwargs)
self.tags = tags
self.description = description
Expand All @@ -82,5 +86,6 @@ def __init__(self, *, description: str, severity: int, enabled: bool, evaluation
self.evaluation_frequency = evaluation_frequency
self.window_size = window_size
self.criteria = criteria
self.auto_mitigate = auto_mitigate
self.actions = actions
self.last_updated_time = None
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .resource import Resource
from .resource_py3 import Resource


class MetricAlertResource(Resource):
Expand Down Expand Up @@ -50,6 +50,9 @@ class MetricAlertResource(Resource):
:param criteria: Required. defines the specific alert criteria
information.
:type criteria: ~azure.mgmt.monitor.models.MetricAlertCriteria
:param auto_mitigate: the flag that indicates whether the alert should be
auto resolved or not.
:type auto_mitigate: bool
:param actions: the array of actions that are performed when the alert
rule becomes active, and when an alert condition is resolved.
:type actions: list[~azure.mgmt.monitor.models.Action]
Expand Down Expand Up @@ -84,11 +87,12 @@ class MetricAlertResource(Resource):
'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'},
'window_size': {'key': 'properties.windowSize', 'type': 'duration'},
'criteria': {'key': 'properties.criteria', 'type': 'MetricAlertCriteria'},
'auto_mitigate': {'key': 'properties.autoMitigate', 'type': 'bool'},
'actions': {'key': 'properties.actions', 'type': '[Action]'},
'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'},
}

def __init__(self, *, location: str, description: str, severity: int, enabled: bool, evaluation_frequency, window_size, criteria, tags=None, scopes=None, actions=None, **kwargs) -> None:
def __init__(self, *, location: str, description: str, severity: int, enabled: bool, evaluation_frequency, window_size, criteria, tags=None, scopes=None, auto_mitigate: bool=None, actions=None, **kwargs) -> None:
super(MetricAlertResource, self).__init__(location=location, tags=tags, **kwargs)
self.description = description
self.severity = severity
Expand All @@ -97,5 +101,6 @@ def __init__(self, *, location: str, description: str, severity: int, enabled: b
self.evaluation_frequency = evaluation_frequency
self.window_size = window_size
self.criteria = criteria
self.auto_mitigate = auto_mitigate
self.actions = actions
self.last_updated_time = None
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .metric_alert_criteria import MetricAlertCriteria
from .metric_alert_criteria_py3 import MetricAlertCriteria


class MetricAlertSingleResourceMultipleMetricCriteria(MetricAlertCriteria):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .rule_action import RuleAction
from .rule_action_py3 import RuleAction


class RuleEmailAction(RuleAction):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .rule_data_source import RuleDataSource
from .rule_data_source_py3 import RuleDataSource


class RuleManagementEventDataSource(RuleDataSource):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .rule_data_source import RuleDataSource
from .rule_data_source_py3 import RuleDataSource


class RuleMetricDataSource(RuleDataSource):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .rule_action import RuleAction
from .rule_action_py3 import RuleAction


class RuleWebhookAction(RuleAction):
Expand Down
10 changes: 5 additions & 5 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class Source(Model):
:type query: str
:param authorized_resources: List of Resource referred into query
:type authorized_resources: list[str]
:param data_source_id: Required. The resource uri over which log search
:param datasource_id: Required. The resource uri over which log search
query is to be run.
:type data_source_id: str
:type datasource_id: str
:param query_type: Set value to ResultCount if query should be returning
search result count. Set it to Number if its a metric query. Possible
values include: 'ResultCount'
Expand All @@ -32,19 +32,19 @@ class Source(Model):

_validation = {
'query': {'required': True},
'data_source_id': {'required': True},
'datasource_id': {'required': True},
}

_attribute_map = {
'query': {'key': 'query', 'type': 'str'},
'authorized_resources': {'key': 'authorizedResources', 'type': '[str]'},
'data_source_id': {'key': 'dataSourceId', 'type': 'str'},
'datasource_id': {'key': 'datasourceId', 'type': 'str'},
'query_type': {'key': 'queryType', 'type': 'str'},
}

def __init__(self, **kwargs):
super(Source, self).__init__(**kwargs)
self.query = kwargs.get('query', None)
self.authorized_resources = kwargs.get('authorized_resources', None)
self.data_source_id = kwargs.get('data_source_id', None)
self.datasource_id = kwargs.get('datasource_id', None)
self.query_type = kwargs.get('query_type', None)
Loading