Skip to content

Commit 7d3085e

Browse files
committed
[AutoPR monitor/resource-manager] [Monitor] Deconflict "Action" name in MetricAlert (#2617)
* Generated from 35adc5e493c20a57e6e2cb35d87c578133d2b7a6 [Monitor] Deconflict "Action" name in MetricAlert Generates bad SDK. * Generated from ebfaf0bdd7f2bcf736598d8ec501f490a83d1268 Update reference to MetricAlertAction
1 parent 8c4a4ca commit 7d3085e

15 files changed

+110
-69
lines changed

azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
from .baseline_response_py3 import BaselineResponse
8888
from .time_series_information_py3 import TimeSeriesInformation
8989
from .calculate_baseline_response_py3 import CalculateBaselineResponse
90-
from .action_py3 import Action
90+
from .metric_alert_action_py3 import MetricAlertAction
9191
from .metric_alert_criteria_py3 import MetricAlertCriteria
9292
from .metric_alert_resource_py3 import MetricAlertResource
9393
from .metric_alert_resource_patch_py3 import MetricAlertResourcePatch
@@ -99,6 +99,7 @@
9999
from .metric_alert_single_resource_multiple_metric_criteria_py3 import MetricAlertSingleResourceMultipleMetricCriteria
100100
from .source_py3 import Source
101101
from .schedule_py3 import Schedule
102+
from .action_py3 import Action
102103
from .log_search_rule_resource_py3 import LogSearchRuleResource
103104
from .trigger_condition_py3 import TriggerCondition
104105
from .az_ns_action_group_py3 import AzNsActionGroup
@@ -181,7 +182,7 @@
181182
from .baseline_response import BaselineResponse
182183
from .time_series_information import TimeSeriesInformation
183184
from .calculate_baseline_response import CalculateBaselineResponse
184-
from .action import Action
185+
from .metric_alert_action import MetricAlertAction
185186
from .metric_alert_criteria import MetricAlertCriteria
186187
from .metric_alert_resource import MetricAlertResource
187188
from .metric_alert_resource_patch import MetricAlertResourcePatch
@@ -193,6 +194,7 @@
193194
from .metric_alert_single_resource_multiple_metric_criteria import MetricAlertSingleResourceMultipleMetricCriteria
194195
from .source import Source
195196
from .schedule import Schedule
197+
from .action import Action
196198
from .log_search_rule_resource import LogSearchRuleResource
197199
from .trigger_condition import TriggerCondition
198200
from .az_ns_action_group import AzNsActionGroup
@@ -310,7 +312,7 @@
310312
'BaselineResponse',
311313
'TimeSeriesInformation',
312314
'CalculateBaselineResponse',
313-
'Action',
315+
'MetricAlertAction',
314316
'MetricAlertCriteria',
315317
'MetricAlertResource',
316318
'MetricAlertResourcePatch',
@@ -322,6 +324,7 @@
322324
'MetricAlertSingleResourceMultipleMetricCriteria',
323325
'Source',
324326
'Schedule',
327+
'Action',
325328
'LogSearchRuleResource',
326329
'TriggerCondition',
327330
'AzNsActionGroup',

azure-mgmt-monitor/azure/mgmt/monitor/models/action.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,13 @@
1313

1414

1515
class Action(Model):
16-
"""An alert action.
16+
"""Action.
1717
1818
You probably want to use the sub-classes and not this class directly. Known
1919
sub-classes are: AlertingAction
2020
2121
All required parameters must be populated in order to send to Azure.
2222
23-
:param action_group_id: the id of the action group to use.
24-
:type action_group_id: str
25-
:param webhook_properties:
26-
:type webhook_properties: dict[str, str]
2723
:param odatatype: Required. Constant filled by server.
2824
:type odatatype: str
2925
"""
@@ -33,8 +29,6 @@ class Action(Model):
3329
}
3430

3531
_attribute_map = {
36-
'action_group_id': {'key': 'actionGroupId', 'type': 'str'},
37-
'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'},
3832
'odatatype': {'key': 'odata\\.type', 'type': 'str'},
3933
}
4034

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

4539
def __init__(self, **kwargs):
4640
super(Action, self).__init__(**kwargs)
47-
self.action_group_id = kwargs.get('action_group_id', None)
48-
self.webhook_properties = kwargs.get('webhook_properties', None)
4941
self.odatatype = None

azure-mgmt-monitor/azure/mgmt/monitor/models/action_py3.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,13 @@
1313

1414

1515
class Action(Model):
16-
"""An alert action.
16+
"""Action.
1717
1818
You probably want to use the sub-classes and not this class directly. Known
1919
sub-classes are: AlertingAction
2020
2121
All required parameters must be populated in order to send to Azure.
2222
23-
:param action_group_id: the id of the action group to use.
24-
:type action_group_id: str
25-
:param webhook_properties:
26-
:type webhook_properties: dict[str, str]
2723
:param odatatype: Required. Constant filled by server.
2824
:type odatatype: str
2925
"""
@@ -33,17 +29,13 @@ class Action(Model):
3329
}
3430

