Condition Class

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

Implements

public final class Condition
implements JsonSerializable<Condition>

A condition of the scheduled query rule.

Constructor Summary

Constructor Description
Condition()

Creates an instance of Condition class.

Method Summary

Modifier and Type Method and Description
List<Dimension> dimensions()

Get the dimensions property: List of Dimensions conditions.

ConditionFailingPeriods failingPeriods()

Get the failingPeriods property: The minimum number of violations required within the selected lookback time window required to raise an alert.

static Condition fromJson(JsonReader jsonReader)

Reads an instance of Condition from the JsonReader.

String metricMeasureColumn()

Get the metricMeasureColumn property: The column containing the metric measure number.

String metricName()

Get the metricName property: The name of the metric to be sent.

ConditionOperator operator()

Get the operator property: The criteria operator.

String query()

Get the query property: Log query alert.

String resourceIdColumn()

Get the resourceIdColumn property: The column containing the resource id.

Double threshold()

Get the threshold property: the criteria threshold value that activates the alert.

TimeAggregation timeAggregation()

Get the timeAggregation property: Aggregation type.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

Condition withDimensions(List<Dimension> dimensions)

Set the dimensions property: List of Dimensions conditions.

Condition withFailingPeriods(ConditionFailingPeriods failingPeriods)

Set the failingPeriods property: The minimum number of violations required within the selected lookback time window required to raise an alert.

Condition withMetricMeasureColumn(String metricMeasureColumn)

Set the metricMeasureColumn property: The column containing the metric measure number.

Condition withMetricName(String metricName)

Set the metricName property: The name of the metric to be sent.

Condition withOperator(ConditionOperator operator)

Set the operator property: The criteria operator.

Condition withQuery(String query)

Set the query property: Log query alert.

Condition withResourceIdColumn(String resourceIdColumn)

Set the resourceIdColumn property: The column containing the resource id.

Condition withThreshold(Double threshold)

Set the threshold property: the criteria threshold value that activates the alert.

Condition withTimeAggregation(TimeAggregation timeAggregation)

Set the timeAggregation property: Aggregation type.

Methods inherited from java.lang.Object

Constructor Details

Condition

public Condition()

Creates an instance of Condition class.

Method Details

dimensions

public List dimensions()

Get the dimensions property: List of Dimensions conditions.

Returns:

the dimensions value.

failingPeriods

public ConditionFailingPeriods failingPeriods()

Get the failingPeriods property: The minimum number of violations required within the selected lookback time window required to raise an alert. Relevant only for rules of the kind LogAlert.

Returns:

the failingPeriods value.

fromJson

public static Condition fromJson(JsonReader jsonReader)

Reads an instance of Condition from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of Condition 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 Condition.

metricMeasureColumn

public String metricMeasureColumn()

Get the metricMeasureColumn property: The column containing the metric measure number. Relevant only for rules of the kind LogAlert.

Returns:

the metricMeasureColumn value.

metricName

public String metricName()

Get the metricName property: The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric.

Returns:

the metricName value.

operator

public ConditionOperator operator()

Get the operator property: The criteria operator. Relevant and required only for rules of the kind LogAlert.

Returns:

the operator value.

query

public String query()

Get the query property: Log query alert.

Returns:

the query value.

resourceIdColumn

public String resourceIdColumn()

Get the resourceIdColumn property: The column containing the resource id. The content of the column must be a uri formatted as resource id. Relevant only for rules of the kind LogAlert.

Returns:

the resourceIdColumn value.

threshold

public Double threshold()

Get the threshold property: the criteria threshold value that activates the alert. Relevant and required only for rules of the kind LogAlert.

Returns:

the threshold value.

timeAggregation

public TimeAggregation timeAggregation()

Get the timeAggregation property: Aggregation type. Relevant and required only for rules of the kind LogAlert.

Returns:

the timeAggregation value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withDimensions

public Condition withDimensions(List dimensions)

Set the dimensions property: List of Dimensions conditions.

Parameters:

dimensions - the dimensions value to set.

Returns:

the Condition object itself.

withFailingPeriods

public Condition withFailingPeriods(ConditionFailingPeriods failingPeriods)

Set the failingPeriods property: The minimum number of violations required within the selected lookback time window required to raise an alert. Relevant only for rules of the kind LogAlert.

Parameters:

failingPeriods - the failingPeriods value to set.

Returns:

the Condition object itself.

withMetricMeasureColumn

public Condition withMetricMeasureColumn(String metricMeasureColumn)

Set the metricMeasureColumn property: The column containing the metric measure number. Relevant only for rules of the kind LogAlert.

Parameters:

metricMeasureColumn - the metricMeasureColumn value to set.

Returns:

the Condition object itself.

withMetricName

public Condition withMetricName(String metricName)

Set the metricName property: The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric.

Parameters:

metricName - the metricName value to set.

Returns:

the Condition object itself.

withOperator

public Condition withOperator(ConditionOperator operator)

Set the operator property: The criteria operator. Relevant and required only for rules of the kind LogAlert.

Parameters:

operator - the operator value to set.

Returns:

the Condition object itself.

withQuery

public Condition withQuery(String query)

Set the query property: Log query alert.

Parameters:

query - the query value to set.

Returns:

the Condition object itself.

withResourceIdColumn

public Condition withResourceIdColumn(String resourceIdColumn)

Set the resourceIdColumn property: The column containing the resource id. The content of the column must be a uri formatted as resource id. Relevant only for rules of the kind LogAlert.

Parameters:

resourceIdColumn - the resourceIdColumn value to set.

Returns:

the Condition object itself.

withThreshold

public Condition withThreshold(Double threshold)

Set the threshold property: the criteria threshold value that activates the alert. Relevant and required only for rules of the kind LogAlert.

Parameters:

threshold - the threshold value to set.

Returns:

the Condition object itself.

withTimeAggregation

public Condition withTimeAggregation(TimeAggregation timeAggregation)

Set the timeAggregation property: Aggregation type. Relevant and required only for rules of the kind LogAlert.

Parameters:

timeAggregation - the timeAggregation value to set.

Returns:

the Condition object itself.

Applies to