Skip to content

Commit

Permalink
[AutoPR monitor/resource-manager] [Monitor] Deconflict "Action" name …
Browse files Browse the repository at this point in the history
…in MetricAlert (#2617)

* Generated from 35adc5e493c20a57e6e2cb35d87c578133d2b7a6

[Monitor] Deconflict "Action" name in MetricAlert

Generates bad SDK.

* Generated from ebfaf0bdd7f2bcf736598d8ec501f490a83d1268

Update reference to MetricAlertAction
  • Loading branch information
AutorestCI committed Jun 6, 2018
1 parent 8c4a4ca commit 7d3085e
Show file tree
Hide file tree
Showing 15 changed files with 110 additions and 69 deletions.
9 changes: 6 additions & 3 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
from .baseline_response_py3 import BaselineResponse
from .time_series_information_py3 import TimeSeriesInformation
from .calculate_baseline_response_py3 import CalculateBaselineResponse
from .action_py3 import Action
from .metric_alert_action_py3 import MetricAlertAction
from .metric_alert_criteria_py3 import MetricAlertCriteria
from .metric_alert_resource_py3 import MetricAlertResource
from .metric_alert_resource_patch_py3 import MetricAlertResourcePatch
Expand All @@ -99,6 +99,7 @@
from .metric_alert_single_resource_multiple_metric_criteria_py3 import MetricAlertSingleResourceMultipleMetricCriteria
from .source_py3 import Source
from .schedule_py3 import Schedule
from .action_py3 import Action
from .log_search_rule_resource_py3 import LogSearchRuleResource
from .trigger_condition_py3 import TriggerCondition
from .az_ns_action_group_py3 import AzNsActionGroup
Expand Down Expand Up @@ -181,7 +182,7 @@
from .baseline_response import BaselineResponse
from .time_series_information import TimeSeriesInformation
from .calculate_baseline_response import CalculateBaselineResponse
from .action import Action
from .metric_alert_action import MetricAlertAction
from .metric_alert_criteria import MetricAlertCriteria
from .metric_alert_resource import MetricAlertResource
from .metric_alert_resource_patch import MetricAlertResourcePatch
Expand All @@ -193,6 +194,7 @@
from .metric_alert_single_resource_multiple_metric_criteria import MetricAlertSingleResourceMultipleMetricCriteria
from .source import Source
from .schedule import Schedule
from .action import Action
from .log_search_rule_resource import LogSearchRuleResource
from .trigger_condition import TriggerCondition
from .az_ns_action_group import AzNsActionGroup
Expand Down Expand Up @@ -310,7 +312,7 @@
'BaselineResponse',
'TimeSeriesInformation',
'CalculateBaselineResponse',
'Action',
'MetricAlertAction',
'MetricAlertCriteria',
'MetricAlertResource',
'MetricAlertResourcePatch',
Expand All @@ -322,6 +324,7 @@
'MetricAlertSingleResourceMultipleMetricCriteria',
'Source',
'Schedule',
'Action',
'LogSearchRuleResource',
'TriggerCondition',
'AzNsActionGroup',
Expand Down
10 changes: 1 addition & 9 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@


class Action(Model):
"""An alert action.
"""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
"""
Expand All @@ -33,8 +29,6 @@ class Action(Model):
}

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

Expand All @@ -44,6 +38,4 @@ class Action(Model):

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
12 changes: 2 additions & 10 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/action_py3.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@


class Action(Model):
"""An alert action.
"""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
"""
Expand All @@ -33,17 +29,13 @@ class Action(Model):
}

_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:
def __init__(self, **kwargs) -> None:
super(Action, self).__init__(**kwargs)
self.action_group_id = action_group_id
self.webhook_properties = webhook_properties
self.odatatype = None
10 changes: 2 additions & 8 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/alerting_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,15 @@ class AlertingAction(Action):
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
: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. azns notification group reference.
:param azns_action: Required. Azure action group reference.
:type azns_action: ~azure.mgmt.monitor.models.AzNsActionGroup
:param throttling_in_min: time (in minutes) for which Alerts should be
throttled
throttled or suppressed.
:type throttling_in_min: int
:param trigger: Required. The trigger condition that results in the alert
rule being.
Expand All @@ -44,8 +40,6 @@ class AlertingAction(Action):
}

_attribute_map = {
'action_group_id': {'key': 'actionGroupId', 'type': 'str'},
'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'},
'odatatype': {'key': 'odata\\.type', 'type': 'str'},
'severity': {'key': 'severity', 'type': 'str'},
'azns_action': {'key': 'aznsAction', 'type': 'AzNsActionGroup'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,15 @@ class AlertingAction(Action):
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
: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. azns notification group reference.
:param azns_action: Required. Azure action group reference.
:type azns_action: ~azure.mgmt.monitor.models.AzNsActionGroup
:param throttling_in_min: time (in minutes) for which Alerts should be
throttled
throttled or suppressed.
:type throttling_in_min: int
:param trigger: Required. The trigger condition that results in the alert
rule being.
Expand All @@ -44,17 +40,15 @@ class AlertingAction(Action):
}

