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>
A rule condition based on a certain number of locations failing.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of LocationThresholdRuleCondition class. -
Method Summary
Modifier and TypeMethodDescriptionintGet the failedLocationCount property: the number of locations that must fail to activate the alert.fromJson(com.azure.json.JsonReader jsonReader) Reads an instance of LocationThresholdRuleCondition from the JsonReader.Get the odataType property: specifies the type of condition.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.Get the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold.withDataSource(RuleDataSource dataSource) Set the dataSource property: the resource from which the rule collects its data.withFailedLocationCount(int failedLocationCount) Set the failedLocationCount property: the number of locations that must fail to activate the alert.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.Methods inherited from class RuleCondition
dataSourceMethods inherited from class 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
-
LocationThresholdRuleCondition
public LocationThresholdRuleCondition()Creates an instance of LocationThresholdRuleCondition class.
-
-
Method Details
-
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:
odataTypein classRuleCondition- Returns:
- the odataType value.
-
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
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
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
Set the dataSource property: the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource.- Overrides:
withDataSourcein classRuleCondition- Parameters:
dataSource- the dataSource value to set.- Returns:
- the RuleCondition object itself.
-
validate
public void validate()Validates the instance.- Overrides:
validatein classRuleCondition- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<RuleCondition>- Overrides:
toJsonin classRuleCondition- 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.
-