Class MetricCriteria
java.lang.Object
com.azure.resourcemanager.monitor.models.MultiMetricCriteria
com.azure.resourcemanager.monitor.models.MetricCriteria
- All Implemented Interfaces:
com.azure.json.JsonSerializable<MultiMetricCriteria>
Criterion to filter metrics.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the criterionType property: Specifies the type of threshold criteria.static MetricCriteriafromJson(com.azure.json.JsonReader jsonReader) Reads an instance of MetricCriteria from the JsonReader.operator()Get the operator property: the criteria operator.doubleGet the threshold property: the criteria threshold value that activates the alert.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.withDimensions(List<MetricDimension> dimensions) Set the dimensions property: List of dimension conditions.withMetricName(String metricName) Set the metricName property: Name of the metric.withMetricNamespace(String metricNamespace) Set the metricNamespace property: Namespace of the metric.Set the name property: Name of the criteria.withOperator(Operator operator) Set the operator property: the criteria operator.withSkipMetricValidation(Boolean skipMetricValidation) Set the skipMetricValidation property: Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.withThreshold(double threshold) Set the threshold property: the criteria threshold value that activates the alert.withTimeAggregation(AggregationTypeEnum timeAggregation) Set the timeAggregation property: the criteria time aggregation types.Methods inherited from class com.azure.resourcemanager.monitor.models.MultiMetricCriteria
additionalProperties, dimensions, metricName, metricNamespace, name, skipMetricValidation, timeAggregation, withAdditionalPropertiesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
MetricCriteria
public MetricCriteria()Creates an instance of MetricCriteria class.
-
-
Method Details
-
criterionType
Get the criterionType property: Specifies the type of threshold criteria.- Overrides:
criterionTypein classMultiMetricCriteria- Returns:
- the criterionType value.
-
operator
Get the operator property: the criteria operator.- Returns:
- the operator value.
-
withOperator
Set the operator property: the criteria operator.- Parameters:
operator- the operator value to set.- Returns:
- the MetricCriteria object itself.
-
threshold
public double threshold()Get the threshold property: the criteria threshold value that activates the alert.- Returns:
- the threshold value.
-
withThreshold
Set the threshold property: the criteria threshold value that activates the alert.- Parameters:
threshold- the threshold value to set.- Returns:
- the MetricCriteria object itself.
-
withName
Set the name property: Name of the criteria.- Overrides:
withNamein classMultiMetricCriteria- Parameters:
name- the name value to set.- Returns:
- the MultiMetricCriteria object itself.
-
withMetricName
Set the metricName property: Name of the metric.- Overrides:
withMetricNamein classMultiMetricCriteria- Parameters:
metricName- the metricName value to set.- Returns:
- the MultiMetricCriteria object itself.
-
withMetricNamespace
Set the metricNamespace property: Namespace of the metric.- Overrides:
withMetricNamespacein classMultiMetricCriteria- Parameters:
metricNamespace- the metricNamespace value to set.- Returns:
- the MultiMetricCriteria object itself.
-
withTimeAggregation
Set the timeAggregation property: the criteria time aggregation types.- Overrides:
withTimeAggregationin classMultiMetricCriteria- Parameters:
timeAggregation- the timeAggregation value to set.- Returns:
- the MultiMetricCriteria object itself.
-
withDimensions
Set the dimensions property: List of dimension conditions.- Overrides:
withDimensionsin classMultiMetricCriteria- Parameters:
dimensions- the dimensions value to set.- Returns:
- the MultiMetricCriteria object itself.
-
withSkipMetricValidation
Set the skipMetricValidation property: Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped.- Overrides:
withSkipMetricValidationin classMultiMetricCriteria- Parameters:
skipMetricValidation- the skipMetricValidation value to set.- Returns:
- the MultiMetricCriteria object itself.
-
validate
public void validate()Validates the instance.- Overrides:
validatein classMultiMetricCriteria- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<MultiMetricCriteria>- Overrides:
toJsonin classMultiMetricCriteria- Throws:
IOException
-
fromJson
Reads an instance of MetricCriteria from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of MetricCriteria if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException- If the deserialized JSON object was missing any required properties.IOException- If an error occurs while reading the MetricCriteria.
-