Class RuleDataSource
java.lang.Object
com.azure.resourcemanager.monitor.models.RuleDataSource
- All Implemented Interfaces:
com.azure.json.JsonSerializable<RuleDataSource>
- Direct Known Subclasses:
RuleManagementEventDataSource
,RuleMetricDataSource
public class RuleDataSource
extends Object
implements com.azure.json.JsonSerializable<RuleDataSource>
The resource from which the rule collects its data.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RuleDataSource
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of RuleDataSource from the JsonReader.Get the legacyResourceId property: the legacy resource identifier of the resource the rule monitors.Get the metricNamespace property: the namespace of the metric.Get the odataType property: specifies the type of data source.Get the resourceLocation property: the location of the resource.Get the resourceUri property: the resource identifier of the resource the rule monitors.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) void
validate()
Validates the instance.withLegacyResourceId
(String legacyResourceId) Set the legacyResourceId property: the legacy resource identifier of the resource the rule monitors.withMetricNamespace
(String metricNamespace) Set the metricNamespace property: the namespace of the metric.withResourceLocation
(String resourceLocation) Set the resourceLocation property: the location of the resource.withResourceUri
(String resourceUri) Set the resourceUri property: the resource identifier of the resource the rule monitors.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
-
RuleDataSource
public RuleDataSource()Creates an instance of RuleDataSource class.
-
-
Method Details
-
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.
-
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.
-
withResourceUri
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.
-
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.
-
withLegacyResourceId
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.
-
resourceLocation
Get the resourceLocation property: the location of the resource.- Returns:
- the resourceLocation value.
-
withResourceLocation
Set the resourceLocation property: the location of the resource.- Parameters:
resourceLocation
- the resourceLocation value to set.- Returns:
- the RuleDataSource object itself.
-
metricNamespace
Get the metricNamespace property: the namespace of the metric.- Returns:
- the metricNamespace value.
-
withMetricNamespace
Set the metricNamespace property: the namespace of the metric.- Parameters:
metricNamespace
- the metricNamespace value to set.- Returns:
- the RuleDataSource 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<RuleDataSource>
- Throws:
IOException
-
fromJson
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.
-