Class MetricCriteria

java.lang.Object
com.azure.resourcemanager.monitor.models.MultiMetricCriteria
com.azure.resourcemanager.monitor.models.MetricCriteria

public final class MetricCriteria extends MultiMetricCriteria
Criterion to filter metrics.
  • Constructor Details

    • MetricCriteria

      public MetricCriteria()
      Creates an instance of MetricCriteria class.
  • Method Details

    • operator

      public Operator operator()
      Get the operator property: the criteria operator.
      Returns:
      the operator value.
    • withOperator

      public MetricCriteria withOperator(Operator operator)
      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

      public MetricCriteria withThreshold(double threshold)
      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

      public MetricCriteria withName(String name)
      Set the name property: Name of the criteria.
      Overrides:
      withName in class MultiMetricCriteria
      Parameters:
      name - the name value to set.
      Returns:
      the MultiMetricCriteria object itself.
    • withMetricName

      public MetricCriteria withMetricName(String metricName)
      Set the metricName property: Name of the metric.
      Overrides:
      withMetricName in class MultiMetricCriteria
      Parameters:
      metricName - the metricName value to set.
      Returns:
      the MultiMetricCriteria object itself.
    • withMetricNamespace

      public MetricCriteria withMetricNamespace(String metricNamespace)
      Set the metricNamespace property: Namespace of the metric.
      Overrides:
      withMetricNamespace in class MultiMetricCriteria
      Parameters:
      metricNamespace - the metricNamespace value to set.
      Returns:
      the MultiMetricCriteria object itself.
    • withTimeAggregation

      public MetricCriteria withTimeAggregation(AggregationTypeEnum timeAggregation)
      Set the timeAggregation property: the criteria time aggregation types.
      Overrides:
      withTimeAggregation in class MultiMetricCriteria
      Parameters:
      timeAggregation - the timeAggregation value to set.
      Returns:
      the MultiMetricCriteria object itself.
    • withDimensions

      public MetricCriteria withDimensions(List<MetricDimension> dimensions)
      Set the dimensions property: List of dimension conditions.
      Overrides:
      withDimensions in class MultiMetricCriteria
      Parameters:
      dimensions - the dimensions value to set.
      Returns:
      the MultiMetricCriteria object itself.
    • withSkipMetricValidation

      public MetricCriteria 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.
      Overrides:
      withSkipMetricValidation in class MultiMetricCriteria
      Parameters:
      skipMetricValidation - the skipMetricValidation value to set.
      Returns:
      the MultiMetricCriteria object itself.
    • validate

      public void validate()
      Validates the instance.
      Overrides:
      validate in class MultiMetricCriteria
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.