1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
# 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 MetricCriteria(Model):
"""MetricCriteria.
All required parameters must be populated in order to send to Azure.
:param name: Required. Name of the criteria.
:type name: str
:param metric_name: Required. Name of the metric.
:type metric_name: str
:param metric_namespace: Namespace of the metric.
:type metric_namespace: str
:param operator: Required. the criteria operator.
:type operator: object
:param time_aggregation: Required. the criteria time aggregation types.
:type time_aggregation: object
:param threshold: Required. the criteria threshold value that activates
the alert.
:type threshold: float
:param dimensions: List of dimension conditions.
:type dimensions: list[~azure.mgmt.monitor.models.MetricDimension]
"""
_validation = {
'name': {'required': True},
'metric_name': {'required': True},
'operator': {'required': True},
'time_aggregation': {'required': True},
'threshold': {'required': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'metric_name': {'key': 'metricName', 'type': 'str'},
'metric_namespace': {'key': 'metricNamespace', 'type': 'str'},
'operator': {'key': 'operator', 'type': 'object'},
'time_aggregation': {'key': 'timeAggregation', 'type': 'object'},
'threshold': {'key': 'threshold', 'type': 'float'},
'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'},
}
def __init__(self, **kwargs):
super(MetricCriteria, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.metric_name = kwargs.get('metric_name', None)
self.metric_namespace = kwargs.get('metric_namespace', None)
self.operator = kwargs.get('operator', None)
self.time_aggregation = kwargs.get('time_aggregation', None)
self.threshold = kwargs.get('threshold', None)
self.dimensions = kwargs.get('dimensions', None)
|