3531
_attribute_map = {
36-
'action_group_id': {'key': 'actionGroupId', 'type': 'str'},
37-
'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'},
3832
'odatatype': {'key': 'odata\\.type', 'type': 'str'},
3933
}
4034

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

45-
def __init__(self, *, action_group_id: str=None, webhook_properties=None, **kwargs) -> None:
39+
def __init__(self, **kwargs) -> None:
4640
super(Action, self).__init__(**kwargs)
47-
self.action_group_id = action_group_id
48-
self.webhook_properties = webhook_properties
4941
self.odatatype = None

azure-mgmt-monitor/azure/mgmt/monitor/models/alerting_action.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,15 @@ class AlertingAction(Action):
1717
1818
All required parameters must be populated in order to send to Azure.
1919
20-
:param action_group_id: the id of the action group to use.
21-
:type action_group_id: str
22-
:param webhook_properties:
23-
:type webhook_properties: dict[str, str]
2420
:param odatatype: Required. Constant filled by server.
2521
:type odatatype: str
2622
:param severity: Required. Severity of the alert. Possible values include:
2723
'0', '1', '2', '3', '4'
2824
:type severity: str or ~azure.mgmt.monitor.models.AlertSeverity
29-
:param azns_action: Required. azns notification group reference.
25+
:param azns_action: Required. Azure action group reference.
3026
:type azns_action: ~azure.mgmt.monitor.models.AzNsActionGroup
3127
:param throttling_in_min: time (in minutes) for which Alerts should be
32-
throttled
28+
throttled or suppressed.
3329
:type throttling_in_min: int
3430
:param trigger: Required. The trigger condition that results in the alert
3531
rule being.
@@ -44,8 +40,6 @@ class AlertingAction(Action):
4440
}
4541

4642
_attribute_map = {
47-
'action_group_id': {'key': 'actionGroupId', 'type': 'str'},
48-
'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'},
4943
'odatatype': {'key': 'odata\\.type', 'type': 'str'},
5044
'severity': {'key': 'severity', 'type': 'str'},
5145
'azns_action': {'key': 'aznsAction', 'type': 'AzNsActionGroup'},

azure-mgmt-monitor/azure/mgmt/monitor/models/alerting_action_py3.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,15 @@ class AlertingAction(Action):
1717
1818
All required parameters must be populated in order to send to Azure.
1919
20-
:param action_group_id: the id of the action group to use.
21-
:type action_group_id: str
22-
:param webhook_properties:
23-
:type webhook_properties: dict[str, str]
2420
:param odatatype: Required. Constant filled by server.
2521
:type odatatype: str
2622
:param severity: Required. Severity of the alert. Possible values include:
2723
'0', '1', '2', '3', '4'
2824
:type severity: str or ~azure.mgmt.monitor.models.AlertSeverity
29-
:param azns_action: Required. azns notification group reference.
25+
:param azns_action: Required. Azure action group reference.
3026
:type azns_action: ~azure.mgmt.monitor.models.AzNsActionGroup
3127
:param throttling_in_min: time (in minutes) for which Alerts should be
32-
throttled
28+
throttled or suppressed.
3329
:type throttling_in_min: int
3430
:param trigger: Required. The trigger condition that results in the alert
3531
rule being.
@@ -44,17 +40,15 @@ class AlertingAction(Action):
4440
}
4541

4642
_attribute_map = {
47-
'action_group_id': {'key': 'actionGroupId', 'type': 'str'},
48-
'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'},
4943
'odatatype': {'key': 'odata\\.type', 'type': 'str'},
5044
'severity': {'key': 'severity', 'type': 'str'},
5145
'azns_action': {'key': 'aznsAction', 'type': 'AzNsActionGroup'},
5246
'throttling_in_min': {'key': 'throttlingInMin', 'type': 'int'},
5347
'trigger': {'key': 'trigger', 'type': 'TriggerCondition'},
5448
}
5549

