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
The condition that results in the alert rule being activated.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the dataSource property: the resource from which the rule collects its data.static RuleCondition
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
validate()
Validates the instance.withDataSource
(RuleDataSource dataSource) 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
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
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
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
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<RuleCondition>
- Throws:
IOException
-
fromJson
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.
-