Skip to content

Commit

Permalink
Generated from 1393ad625a235d57103ab8ad9e3a7cd37b3e53ec
Browse files Browse the repository at this point in the history
removed readonly properties from patch
  • Loading branch information
SDK Automation committed Sep 9, 2020
1 parent 0009740 commit 6b2f444
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,10 @@ class MultiMetricCriteria(Model):
:param dimensions: List of dimension conditions.
:type dimensions:
list[~azure.mgmt.monitor.v2018_03_01.models.MetricDimension]
:param skip_metric_validation: Allows creating an alert rule on a custom
metric that isn't yet emitted, by causing the metric validation to be
skipped.
:type skip_metric_validation: bool
:param criterion_type: Required. Constant filled by server.
:type criterion_type: str
"""
Expand All @@ -350,6 +354,7 @@ class MultiMetricCriteria(Model):
'metric_namespace': {'key': 'metricNamespace', 'type': 'str'},
'time_aggregation': {'key': 'timeAggregation', 'type': 'object'},
'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'},
'skip_metric_validation': {'key': 'skipMetricValidation', 'type': 'bool'},
'criterion_type': {'key': 'criterionType', 'type': 'str'},
}

Expand All @@ -365,6 +370,7 @@ def __init__(self, **kwargs):
self.metric_namespace = kwargs.get('metric_namespace', None)
self.time_aggregation = kwargs.get('time_aggregation', None)
self.dimensions = kwargs.get('dimensions', None)
self.skip_metric_validation = kwargs.get('skip_metric_validation', None)
self.criterion_type = None


Expand All @@ -387,6 +393,10 @@ class DynamicMetricCriteria(MultiMetricCriteria):
:param dimensions: List of dimension conditions.
:type dimensions:
list[~azure.mgmt.monitor.v2018_03_01.models.MetricDimension]
:param skip_metric_validation: Allows creating an alert rule on a custom
metric that isn't yet emitted, by causing the metric validation to be
skipped.
:type skip_metric_validation: bool
:param criterion_type: Required. Constant filled by server.
:type criterion_type: str
:param operator: Required. The operator used to compare the metric value
Expand Down Expand Up @@ -427,6 +437,7 @@ class DynamicMetricCriteria(MultiMetricCriteria):
'metric_namespace': {'key': 'metricNamespace', 'type': 'str'},
'time_aggregation': {'key': 'timeAggregation', 'type': 'object'},
'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'},
'skip_metric_validation': {'key': 'skipMetricValidation', 'type': 'bool'},
'criterion_type': {'key': 'criterionType', 'type': 'str'},
'operator': {'key': 'operator', 'type': 'str'},
'alert_sensitivity': {'key': 'alertSensitivity', 'type': 'str'},
Expand Down Expand Up @@ -851,37 +862,26 @@ class MetricAlertResourcePatch(Model):
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:param tags: Resource tags
:type tags: dict[str, str]
:param description: Required. the description of the metric alert that
will be included in the alert email.
:param description: the description of the metric alert that will be
included in the alert email.
:type description: str
:param severity: Required. Alert severity {0, 1, 2, 3, 4}
:param severity: Alert severity {0, 1, 2, 3, 4}
:type severity: int
:param enabled: Required. the flag that indicates whether the metric alert
is enabled.
:param enabled: the flag that indicates whether the metric alert is
enabled.
:type enabled: bool
:param scopes: the list of resource id's that this metric alert is scoped
to.
:type scopes: list[str]
:param evaluation_frequency: Required. how often the metric alert is
evaluated represented in ISO 8601 duration format.
:param evaluation_frequency: how often the metric alert is evaluated
represented in ISO 8601 duration format.
:type evaluation_frequency: timedelta
:param window_size: Required. the period of time (in ISO 8601 duration
format) that is used to monitor alert activity based on the threshold.
:param window_size: 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.
:param criteria: defines the specific alert criteria information.
:type criteria: ~azure.mgmt.monitor.v2018_03_01.models.MetricAlertCriteria
:param auto_mitigate: the flag that indicates whether the alert should be
auto resolved or not. The default is true.
Expand All @@ -895,12 +895,6 @@ class MetricAlertResourcePatch(Model):
"""

_validation = {
'description': {'required': True},
'severity': {'required': True},
'enabled': {'required': True},
'evaluation_frequency': {'required': True},
'window_size': {'required': True},
'criteria': {'required': True},
'last_updated_time': {'readonly': True},
}