56-
def __init__(self, *, severity, azns_action, trigger, action_group_id: str=None, webhook_properties=None, throttling_in_min: int=None, **kwargs) -> None:
57-
super(AlertingAction, self).__init__(action_group_id=action_group_id, webhook_properties=webhook_properties, **kwargs)
50+
def __init__(self, *, severity, azns_action, trigger, throttling_in_min: int=None, **kwargs) -> None:
51+
super(AlertingAction, self).__init__(**kwargs)
5852
self.severity = severity
5953
self.azns_action = azns_action
6054
self.throttling_in_min = throttling_in_min

azure-mgmt-monitor/azure/mgmt/monitor/models/az_ns_action_group.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313

1414

1515
class AzNsActionGroup(Model):
16-
"""azns notification group.
16+
"""Azure action group.
1717
18-
:param action_group: Azure Group reference.
18+
:param action_group: Azure Action Group reference.
1919
:type action_group: list[str]
20-
:param email_subject: Custom subject for Azns email
21-
:type email_subject: str
22-
:param custom_webhook_payload: Custom webhook payload to be send to azns
20+
:param email_subject: Custom subject override for all email ids in Azure
2321
action group
22+
:type email_subject: str
23+
:param custom_webhook_payload: Custom payload to be sent for all webook
24+
URI in Azure action group
2425
:type custom_webhook_payload: str
2526
"""
2627

azure-mgmt-monitor/azure/mgmt/monitor/models/az_ns_action_group_py3.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313

1414

1515
class AzNsActionGroup(Model):
16-
"""azns notification group.
16+
"""Azure action group.
1717
18-
:param action_group: Azure Group reference.
18+
:param action_group: Azure Action Group reference.
1919
:type action_group: list[str]
20-
:param email_subject: Custom subject for Azns email
21-
:type email_subject: str
22-
:param custom_webhook_payload: Custom webhook payload to be send to azns
20+
:param email_subject: Custom subject override for all email ids in Azure
2321
action group
22+
:type email_subject: str
23+
:param custom_webhook_payload: Custom payload to be sent for all webook
24+
URI in Azure action group
2425
:type custom_webhook_payload: str
2526
"""
2627

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.serialization import Model
13+
14+
15+
class MetricAlertAction(Model):
16+
"""An alert action.
17+
18+
:param action_group_id: the id of the action group to use.
19+
:type action_group_id: str
20+
:param webhook_properties:
21+
:type webhook_properties: dict[str, str]
22+
"""
23+
24+
_attribute_map = {
25+
'action_group_id': {'key': 'actionGroupId', 'type': 'str'},
26+
'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'},
27+
}
28+
29+
def __init__(self, **kwargs):
30+
super(MetricAlertAction, self).__init__(**kwargs)
31+
self.action_group_id = kwargs.get('action_group_id', None)
32+
self.webhook_properties = kwargs.get('webhook_properties', None)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.serialization import Model
13+
14+
15+
class MetricAlertAction(Model):
16+
"""An alert action.
17+
18+
:param action_group_id: the id of the action group to use.
19+
:type action_group_id: str
20+
:param webhook_properties:
21+
:type webhook_properties: dict[str, str]
22+
"""
23+
24+
_attribute_map = {
25+
'action_group_id': {'key': 'actionGroupId', 'type': 'str'},
26+
'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'},
27+
}
28+
29+
def __init__(self, *, action_group_id: str=None, webhook_properties=None, **kwargs) -> None:
30+
super(MetricAlertAction, self).__init__(**kwargs)
31+
self.action_group_id = action_group_id
32+
self.webhook_properties = webhook_properties

azure-mgmt-monitor/azure/mgmt/monitor/models/metric_alert_resource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class MetricAlertResource(Resource):
5555
:type auto_mitigate: bool
5656
:param actions: the array of actions that are performed when the alert
5757
rule becomes active, and when an alert condition is resolved.
58-
:type actions: list[~azure.mgmt.monitor.models.Action]
58+
:type actions: list[~azure.mgmt.monitor.models.MetricAlertAction]
5959
:ivar last_updated_time: Last time the rule was updated in ISO8601 format.
6060
:vartype last_updated_time: datetime
6161
"""
@@ -88,7 +88,7 @@ class MetricAlertResource(Resource):
8888
'window_size': {'key': 'properties.windowSize', 'type': 'duration'},
8989
'criteria': {'key': 'properties.criteria', 'type': 'MetricAlertCriteria'},
9090
'auto_mitigate': {'key': 'properties.autoMitigate', 'type': 'bool'},
91-
'actions': {'key': 'properties.actions', 'type': '[Action]'},
91+
'actions': {'key': 'properties.actions', 'type': '[MetricAlertAction]'},
9292
'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'},
9393
}
9494

0 commit comments

Comments
 (0)