RuleDataSource Class

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

Implements

public class RuleDataSource
implements JsonSerializable<RuleDataSource>

The resource from which the rule collects its data.

Constructor Summary

Constructor Description
RuleDataSource()

Creates an instance of RuleDataSource class.

Method Summary

Modifier and Type Method and Description
static RuleDataSource fromJson(JsonReader jsonReader)

Reads an instance of RuleDataSource from the JsonReader.

String legacyResourceId()

Get the legacyResourceId property: the legacy resource identifier of the resource the rule monitors.

String metricNamespace()

Get the metricNamespace property: the namespace of the metric.

String odataType()

Get the odataType property: specifies the type of data source.

String resourceLocation()

Get the resourceLocation property: the location of the resource.

String resourceUri()

Get the resourceUri property: the resource identifier of the resource the rule monitors.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

RuleDataSource withLegacyResourceId(String legacyResourceId)

Set the legacyResourceId property: the legacy resource identifier of the resource the rule monitors.

RuleDataSource withMetricNamespace(String metricNamespace)

Set the metricNamespace property: the namespace of the metric.

RuleDataSource withResourceLocation(String resourceLocation)

Set the resourceLocation property: the location of the resource.

RuleDataSource withResourceUri(String resourceUri)

Set the resourceUri property: the resource identifier of the resource the rule monitors.

Methods inherited from java.lang.Object

Constructor Details

RuleDataSource

public RuleDataSource()

Creates an instance of RuleDataSource class.

Method Details

fromJson

public static RuleDataSource fromJson(JsonReader jsonReader)

Reads an instance of RuleDataSource from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

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

legacyResourceId

public String legacyResourceId()

Get the legacyResourceId property: the legacy resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule.

Returns:

the legacyResourceId value.

metricNamespace

public String metricNamespace()

Get the metricNamespace property: the namespace of the metric.

Returns:

the metricNamespace value.

odataType

public String odataType()

Get the odataType property: specifies the type of data source. There are two types of rule data sources: RuleMetricDataSource and RuleManagementEventDataSource.

Returns:

the odataType value.

resourceLocation

public String resourceLocation()

Get the resourceLocation property: the location of the resource.

Returns:

the resourceLocation value.

resourceUri

public String resourceUri()

Get the resourceUri property: the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule.

Returns:

the resourceUri value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withLegacyResourceId

public RuleDataSource withLegacyResourceId(String legacyResourceId)

Set the legacyResourceId property: the legacy resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule.

Parameters:

legacyResourceId - the legacyResourceId value to set.

Returns:

the RuleDataSource object itself.

withMetricNamespace

public RuleDataSource withMetricNamespace(String metricNamespace)

Set the metricNamespace property: the namespace of the metric.

Parameters:

metricNamespace - the metricNamespace value to set.

Returns:

the RuleDataSource object itself.

withResourceLocation

public RuleDataSource withResourceLocation(String resourceLocation)

Set the resourceLocation property: the location of the resource.

Parameters:

resourceLocation - the resourceLocation value to set.

Returns:

the RuleDataSource object itself.

withResourceUri

public RuleDataSource withResourceUri(String resourceUri)

Set the resourceUri property: the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule.

Parameters:

resourceUri - the resourceUri value to set.

Returns:

the RuleDataSource object itself.

Applies to