Class RuleMetricDataSource
java.lang.Object
com.azure.resourcemanager.monitor.models.RuleDataSource
com.azure.resourcemanager.monitor.models.RuleMetricDataSource
- All Implemented Interfaces:
com.azure.json.JsonSerializable<RuleDataSource>
A rule metric data source. The discriminator value is always RuleMetricDataSource in this case.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RuleMetricDataSource
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of RuleMetricDataSource from the JsonReader.Get the metricName property: the name of the metric that defines what the rule monitors.Get the odataType property: specifies the type of data source.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.withMetricName
(String metricName) Set the metricName property: the name of the metric that defines what 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 com.azure.resourcemanager.monitor.models.RuleDataSource
legacyResourceId, metricNamespace, resourceLocation, resourceUri
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
-
RuleMetricDataSource
public RuleMetricDataSource()Creates an instance of RuleMetricDataSource 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.- Overrides:
odataType
in classRuleDataSource
- Returns:
- the odataType value.
-
metricName
Get the metricName property: the name of the metric that defines what the rule monitors.- Returns:
- the metricName value.
-
withMetricName
Set the metricName property: the name of the metric that defines what the rule monitors.- Parameters:
metricName
- the metricName value to set.- Returns:
- the RuleMetricDataSource object itself.
-
withResourceUri
Set the resourceUri property: the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule.- Overrides:
withResourceUri
in classRuleDataSource
- Parameters:
resourceUri
- the resourceUri value to set.- Returns:
- the RuleDataSource object itself.
-
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.- Overrides:
withLegacyResourceId
in classRuleDataSource
- Parameters:
legacyResourceId
- the legacyResourceId value to set.- Returns:
- the RuleDataSource object itself.
-
withResourceLocation
Set the resourceLocation property: the location of the resource.- Overrides:
withResourceLocation
in classRuleDataSource
- Parameters:
resourceLocation
- the resourceLocation value to set.- Returns:
- the RuleDataSource object itself.
-
withMetricNamespace
Set the metricNamespace property: the namespace of the metric.- Overrides:
withMetricNamespace
in classRuleDataSource
- Parameters:
metricNamespace
- the metricNamespace value to set.- Returns:
- the RuleDataSource object itself.
-
validate
public void validate()Validates the instance.- Overrides:
validate
in classRuleDataSource
- Throws:
IllegalArgumentException
- thrown if the instance is not valid.
-
toJson
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<RuleDataSource>
- Overrides:
toJson
in classRuleDataSource
- Throws:
IOException
-
fromJson
public static RuleMetricDataSource fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of RuleMetricDataSource from the JsonReader.- Parameters:
jsonReader
- The JsonReader being read.- Returns:
- An instance of RuleMetricDataSource 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 RuleMetricDataSource.
-