Expand All @@ -912,8 +906,6 @@ 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 @@ -929,8 +921,6 @@ 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 Expand Up @@ -1057,6 +1047,10 @@ class MetricCriteria(MultiMetricCriteria):
:param dimensions: List of dimension conditions.
:type dimensions:
list[~azure.mgmt.monitor.v2018_03_01.models.MetricDimension]
:param skip_metric_validation: Allows creating an alert rule on a custom
metric that isn't yet emitted, by causing the metric validation to be
skipped.
:type skip_metric_validation: bool
:param criterion_type: Required. Constant filled by server.
:type criterion_type: str
:param operator: Required. the criteria operator. Possible values include:
Expand Down Expand Up @@ -1084,6 +1078,7 @@ class MetricCriteria(MultiMetricCriteria):
'metric_namespace': {'key': 'metricNamespace', 'type': 'str'},
'time_aggregation': {'key': 'timeAggregation', 'type': 'object'},
'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'},
'skip_metric_validation': {'key': 'skipMetricValidation', 'type': 'bool'},
'criterion_type': {'key': 'criterionType', 'type': 'str'},
'operator': {'key': 'operator', 'type': 'str'},
'threshold': {'key': 'threshold', 'type': 'float'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,10 @@ class MultiMetricCriteria(Model):
:param dimensions: List of dimension conditions.
:type dimensions:
list[~azure.mgmt.monitor.v2018_03_01.models.MetricDimension]
:param skip_metric_validation: Allows creating an alert rule on a custom
metric that isn't yet emitted, by causing the metric validation to be
skipped.
:type skip_metric_validation: bool
:param criterion_type: Required. Constant filled by server.
:type criterion_type: str
"""
Expand All @@ -350,21 +354,23 @@ class MultiMetricCriteria(Model):
'metric_namespace': {'key': 'metricNamespace', 'type': 'str'},
'time_aggregation': {'key': 'timeAggregation', 'type': 'object'},
'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'},
'skip_metric_validation': {'key': 'skipMetricValidation', 'type': 'bool'},
'criterion_type': {'key': 'criterionType', 'type': 'str'},
}

_subtype_map = {
'criterion_type': {'StaticThresholdCriterion': 'MetricCriteria', 'DynamicThresholdCriterion': 'DynamicMetricCriteria'}
}

def __init__(self, *, name: str, metric_name: str, time_aggregation, additional_properties=None, metric_namespace: str=None, dimensions=None, **kwargs) -> None:
def __init__(self, *, name: str, metric_name: str, time_aggregation, additional_properties=None, metric_namespace: str=None, dimensions=None, skip_metric_validation: bool=None, **kwargs) -> None:
super(MultiMetricCriteria, self).__init__(**kwargs)
self.additional_properties = additional_properties
self.name = name
self.metric_name = metric_name
self.metric_namespace = metric_namespace
self.time_aggregation = time_aggregation
self.dimensions = dimensions
self.skip_metric_validation = skip_metric_validation
self.criterion_type = None


Expand All @@ -387,6 +393,10 @@ class DynamicMetricCriteria(MultiMetricCriteria):
:param dimensions: List of dimension conditions.
:type dimensions:
list[~azure.mgmt.monitor.v2018_03_01.models.MetricDimension]
:param skip_metric_validation: Allows creating an alert rule on a custom
metric that isn't yet emitted, by causing the metric validation to be
skipped.
:type skip_metric_validation: bool
:param criterion_type: Required. Constant filled by server.
:type criterion_type: str
:param operator: Required. The operator used to compare the metric value
Expand Down Expand Up @@ -427,15 +437,16 @@ class DynamicMetricCriteria(MultiMetricCriteria):
'metric_namespace': {'key': 'metricNamespace', 'type': 'str'},
'time_aggregation': {'key': 'timeAggregation', 'type': 'object'},
'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'},
'skip_metric_validation': {'key': 'skipMetricValidation', 'type': 'bool'},
'criterion_type': {'key': 'criterionType', 'type': 'str'},
'operator': {'key': 'operator', 'type': 'str'},
'alert_sensitivity': {'key': 'alertSensitivity', 'type': 'str'},
'failing_periods': {'key': 'failingPeriods', 'type': 'DynamicThresholdFailingPeriods'},
'ignore_data_before': {'key': 'ignoreDataBefore', 'type': 'iso-8601'},
}

def __init__(self, *, name: str, metric_name: str, time_aggregation, operator, alert_sensitivity, failing_periods, additional_properties=None, metric_namespace: str=None, dimensions=None, ignore_data_before=None, **kwargs) -> None:
super(DynamicMetricCriteria, self).__init__(additional_properties=additional_properties, name=name, metric_name=metric_name, metric_namespace=metric_namespace, time_aggregation=time_aggregation, dimensions=dimensions, **kwargs)
def __init__(self, *, name: str, metric_name: str, time_aggregation, operator, alert_sensitivity, failing_periods, additional_properties=None, metric_namespace: str=None, dimensions=None, skip_metric_validation: bool=None, ignore_data_before=None, **kwargs) -> None:
super(DynamicMetricCriteria, self).__init__(additional_properties=additional_properties, name=name, metric_name=metric_name, metric_namespace=metric_namespace, time_aggregation=time_aggregation, dimensions=dimensions, skip_metric_validation=skip_metric_validation, **kwargs)
self.operator = operator
self.alert_sensitivity = alert_sensitivity
self.failing_periods = failing_periods
Expand Down Expand Up @@ -851,37 +862,26 @@ class MetricAlertResourcePatch(Model):
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:param tags: Resource tags
:type tags: dict[str, str]
:param description: Required. the description of the metric alert that
will be included in the alert email.
:param description: the description of the metric alert that will be
included in the alert email.
:type description: str
:param severity: Required. Alert severity {0, 1, 2, 3, 4}
:param severity: Alert severity {0, 1, 2, 3, 4}
:type severity: int
:param enabled: Required. the flag that indicates whether the metric alert
is enabled.
:param enabled: the flag that indicates whether the metric alert is
enabled.
:type enabled: bool
:param scopes: the list of resource id's that this metric alert is scoped
to.
:type scopes: list[str]
:param evaluation_frequency: Required. how often the metric alert is
evaluated represented in ISO 8601 duration format.
:param evaluation_frequency: how often the metric alert is evaluated
represented in ISO 8601 duration format.
:type evaluation_frequency: timedelta
:param window_size: Required. the period of time (in ISO 8601 duration
format) that is used to monitor alert activity based on the threshold.
:param window_size: 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.
:param criteria: defines the specific alert criteria information.
:type criteria: ~azure.mgmt.monitor.v2018_03_01.models.MetricAlertCriteria
:param auto_mitigate: the flag that indicates whether the alert should be
auto resolved or not. The default is true.
Expand All @@ -895,12 +895,6 @@ class MetricAlertResourcePatch(Model):
"""

_validation = {
'description': {'required': True},
'severity': {'required': True},
'enabled': {'required': True},
'evaluation_frequency': {'required': True},
'window_size': {'required': True},
'criteria': {'required': True},
'last_updated_time': {'readonly': True},
}

Expand All @@ -912,15 +906,13 @@ 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, target_resource_type: str=None, target_resource_region: str=None, auto_mitigate: bool=None, actions=None, **kwargs) -> None:
def __init__(self, *, tags=None, description: str=None, severity: int=None, enabled: bool=None, scopes=None, evaluation_frequency=None, window_size=None, criteria=None, auto_mitigate: bool=None, actions=None, **kwargs) -> None:
super(MetricAlertResourcePatch, self).__init__(**kwargs)
self.tags = tags
self.description = description
Expand All @@ -929,8 +921,6 @@ 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 Expand Up @@ -1057,6 +1047,10 @@ class MetricCriteria(MultiMetricCriteria):
:param dimensions: List of dimension conditions.
:type dimensions:
list[~azure.mgmt.monitor.v2018_03_01.models.MetricDimension]
:param skip_metric_validation: Allows creating an alert rule on a custom
metric that isn't yet emitted, by causing the metric validation to be
skipped.
:type skip_metric_validation: bool
:param criterion_type: Required. Constant filled by server.
:type criterion_type: str
:param operator: Required. the criteria operator. Possible values include:
Expand Down Expand Up @@ -1084,13 +1078,14 @@ class MetricCriteria(MultiMetricCriteria):
'metric_namespace': {'key': 'metricNamespace', 'type': 'str'},
'time_aggregation': {'key': 'timeAggregation', 'type': 'object'},
'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'},
'skip_metric_validation': {'key': 'skipMetricValidation', 'type': 'bool'},
'criterion_type': {'key': 'criterionType', 'type': 'str'},
'operator': {'key': 'operator', 'type': 'str'},
'threshold': {'key': 'threshold', 'type': 'float'},
}

def __init__(self, *, name: str, metric_name: str, time_aggregation, operator, threshold: float, additional_properties=None, metric_namespace: str=None, dimensions=None, **kwargs) -> None:
super(MetricCriteria, self).__init__(additional_properties=additional_properties, name=name, metric_name=metric_name, metric_namespace=metric_namespace, time_aggregation=time_aggregation, dimensions=dimensions, **kwargs)
def __init__(self, *, name: str, metric_name: str, time_aggregation, operator, threshold: float, additional_properties=None, metric_namespace: str=None, dimensions=None, skip_metric_validation: bool=None, **kwargs) -> None:
super(MetricCriteria, self).__init__(additional_properties=additional_properties, name=name, metric_name=metric_name, metric_namespace=metric_namespace, time_aggregation=time_aggregation, dimensions=dimensions, skip_metric_validation=skip_metric_validation, **kwargs)
self.operator = operator
self.threshold = threshold
self.criterion_type = 'StaticThresholdCriterion'
Expand Down

0 comments on commit 6b2f444

Please sign in to comment.