MetricAlertResourceInner Class
- java.
lang. Object - com.
azure. core. management. ProxyResource - com.
azure. core. management. Resource - com.
azure. resourcemanager. monitor. fluent. models. MetricAlertResourceInner
- com.
- com.
- com.
public final class MetricAlertResourceInner
extends Resource
The metric alert resource.
Constructor Summary
Constructor | Description |
---|---|
MetricAlertResourceInner() |
Creates an instance of Metric |
Method Summary
Modifier and Type | Method and Description |
---|---|
List<Metric |
actions()
Get the actions property: the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. |
Boolean |
autoMitigate()
Get the auto |
Metric |
criteria()
Get the criteria property: defines the specific alert criteria information. |
String |
description()
Get the description property: the description of the metric alert that will be included in the alert email. |
boolean |
enabled()
Get the enabled property: the flag that indicates whether the metric alert is enabled. |
Duration |
evaluationFrequency()
Get the evaluation |
static
Metric |
fromJson(JsonReader jsonReader)
Reads an instance of Metric |
String |
id()
Get the id property: Fully qualified resource Id for the resource. |
Boolean |
isMigrated()
Get the is |
Offset |
lastUpdatedTime()
Get the last |
String |
name()
Get the name property: The name of the resource. |
List<String> |
scopes()
Get the scopes property: the list of resource id's that this metric alert is scoped to. |
int |
severity()
Get the severity property: Alert severity {0, 1, 2, 3, 4}. |
String |
targetResourceRegion()
Get the target |
String |
targetResourceType()
Get the target |
Json |
toJson(JsonWriter jsonWriter) |
String |
type()
Get the type property: The type of the resource. |
void |
validate()
Validates the instance. |
Duration |
windowSize()
Get the window |
Metric |
withActions(List<MetricAlertAction> actions)
Set the actions property: the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. |
Metric |
withAutoMitigate(Boolean autoMitigate)
Set the auto |
Metric |
withCriteria(MetricAlertCriteria criteria)
Set the criteria property: defines the specific alert criteria information. |
Metric |
withDescription(String description)
Set the description property: the description of the metric alert that will be included in the alert email. |
Metric |
withEnabled(boolean enabled)
Set the enabled property: the flag that indicates whether the metric alert is enabled. |
Metric |
withEvaluationFrequency(Duration evaluationFrequency)
Set the evaluation |
Metric |
withLocation(String location) |
Metric |
withScopes(List<String> scopes)
Set the scopes property: the list of resource id's that this metric alert is scoped to. |
Metric |
withSeverity(int severity)
Set the severity property: Alert severity {0, 1, 2, 3, 4}. |
Metric |
withTags(Map<String,String> tags) |
Metric |
withTargetResourceRegion(String targetResourceRegion)
Set the target |
Metric |
withTargetResourceType(String targetResourceType)
Set the target |
Metric |
withWindowSize(Duration windowSize)
Set the window |
Methods inherited from ProxyResource
Methods inherited from Resource
Methods inherited from java.lang.Object
Constructor Details
MetricAlertResourceInner
public MetricAlertResourceInner()
Creates an instance of MetricAlertResourceInner class.
Method Details
actions
public List<MetricAlertAction> actions()
Get the actions property: the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
Returns:
autoMitigate
public Boolean autoMitigate()
Get the autoMitigate property: the flag that indicates whether the alert should be auto resolved or not. The default is true.
Returns:
criteria
public MetricAlertCriteria criteria()
Get the criteria property: defines the specific alert criteria information.
Returns:
description
public String description()
Get the description property: the description of the metric alert that will be included in the alert email.
Returns:
enabled
public boolean enabled()
Get the enabled property: the flag that indicates whether the metric alert is enabled.
Returns:
evaluationFrequency
public Duration evaluationFrequency()
Get the evaluationFrequency property: how often the metric alert is evaluated represented in ISO 8601 duration format.
Returns:
fromJson
public static MetricAlertResourceInner fromJson(JsonReader jsonReader)
Reads an instance of MetricAlertResourceInner from the JsonReader.
Parameters:
Returns:
Throws:
id
public String id()
Get the id property: Fully qualified resource Id for the resource.
Overrides:
MetricAlertResourceInner.id()Returns:
isMigrated
public Boolean isMigrated()
Get the isMigrated property: the value indicating whether this alert rule is migrated.
Returns:
lastUpdatedTime
public OffsetDateTime lastUpdatedTime()
Get the lastUpdatedTime property: Last time the rule was updated in ISO8601 format.
Returns:
name
public String name()
Get the name property: The name of the resource.
Overrides:
MetricAlertResourceInner.name()Returns:
scopes
public List<String> scopes()
Get the scopes property: the list of resource id's that this metric alert is scoped to.
Returns:
severity
public int severity()
Get the severity property: Alert severity {0, 1, 2, 3, 4}.
Returns:
targetResourceRegion
public String targetResourceRegion()
Get the targetResourceRegion property: the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
Returns:
targetResourceType
public String targetResourceType()
Get the targetResourceType property: the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
Returns:
toJson
public JsonWriter toJson(JsonWriter jsonWriter)
Overrides:
MetricAlertResourceInner.toJson(JsonWriter jsonWriter)Parameters:
Throws:
type
public String type()
Get the type property: The type of the resource.
Overrides:
MetricAlertResourceInner.type()Returns:
validate
public void validate()
Validates the instance.
windowSize
public Duration windowSize()
Get the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold.
Returns:
withActions
public MetricAlertResourceInner withActions(List<MetricAlertAction> actions)
Set the actions property: the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
Parameters:
Returns:
withAutoMitigate
public MetricAlertResourceInner withAutoMitigate(Boolean autoMitigate)
Set the autoMitigate property: the flag that indicates whether the alert should be auto resolved or not. The default is true.
Parameters:
Returns:
withCriteria
public MetricAlertResourceInner withCriteria(MetricAlertCriteria criteria)
Set the criteria property: defines the specific alert criteria information.
Parameters:
Returns:
withDescription
public MetricAlertResourceInner withDescription(String description)
Set the description property: the description of the metric alert that will be included in the alert email.
Parameters:
Returns:
withEnabled
public MetricAlertResourceInner withEnabled(boolean enabled)
Set the enabled property: the flag that indicates whether the metric alert is enabled.
Parameters:
Returns:
withEvaluationFrequency
public MetricAlertResourceInner withEvaluationFrequency(Duration evaluationFrequency)
Set the evaluationFrequency property: how often the metric alert is evaluated represented in ISO 8601 duration format.
Parameters:
Returns:
withLocation
public MetricAlertResourceInner withLocation(String location)
Overrides:
MetricAlertResourceInner.withLocation(String location)Parameters:
withScopes
public MetricAlertResourceInner withScopes(List<String> scopes)
Set the scopes property: the list of resource id's that this metric alert is scoped to.
Parameters:
Returns:
withSeverity
public MetricAlertResourceInner withSeverity(int severity)
Set the severity property: Alert severity {0, 1, 2, 3, 4}.
Parameters:
Returns:
withTags
public MetricAlertResourceInner withTags(Map<String,String> tags)
Overrides:
MetricAlertResourceInner.withTags(Map<String,String> tags)Parameters:
withTargetResourceRegion
public MetricAlertResourceInner withTargetResourceRegion(String targetResourceRegion)
Set the targetResourceRegion property: the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
Parameters:
Returns:
withTargetResourceType
public MetricAlertResourceInner withTargetResourceType(String targetResourceType)
Set the targetResourceType property: the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource.
Parameters:
Returns:
withWindowSize
public MetricAlertResourceInner withWindowSize(Duration windowSize)
Set the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold.
Parameters:
Returns: