다음을 통해 공유


MetricSettings Class

  • java.lang.Object
    • com.azure.resourcemanager.monitor.models.MetricSettings

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 MetricSettings class.

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 MetricSettings fromJson(JsonReader jsonReader)

Reads an instance of MetricSettings from the JsonReader.

RetentionPolicy retentionPolicy()

Get the retentionPolicy property: the retention policy for this category.

Duration timeGrain()

Get the timeGrain property: the timegrain of the metric in ISO8601 format.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

MetricSettings withCategory(String category)

Set the category property: Name of a Diagnostic Metric category for a resource type this setting is applied to.

MetricSettings withEnabled(boolean enabled)

Set the enabled property: a value indicating whether this category is enabled.

MetricSettings withRetentionPolicy(RetentionPolicy retentionPolicy)

Set the retentionPolicy property: the retention policy for this category.

MetricSettings withTimeGrain(Duration timeGrain)

Set the timeGrain property: the timegrain of the metric in ISO8601 format.

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:

the category value.

enabled

public boolean enabled()

Get the enabled property: a value indicating whether this category is enabled.

Returns:

the enabled value.

fromJson

public static MetricSettings fromJson(JsonReader jsonReader)

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:

IOException

- If the deserialized JSON object was missing any required properties.

retentionPolicy

public RetentionPolicy retentionPolicy()

Get the retentionPolicy property: the retention policy for this category.

Returns:

the retentionPolicy value.

timeGrain

public Duration timeGrain()

Get the timeGrain property: the timegrain of the metric in ISO8601 format.

Returns:

the timeGrain value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

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:

category - the category value to set.

Returns:

the MetricSettings object itself.

withEnabled

public MetricSettings withEnabled(boolean enabled)

Set the enabled property: a value indicating whether this category is enabled.

Parameters:

enabled - the enabled value to set.

Returns:

the MetricSettings object itself.

withRetentionPolicy

public MetricSettings withRetentionPolicy(RetentionPolicy retentionPolicy)

Set the retentionPolicy property: the retention policy for this category.

Parameters:

retentionPolicy - the retentionPolicy value to set.

Returns:

the MetricSettings object itself.

withTimeGrain

public MetricSettings withTimeGrain(Duration timeGrain)

Set the timeGrain property: the timegrain of the metric in ISO8601 format.

Parameters:

timeGrain - the timeGrain value to set.

Returns:

the MetricSettings object itself.

Applies to