MetricSettings Class
- java.
lang. Object - com.
azure. resourcemanager. monitor. models. MetricSettings
- com.
Implements
public final class MetricSettings
implements JsonSerializable<MetricSettings>
Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular metric.
Constructor Summary
| Constructor | Description |
|---|---|
| MetricSettings() |
Creates an instance of Metric |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| String |
category()
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
Metric |
fromJson(JsonReader jsonReader)
Reads an instance of Metric |
|
Retention |
retentionPolicy()
Get the retention |
| Duration |
timeGrain()
Get the time |
|
Json |
toJson(JsonWriter jsonWriter) |
| void |
validate()
Validates the instance. |
|
Metric |
withCategory(String category)
Set the category property: Name of a Diagnostic Metric category for a resource type this setting is applied to. |
|
Metric |
withEnabled(boolean enabled)
Set the enabled property: a value indicating whether this category is enabled. |
|
Metric |
withRetentionPolicy(RetentionPolicy retentionPolicy)
Set the retention |
|
Metric |
withTimeGrain(Duration timeGrain)
Set the time |
Methods inherited from java.lang.Object
Constructor Details
MetricSettings
public MetricSettings()
Creates an instance of MetricSettings class.
Method Details
category
public String 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:
enabled
public boolean enabled()
Get the enabled property: a value indicating whether this category is enabled.
Returns:
fromJson
public static MetricSettings fromJson(JsonReader jsonReader)
Reads an instance of MetricSettings from the JsonReader.
Parameters:
Returns:
Throws:
retentionPolicy
public RetentionPolicy retentionPolicy()
Get the retentionPolicy property: the retention policy for this category.
Returns:
timeGrain
public Duration timeGrain()
Get the timeGrain property: the timegrain of the metric in ISO8601 format.
Returns:
toJson
validate
public void validate()
Validates the instance.
withCategory
public MetricSettings withCategory(String category)
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:
Returns:
withEnabled
public MetricSettings withEnabled(boolean enabled)
Set the enabled property: a value indicating whether this category is enabled.
Parameters:
Returns:
withRetentionPolicy
public MetricSettings withRetentionPolicy(RetentionPolicy retentionPolicy)
Set the retentionPolicy property: the retention policy for this category.
Parameters:
Returns:
withTimeGrain
public MetricSettings withTimeGrain(Duration timeGrain)
Set the timeGrain property: the timegrain of the metric in ISO8601 format.
Parameters:
Returns: