Class RuleCondition

java.lang.Object
com.azure.resourcemanager.monitor.models.RuleCondition
All Implemented Interfaces:
com.azure.json.JsonSerializable<RuleCondition>
Direct Known Subclasses:
LocationThresholdRuleCondition, ManagementEventRuleCondition, ThresholdRuleCondition

public class RuleCondition extends Object implements com.azure.json.JsonSerializable<RuleCondition>
The condition that results in the alert rule being activated.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of RuleCondition class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the dataSource property: the resource from which the rule collects its data.
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of RuleCondition from the JsonReader.
    Get the odataType property: specifies the type of condition.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    void
    Validates the instance.
    Set the dataSource property: the resource from which the rule collects its data.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Constructor Details

    • RuleCondition

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

    • odataType

      public String odataType()
      Get the odataType property: specifies the type of condition. This can be one of three types: ManagementEventRuleCondition (occurrences of management events), LocationThresholdRuleCondition (based on the number of failures of a web test), and ThresholdRuleCondition (based on the threshold of a metric).
      Returns:
      the odataType value.
    • dataSource

      public RuleDataSource dataSource()
      Get the dataSource property: the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource.
      Returns:
      the dataSource value.
    • withDataSource

      public RuleCondition withDataSource(RuleDataSource dataSource)
      Set the dataSource property: the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource.
      Parameters:
      dataSource - the dataSource value to set.
      Returns:
      the RuleCondition 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<RuleCondition>
      Throws:
      IOException
    • fromJson

      public static RuleCondition fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of RuleCondition from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of RuleCondition 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 RuleCondition.