Class LocationThresholdRuleCondition

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

public final class LocationThresholdRuleCondition extends RuleCondition
A rule condition based on a certain number of locations failing.
  • Constructor Details

    • LocationThresholdRuleCondition

      public LocationThresholdRuleCondition()
      Creates an instance of LocationThresholdRuleCondition 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).
      Overrides:
      odataType in class RuleCondition
      Returns:
      the odataType value.
    • windowSize

      public Duration windowSize()
      Get the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified then it must be between 5 minutes and 1 day.
      Returns:
      the windowSize value.
    • withWindowSize

      public LocationThresholdRuleCondition withWindowSize(Duration windowSize)
      Set the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified then it must be between 5 minutes and 1 day.
      Parameters:
      windowSize - the windowSize value to set.
      Returns:
      the LocationThresholdRuleCondition object itself.
    • failedLocationCount

      public int failedLocationCount()
      Get the failedLocationCount property: the number of locations that must fail to activate the alert.
      Returns:
      the failedLocationCount value.
    • withFailedLocationCount

      public LocationThresholdRuleCondition withFailedLocationCount(int failedLocationCount)
      Set the failedLocationCount property: the number of locations that must fail to activate the alert.
      Parameters:
      failedLocationCount - the failedLocationCount value to set.
      Returns:
      the LocationThresholdRuleCondition object itself.
    • withDataSource

      public LocationThresholdRuleCondition 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.
      Overrides:
      withDataSource in class RuleCondition
      Parameters:
      dataSource - the dataSource value to set.
      Returns:
      the RuleCondition object itself.
    • validate

      public void validate()
      Validates the instance.
      Overrides:
      validate in class RuleCondition
      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>
      Overrides:
      toJson in class RuleCondition
      Throws:
      IOException
    • fromJson

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