RuleCondition Class

  • java.lang.Object
    • com.azure.resourcemanager.monitor.models.RuleCondition

Implements

public class RuleCondition
implements JsonSerializable<RuleCondition>

The condition that results in the alert rule being activated.

Constructor Summary

Constructor Description
RuleCondition()

Creates an instance of RuleCondition class.

Method Summary

Modifier and Type Method and Description
RuleDataSource dataSource()

Get the dataSource property: the resource from which the rule collects its data.

static RuleCondition fromJson(JsonReader jsonReader)

Reads an instance of RuleCondition from the JsonReader.

String odataType()

Get the odataType property: specifies the type of condition.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

RuleCondition withDataSource(RuleDataSource dataSource)

Set the dataSource property: the resource from which the rule collects its data.

Methods inherited from java.lang.Object

Constructor Details

RuleCondition

public RuleCondition()

Creates an instance of RuleCondition class.

Method Details

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.

fromJson

public static RuleCondition fromJson(JsonReader jsonReader)

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.

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.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

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.

Applies to