Class Condition

java.lang.Object
com.azure.resourcemanager.monitor.models.Condition
All Implemented Interfaces:
com.azure.json.JsonSerializable<Condition>

public final class Condition extends Object implements com.azure.json.JsonSerializable<Condition>
A condition of the scheduled query rule.
  • Constructor Details

    • Condition

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

    • query

      public String query()
      Get the query property: Log query alert.
      Returns:
      the query value.
    • withQuery

      public Condition withQuery(String query)
      Set the query property: Log query alert.
      Parameters:
      query - the query value to set.
      Returns:
      the Condition object itself.
    • timeAggregation

      public TimeAggregation timeAggregation()
      Get the timeAggregation property: Aggregation type. Relevant and required only for rules of the kind LogAlert.
      Returns:
      the timeAggregation value.
    • withTimeAggregation

      public Condition withTimeAggregation(TimeAggregation timeAggregation)
      Set the timeAggregation property: Aggregation type. Relevant and required only for rules of the kind LogAlert.
      Parameters:
      timeAggregation - the timeAggregation value to set.
      Returns:
      the Condition object itself.
    • metricMeasureColumn

      public String metricMeasureColumn()
      Get the metricMeasureColumn property: The column containing the metric measure number. Relevant only for rules of the kind LogAlert.
      Returns:
      the metricMeasureColumn value.
    • withMetricMeasureColumn

      public Condition withMetricMeasureColumn(String metricMeasureColumn)
      Set the metricMeasureColumn property: The column containing the metric measure number. Relevant only for rules of the kind LogAlert.
      Parameters:
      metricMeasureColumn - the metricMeasureColumn value to set.
      Returns:
      the Condition object itself.
    • resourceIdColumn

      public String resourceIdColumn()
      Get the resourceIdColumn property: The column containing the resource id. The content of the column must be a uri formatted as resource id. Relevant only for rules of the kind LogAlert.
      Returns:
      the resourceIdColumn value.
    • withResourceIdColumn

      public Condition withResourceIdColumn(String resourceIdColumn)
      Set the resourceIdColumn property: The column containing the resource id. The content of the column must be a uri formatted as resource id. Relevant only for rules of the kind LogAlert.
      Parameters:
      resourceIdColumn - the resourceIdColumn value to set.
      Returns:
      the Condition object itself.
    • dimensions

      public List<Dimension> dimensions()
      Get the dimensions property: List of Dimensions conditions.
      Returns:
      the dimensions value.
    • withDimensions

      public Condition withDimensions(List<Dimension> dimensions)
      Set the dimensions property: List of Dimensions conditions.
      Parameters:
      dimensions - the dimensions value to set.
      Returns:
      the Condition object itself.
    • operator

      public ConditionOperator operator()
      Get the operator property: The criteria operator. Relevant and required only for rules of the kind LogAlert.
      Returns:
      the operator value.
    • withOperator

      public Condition withOperator(ConditionOperator operator)
      Set the operator property: The criteria operator. Relevant and required only for rules of the kind LogAlert.
      Parameters:
      operator - the operator value to set.
      Returns:
      the Condition object itself.
    • threshold

      public Double threshold()
      Get the threshold property: the criteria threshold value that activates the alert. Relevant and required only for rules of the kind LogAlert.
      Returns:
      the threshold value.
    • withThreshold

      public Condition withThreshold(Double threshold)
      Set the threshold property: the criteria threshold value that activates the alert. Relevant and required only for rules of the kind LogAlert.
      Parameters:
      threshold - the threshold value to set.
      Returns:
      the Condition object itself.
    • failingPeriods

      public ConditionFailingPeriods failingPeriods()
      Get the failingPeriods property: The minimum number of violations required within the selected lookback time window required to raise an alert. Relevant only for rules of the kind LogAlert.
      Returns:
      the failingPeriods value.
    • withFailingPeriods

      public Condition withFailingPeriods(ConditionFailingPeriods failingPeriods)
      Set the failingPeriods property: The minimum number of violations required within the selected lookback time window required to raise an alert. Relevant only for rules of the kind LogAlert.
      Parameters:
      failingPeriods - the failingPeriods value to set.
      Returns:
      the Condition object itself.
    • metricName

      public String metricName()
      Get the metricName property: The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric.
      Returns:
      the metricName value.
    • withMetricName

      public Condition withMetricName(String metricName)
      Set the metricName property: The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric.
      Parameters:
      metricName - the metricName value to set.
      Returns:
      the Condition object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<Condition>
      Throws:
      IOException
    • fromJson

      public static Condition fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of Condition from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of Condition if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IOException - If an error occurs while reading the Condition.