_attribute_map = {
'action_group_id': {'key': 'actionGroupId', 'type': 'str'},
'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'},
'odatatype': {'key': 'odata\\.type', 'type': 'str'},
'severity': {'key': 'severity', 'type': 'str'},
'azns_action': {'key': 'aznsAction', 'type': 'AzNsActionGroup'},
'throttling_in_min': {'key': 'throttlingInMin', 'type': 'int'},
'trigger': {'key': 'trigger', 'type': 'TriggerCondition'},
}

def __init__(self, *, severity, azns_action, trigger, action_group_id: str=None, webhook_properties=None, throttling_in_min: int=None, **kwargs) -> None:
super(AlertingAction, self).__init__(action_group_id=action_group_id, webhook_properties=webhook_properties, **kwargs)
def __init__(self, *, severity, azns_action, trigger, throttling_in_min: int=None, **kwargs) -> None:
super(AlertingAction, self).__init__(**kwargs)
self.severity = severity
self.azns_action = azns_action
self.throttling_in_min = throttling_in_min
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@


class AzNsActionGroup(Model):
"""azns notification group.
"""Azure action group.
:param action_group: Azure Group reference.
:param action_group: Azure Action 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
:param email_subject: Custom subject override for all email ids in Azure
action group
:type email_subject: str
:param custom_webhook_payload: Custom payload to be sent for all webook
URI in Azure action group
:type custom_webhook_payload: str
"""

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


class AzNsActionGroup(Model):
"""azns notification group.
"""Azure action group.
:param action_group: Azure Group reference.
:param action_group: Azure Action 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
:param email_subject: Custom subject override for all email ids in Azure
action group
:type email_subject: str
:param custom_webhook_payload: Custom payload to be sent for all webook
URI in Azure action group
:type custom_webhook_payload: str
"""

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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 MetricAlertAction(Model):
"""An alert action.
: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]
"""

_attribute_map = {
'action_group_id': {'key': 'actionGroupId', 'type': 'str'},
'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'},
}

def __init__(self, **kwargs):
super(MetricAlertAction, self).__init__(**kwargs)
self.action_group_id = kwargs.get('action_group_id', None)
self.webhook_properties = kwargs.get('webhook_properties', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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 MetricAlertAction(Model):
"""An alert action.
: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]
"""

_attribute_map = {
'action_group_id': {'key': 'actionGroupId', 'type': 'str'},
'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'},
}

def __init__(self, *, action_group_id: str=None, webhook_properties=None, **kwargs) -> None:
super(MetricAlertAction, self).__init__(**kwargs)
self.action_group_id = action_group_id
self.webhook_properties = webhook_properties
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class MetricAlertResource(Resource):
: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]
:type actions: list[~azure.mgmt.monitor.models.MetricAlertAction]
:ivar last_updated_time: Last time the rule was updated in ISO8601 format.
:vartype last_updated_time: datetime
"""
Expand Down Expand Up @@ -88,7 +88,7 @@ class MetricAlertResource(Resource):
'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]'},
'actions': {'key': 'properties.actions', 'type': '[MetricAlertAction]'},
'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class MetricAlertResourcePatch(Model):
: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]
:type actions: list[~azure.mgmt.monitor.models.MetricAlertAction]
:ivar last_updated_time: Last time the rule was updated in ISO8601 format.
:vartype last_updated_time: datetime
"""
Expand All @@ -72,7 +72,7 @@ class MetricAlertResourcePatch(Model):
'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]'},
'actions': {'key': 'properties.actions', 'type': '[MetricAlertAction]'},
'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class MetricAlertResourcePatch(Model):
: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]
:type actions: list[~azure.mgmt.monitor.models.MetricAlertAction]
:ivar last_updated_time: Last time the rule was updated in ISO8601 format.
:vartype last_updated_time: datetime
"""
Expand All @@ -72,7 +72,7 @@ class MetricAlertResourcePatch(Model):
'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]'},
'actions': {'key': 'properties.actions', 'type': '[MetricAlertAction]'},
'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class MetricAlertResource(Resource):
: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]
:type actions: list[~azure.mgmt.monitor.models.MetricAlertAction]
:ivar last_updated_time: Last time the rule was updated in ISO8601 format.
:vartype last_updated_time: datetime
"""
Expand Down Expand Up @@ -88,7 +88,7 @@ class MetricAlertResource(Resource):
'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]'},
'actions': {'key': 'properties.actions', 'type': '[MetricAlertAction]'},
'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'},
}

Expand Down
Loading

0 comments on commit 7d3085e

Please sign in to comment.