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 RuleMetricDataSourcefromJson(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.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()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 RuleDataSource
legacyResourceId, metricNamespace, resourceLocation, resourceUriMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
odataTypein 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:
withResourceUriin 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:
withLegacyResourceIdin classRuleDataSource- Parameters:
legacyResourceId- the legacyResourceId value to set.- Returns:
- the RuleDataSource object itself.
-
withResourceLocation
Set the resourceLocation property: the location of the resource.- Overrides:
withResourceLocationin classRuleDataSource- Parameters:
resourceLocation- the resourceLocation value to set.- Returns:
- the RuleDataSource object itself.
-
withMetricNamespace
Set the metricNamespace property: the namespace of the metric.- Overrides:
withMetricNamespacein classRuleDataSource- Parameters:
metricNamespace- the metricNamespace value to set.- Returns:
- the RuleDataSource object itself.
-
validate
public void validate()Validates the instance.- Overrides:
validatein classRuleDataSource- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<RuleDataSource>- Overrides:
toJsonin 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.
-