Class MetricSettings
java.lang.Object
com.azure.resourcemanager.monitor.models.MetricSettings
- All Implemented Interfaces:
com.azure.json.JsonSerializable<MetricSettings>
public final class MetricSettings
extends Object
implements com.azure.json.JsonSerializable<MetricSettings>
Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular metric.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncategory()
Get the category property: Name of a Diagnostic Metric category for a resource type this setting is applied to.boolean
enabled()
Get the enabled property: a value indicating whether this category is enabled.static MetricSettings
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of MetricSettings from the JsonReader.Get the retentionPolicy property: the retention policy for this category.Get the timeGrain property: the timegrain of the metric in ISO8601 format.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) void
validate()
Validates the instance.withCategory
(String category) Set the category property: Name of a Diagnostic Metric category for a resource type this setting is applied to.withEnabled
(boolean enabled) Set the enabled property: a value indicating whether this category is enabled.withRetentionPolicy
(RetentionPolicy retentionPolicy) Set the retentionPolicy property: the retention policy for this category.withTimeGrain
(Duration timeGrain) Set the timeGrain property: the timegrain of the metric in ISO8601 format.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
-
MetricSettings
public MetricSettings()Creates an instance of MetricSettings class.
-
-
Method Details
-
timeGrain
Get the timeGrain property: the timegrain of the metric in ISO8601 format.- Returns:
- the timeGrain value.
-
withTimeGrain
Set the timeGrain property: the timegrain of the metric in ISO8601 format.- Parameters:
timeGrain
- the timeGrain value to set.- Returns:
- the MetricSettings object itself.
-
category
Get the category property: Name of a Diagnostic Metric category for a resource type this setting is applied to. To obtain the list of Diagnostic metric categories for a resource, first perform a GET diagnostic settings operation.- Returns:
- the category value.
-
withCategory
Set the category property: Name of a Diagnostic Metric category for a resource type this setting is applied to. To obtain the list of Diagnostic metric categories for a resource, first perform a GET diagnostic settings operation.- Parameters:
category
- the category value to set.- Returns:
- the MetricSettings object itself.
-
enabled
public boolean enabled()Get the enabled property: a value indicating whether this category is enabled.- Returns:
- the enabled value.
-
withEnabled
Set the enabled property: a value indicating whether this category is enabled.- Parameters:
enabled
- the enabled value to set.- Returns:
- the MetricSettings object itself.
-
retentionPolicy
Get the retentionPolicy property: the retention policy for this category.- Returns:
- the retentionPolicy value.
-
withRetentionPolicy
Set the retentionPolicy property: the retention policy for this category.- Parameters:
retentionPolicy
- the retentionPolicy value to set.- Returns:
- the MetricSettings 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<MetricSettings>
- Throws:
IOException
-
fromJson
Reads an instance of MetricSettings from the JsonReader.- Parameters:
jsonReader
- The JsonReader being read.- Returns:
- An instance of MetricSettings if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException
- If the deserialized JSON object was missing any required properties.IOException
- If an error occurs while reading the MetricSettings.
-