Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
ad2975d
Generated from c9fbbd46eca53db6f1ebcf1b23fd224bcdee2b5e (#2760)
AutorestCI Jun 15, 2018
9903763
[AutoPR monitor/resource-manager] Add two missing "by subscription" o…
AutorestCI Jun 25, 2018
1802b26
Generated from 6110295138cbd6959df204de3830b4ada943a4fc (#2970)
AutorestCI Jul 20, 2018
2fa795e
Generated from 1ca7f22a22e15cb8980176f25be20fd3e6f73162 (#3084)
AutorestCI Aug 6, 2018
74b161f
[AutoPR monitor/resource-manager] Adding MetricNamespacesAPI for vers…
AutorestCI Sep 6, 2018
c34a3fd
Packaging update of azure-mgmt-monitor
azuresdkci Sep 6, 2018
d143388
[AutoPR monitor/resource-manager] Add missing enum for aggregation ty…
AutorestCI Sep 19, 2018
39e8a0d
Generated from a2ed141f095adf20aeb11d3bd796d5906fce4f6b (#3414)
AutorestCI Sep 27, 2018
4f5ccbf
Packaging update of azure-mgmt-monitor
azuresdkci Sep 27, 2018
5048d1e
[AutoPR monitor/resource-manager] Add Multi Resource Alert changes fo…
AutorestCI Oct 4, 2018
e16ac3b
[AutoPR monitor/resource-manager] add armRoleReceiver to ActionGroup …
AutorestCI Oct 22, 2018
8be506b
Generated from 5738fd21af734dc48d88f275b73a2c7fe3e504e4 (#3954)
AutorestCI Dec 3, 2018
a132cf5
Generated from 9771d96d4a2f4caa435cd59ae81736e910b8ee89 (#4139)
AutorestCI Jan 14, 2019
1585240
Merge branch 'master' into restapi_auto_monitor/resource-manager
iscai-msft Feb 27, 2019
356541b
Packaging update of azure-mgmt-monitor
azuresdkci Feb 27, 2019
c23440a
[AutoPR monitor/resource-manager] Updates to Scheduled Query Rule swa…
AutorestCI Feb 27, 2019
09d7159
Prepare 0.6.0
lmazuel Mar 6, 2019
ede0120
Packaging update of azure-mgmt-monitor
azuresdkci Mar 6, 2019
f49b05f
Merge branch 'master' into restapi_auto_monitor/resource-manager
lmazuel Mar 6, 2019
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
Prev Previous commit
Next Next commit
[AutoPR monitor/resource-manager] Add Multi Resource Alert changes fo…
…r Metric Alert API (#3445)

* Generated from 09c5415be341f2a6816dafb7a504818a3c536b7e

Multi Resource Alert changes

* Packaging update of azure-mgmt-monitor

* Generated from a88d7f44fc48e9ea0c1203b6bf10bac1b65111e4

Merge remote-tracking branch 'upstream/master'
  • Loading branch information
AutorestCI authored Oct 4, 2018
commit 5048d1ec853ddef16905ff7079fd395f7688c6e7
6 changes: 6 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,8 @@
from .metric_dimension_py3 import MetricDimension
from .metric_criteria_py3 import MetricCriteria
from .metric_alert_single_resource_multiple_metric_criteria_py3 import MetricAlertSingleResourceMultipleMetricCriteria
from .multi_metric_criteria_py3 import MultiMetricCriteria
from .metric_alert_multiple_resource_multiple_metric_criteria_py3 import MetricAlertMultipleResourceMultipleMetricCriteria
from .source_py3 import Source
from .schedule_py3 import Schedule
from .action_py3 import Action
Expand Down Expand Up @@ -199,6 +201,8 @@
from .metric_dimension import MetricDimension
from .metric_criteria import MetricCriteria
from .metric_alert_single_resource_multiple_metric_criteria import MetricAlertSingleResourceMultipleMetricCriteria
from .multi_metric_criteria import MultiMetricCriteria
from .metric_alert_multiple_resource_multiple_metric_criteria import MetricAlertMultipleResourceMultipleMetricCriteria
from .source import Source
from .schedule import Schedule
from .action import Action
Expand Down Expand Up @@ -337,6 +341,8 @@
'MetricDimension',
'MetricCriteria',
'MetricAlertSingleResourceMultipleMetricCriteria',
'MultiMetricCriteria',
'MetricAlertMultipleResourceMultipleMetricCriteria',
'Source',
'Schedule',
'Action',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class MetricAlertCriteria(Model):
"""The rule criteria that defines the conditions of the alert rule.

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

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

Expand All @@ -37,7 +38,7 @@ class MetricAlertCriteria(Model):
}

_subtype_map = {
'odatatype': {'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria': 'MetricAlertSingleResourceMultipleMetricCriteria'}
'odatatype': {'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria': 'MetricAlertSingleResourceMultipleMetricCriteria', 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria': 'MetricAlertMultipleResourceMultipleMetricCriteria'}
}

def __init__(self, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class MetricAlertCriteria(Model):
"""The rule criteria that defines the conditions of the alert rule.

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

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

Expand All @@ -37,7 +38,7 @@ class MetricAlertCriteria(Model):
}

_subtype_map = {
'odatatype': {'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria': 'MetricAlertSingleResourceMultipleMetricCriteria'}
'odatatype': {'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria': 'MetricAlertSingleResourceMultipleMetricCriteria', 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria': 'MetricAlertMultipleResourceMultipleMetricCriteria'}
}

def __init__(self, *, additional_properties=None, **kwargs) -> None:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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 .metric_alert_criteria import MetricAlertCriteria


class MetricAlertMultipleResourceMultipleMetricCriteria(MetricAlertCriteria):
"""Speficies the metric alert criteria for multiple resource that has multiple
metric criteria.

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

:param additional_properties: Unmatched properties from the message are
deserialized this collection
:type additional_properties: dict[str, object]
:param odatatype: Required. Constant filled by server.
:type odatatype: str
:param all_of: the list of multiple metric criteria for this 'all of'
operation.
:type all_of: list[~azure.mgmt.monitor.models.MultiMetricCriteria]
"""

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

_attribute_map = {
'additional_properties': {'key': '', 'type': '{object}'},
'odatatype': {'key': 'odata\\.type', 'type': 'str'},
'all_of': {'key': 'allOf', 'type': '[MultiMetricCriteria]'},
}

def __init__(self, **kwargs):
super(MetricAlertMultipleResourceMultipleMetricCriteria, self).__init__(**kwargs)
self.all_of = kwargs.get('all_of', None)
self.odatatype = 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria'
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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 .metric_alert_criteria_py3 import MetricAlertCriteria


class MetricAlertMultipleResourceMultipleMetricCriteria(MetricAlertCriteria):
"""Speficies the metric alert criteria for multiple resource that has multiple
metric criteria.

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

:param additional_properties: Unmatched properties from the message are
deserialized this collection
:type additional_properties: dict[str, object]
:param odatatype: Required. Constant filled by server.
:type odatatype: str
:param all_of: the list of multiple metric criteria for this 'all of'
operation.
:type all_of: list[~azure.mgmt.monitor.models.MultiMetricCriteria]
"""

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

_attribute_map = {
'additional_properties': {'key': '', 'type': '{object}'},
'odatatype': {'key': 'odata\\.type', 'type': 'str'},
'all_of': {'key': 'allOf', 'type': '[MultiMetricCriteria]'},
}

def __init__(self, *, additional_properties=None, all_of=None, **kwargs) -> None:
super(MetricAlertMultipleResourceMultipleMetricCriteria, self).__init__(additional_properties=additional_properties, **kwargs)
self.all_of = all_of
self.odatatype = 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria'
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ class MetricAlertResource(Resource):
:param window_size: Required. the period of time (in ISO 8601 duration
format) that is used to monitor alert activity based on the threshold.
:type window_size: timedelta
:param target_resource_type: the resource type of the target resource(s)
on which the alert is created/updated. Mandatory for
MultipleResourceMultipleMetricCriteria.
:type target_resource_type: str
:param target_resource_region: the region of the target resource(s) on
which the alert is created/updated. Mandatory for
MultipleResourceMultipleMetricCriteria.
:type target_resource_region: str
:param criteria: Required. defines the specific alert criteria
information.
:type criteria: ~azure.mgmt.monitor.models.MetricAlertCriteria
Expand Down Expand Up @@ -86,6 +94,8 @@ class MetricAlertResource(Resource):
'scopes': {'key': 'properties.scopes', 'type': '[str]'},
'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'},
'window_size': {'key': 'properties.windowSize', 'type': 'duration'},
'target_resource_type': {'key': 'properties.targetResourceType', 'type': 'str'},
'target_resource_region': {'key': 'properties.targetResourceRegion', 'type': 'str'},
'criteria': {'key': 'properties.criteria', 'type': 'MetricAlertCriteria'},
'auto_mitigate': {'key': 'properties.autoMitigate', 'type': 'bool'},
'actions': {'key': 'properties.actions', 'type': '[MetricAlertAction]'},
Expand All @@ -100,6 +110,8 @@ def __init__(self, **kwargs):
self.scopes = kwargs.get('scopes', None)
self.evaluation_frequency = kwargs.get('evaluation_frequency', None)
self.window_size = kwargs.get('window_size', None)
self.target_resource_type = kwargs.get('target_resource_type', None)
self.target_resource_region = kwargs.get('target_resource_region', None)
self.criteria = kwargs.get('criteria', None)
self.auto_mitigate = kwargs.get('auto_mitigate', None)
self.actions = kwargs.get('actions', None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ class MetricAlertResourcePatch(Model):
:param window_size: Required. the period of time (in ISO 8601 duration
format) that is used to monitor alert activity based on the threshold.
:type window_size: timedelta
:param target_resource_type: the resource type of the target resource(s)
on which the alert is created/updated. Mandatory for
MultipleResourceMultipleMetricCriteria.
:type target_resource_type: str
:param target_resource_region: the region of the target resource(s) on
which the alert is created/updated. Mandatory for
MultipleResourceMultipleMetricCriteria.
:type target_resource_region: str
:param criteria: Required. defines the specific alert criteria
information.
:type criteria: ~azure.mgmt.monitor.models.MetricAlertCriteria
Expand Down Expand Up @@ -70,6 +78,8 @@ class MetricAlertResourcePatch(Model):
'scopes': {'key': 'properties.scopes', 'type': '[str]'},
'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'},
'window_size': {'key': 'properties.windowSize', 'type': 'duration'},
'target_resource_type': {'key': 'properties.targetResourceType', 'type': 'str'},
'target_resource_region': {'key': 'properties.targetResourceRegion', 'type': 'str'},
'criteria': {'key': 'properties.criteria', 'type': 'MetricAlertCriteria'},
'auto_mitigate': {'key': 'properties.autoMitigate', 'type': 'bool'},
'actions': {'key': 'properties.actions', 'type': '[MetricAlertAction]'},
Expand All @@ -85,6 +95,8 @@ def __init__(self, **kwargs):
self.scopes = kwargs.get('scopes', None)
self.evaluation_frequency = kwargs.get('evaluation_frequency', None)
self.window_size = kwargs.get('window_size', None)
self.target_resource_type = kwargs.get('target_resource_type', None)
self.target_resource_region = kwargs.get('target_resource_region', None)
self.criteria = kwargs.get('criteria', None)
self.auto_mitigate = kwargs.get('auto_mitigate', None)
self.actions = kwargs.get('actions', None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ class MetricAlertResourcePatch(Model):
:param window_size: Required. the period of time (in ISO 8601 duration
format) that is used to monitor alert activity based on the threshold.
:type window_size: timedelta
:param target_resource_type: the resource type of the target resource(s)
on which the alert is created/updated. Mandatory for
MultipleResourceMultipleMetricCriteria.
:type target_resource_type: str
:param target_resource_region: the region of the target resource(s) on
which the alert is created/updated. Mandatory for
MultipleResourceMultipleMetricCriteria.
:type target_resource_region: str
:param criteria: Required. defines the specific alert criteria
information.
:type criteria: ~azure.mgmt.monitor.models.MetricAlertCriteria
Expand Down Expand Up @@ -70,13 +78,15 @@ class MetricAlertResourcePatch(Model):
'scopes': {'key': 'properties.scopes', 'type': '[str]'},
'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'},
'window_size': {'key': 'properties.windowSize', 'type': 'duration'},
'target_resource_type': {'key': 'properties.targetResourceType', 'type': 'str'},
'target_resource_region': {'key': 'properties.targetResourceRegion', 'type': 'str'},
'criteria': {'key': 'properties.criteria', 'type': 'MetricAlertCriteria'},
'auto_mitigate': {'key': 'properties.autoMitigate', 'type': 'bool'},
'actions': {'key': 'properties.actions', 'type': '[MetricAlertAction]'},
'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, auto_mitigate: bool=None, actions=None, **kwargs) -> None:
def __init__(self, *, description: str, severity: int, enabled: bool, evaluation_frequency, window_size, criteria, tags=None, scopes=None, target_resource_type: str=None, target_resource_region: str=None, auto_mitigate: bool=None, actions=None, **kwargs) -> None:
super(MetricAlertResourcePatch, self).__init__(**kwargs)
self.tags = tags
self.description = description
Expand All @@ -85,6 +95,8 @@ def __init__(self, *, description: str, severity: int, enabled: bool, evaluation
self.scopes = scopes
self.evaluation_frequency = evaluation_frequency
self.window_size = window_size
self.target_resource_type = target_resource_type
self.target_resource_region = target_resource_region
self.criteria = criteria
self.auto_mitigate = auto_mitigate
self.actions = actions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ class MetricAlertResource(Resource):
:param window_size: Required. the period of time (in ISO 8601 duration
format) that is used to monitor alert activity based on the threshold.
:type window_size: timedelta
:param target_resource_type: the resource type of the target resource(s)
on which the alert is created/updated. Mandatory for
MultipleResourceMultipleMetricCriteria.
:type target_resource_type: str
:param target_resource_region: the region of the target resource(s) on
which the alert is created/updated. Mandatory for
MultipleResourceMultipleMetricCriteria.
:type target_resource_region: str
:param criteria: Required. defines the specific alert criteria
information.
:type criteria: ~azure.mgmt.monitor.models.MetricAlertCriteria
Expand Down Expand Up @@ -86,20 +94,24 @@ class MetricAlertResource(Resource):
'scopes': {'key': 'properties.scopes', 'type': '[str]'},
'evaluation_frequency': {'key': 'properties.evaluationFrequency', 'type': 'duration'},
'window_size': {'key': 'properties.windowSize', 'type': 'duration'},
'target_resource_type': {'key': 'properties.targetResourceType', 'type': 'str'},
'target_resource_region': {'key': 'properties.targetResourceRegion', 'type': 'str'},
'criteria': {'key': 'properties.criteria', 'type': 'MetricAlertCriteria'},
'auto_mitigate': {'key': 'properties.autoMitigate', 'type': 'bool'},
'actions': {'key': 'properties.actions', 'type': '[MetricAlertAction]'},
'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, auto_mitigate: bool=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, target_resource_type: str=None, target_resource_region: str=None, auto_mitigate: bool=None, actions=None, **kwargs) -> None:
super(MetricAlertResource, self).__init__(location=location, tags=tags, **kwargs)
self.description = description
self.severity = severity
self.enabled = enabled
self.scopes = scopes
self.evaluation_frequency = evaluation_frequency
self.window_size = window_size
self.target_resource_type = target_resource_type
self.target_resource_region = target_resource_region
self.criteria = criteria
self.auto_mitigate = auto_mitigate
self.actions = actions
Expand Down
13 changes: 11 additions & 2 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/metric_criteria.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model
from .multi_metric_criteria import MultiMetricCriteria


class MetricCriteria(Model):
class MetricCriteria(MultiMetricCriteria):
"""Criterion to filter metrics.

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

:param additional_properties: Unmatched properties from the message are
deserialized this collection
:type additional_properties: dict[str, object]
:param criterion_type: Required. Constant filled by server.
:type criterion_type: str
:param name: Required. Name of the criteria.
:type name: str
:param metric_name: Required. Name of the metric.
Expand All @@ -35,6 +40,7 @@ class MetricCriteria(Model):
"""

_validation = {
'criterion_type': {'required': True},
'name': {'required': True},
'metric_name': {'required': True},
'operator': {'required': True},
Expand All @@ -43,6 +49,8 @@ class MetricCriteria(Model):
}

_attribute_map = {
'additional_properties': {'key': '', 'type': '{object}'},
'criterion_type': {'key': 'criterionType', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'metric_name': {'key': 'metricName', 'type': 'str'},
'metric_namespace': {'key': 'metricNamespace', 'type': 'str'},
Expand All @@ -61,3 +69,4 @@ def __init__(self, **kwargs):
self.time_aggregation = kwargs.get('time_aggregation', None)
self.threshold = kwargs.get('threshold', None)
self.dimensions = kwargs.get('dimensions', None)
self.criterion_type = 'StaticThresholdCriterion'
Loading