Class ManagementEventRuleCondition
java.lang.Object
com.azure.resourcemanager.monitor.models.RuleCondition
com.azure.resourcemanager.monitor.models.ManagementEventRuleCondition
- All Implemented Interfaces:
com.azure.json.JsonSerializable<RuleCondition>
A management event rule condition.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of ManagementEventRuleCondition class. -
Method Summary
Modifier and TypeMethodDescriptionGet the aggregation property: How the data that is collected should be combined over time and when the alert is activated.static ManagementEventRuleCondition
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of ManagementEventRuleCondition 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.withAggregation
(ManagementEventAggregationCondition aggregation) Set the aggregation property: How the data that is collected should be combined over time and when the alert is activated.withDataSource
(RuleDataSource dataSource) Set the dataSource property: the resource from which the rule collects its data.Methods inherited from class com.azure.resourcemanager.monitor.models.RuleCondition
dataSource
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
-
ManagementEventRuleCondition
public ManagementEventRuleCondition()Creates an instance of ManagementEventRuleCondition 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:
odataType
in classRuleCondition
- Returns:
- the odataType value.
-
aggregation
Get the aggregation property: How the data that is collected should be combined over time and when the alert is activated. Note that for management event alerts aggregation is optional – if it is not provided then any event will cause the alert to activate.- Returns:
- the aggregation value.
-
withAggregation
public ManagementEventRuleCondition withAggregation(ManagementEventAggregationCondition aggregation) Set the aggregation property: How the data that is collected should be combined over time and when the alert is activated. Note that for management event alerts aggregation is optional – if it is not provided then any event will cause the alert to activate.- Parameters:
aggregation
- the aggregation value to set.- Returns:
- the ManagementEventRuleCondition 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:
withDataSource
in classRuleCondition
- Parameters:
dataSource
- the dataSource value to set.- Returns:
- the RuleCondition object itself.
-
validate
public void validate()Validates the instance.- Overrides:
validate
in classRuleCondition
- Throws:
IllegalArgumentException
- thrown if the instance is not valid.
-
toJson
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<RuleCondition>
- Overrides:
toJson
in classRuleCondition
- Throws:
IOException
-
fromJson
public static ManagementEventRuleCondition fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of ManagementEventRuleCondition from the JsonReader.- Parameters:
jsonReader
- The JsonReader being read.- Returns:
- An instance of ManagementEventRuleCondition 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 ManagementEventRuleCondition.
-