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