Class MetricAlertResourceInner
- java.lang.Object
-
- com.azure.core.management.ProxyResource
-
- com.azure.core.management.Resource
-
- com.azure.resourcemanager.monitor.fluent.models.MetricAlertResourceInner
-
public class MetricAlertResourceInner extends com.azure.core.management.ResourceThe metric alert resource.
-
-
Constructor Summary
Constructors Constructor Description MetricAlertResourceInner()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.BooleanautoMitigate()Get the autoMitigate property: the flag that indicates whether the alert should be auto resolved or not.MetricAlertCriteriacriteria()Get the criteria property: defines the specific alert criteria information.Stringdescription()Get the description property: the description of the metric alert that will be included in the alert email.booleanenabled()Get the enabled property: the flag that indicates whether the metric alert is enabled.DurationevaluationFrequency()Get the evaluationFrequency property: how often the metric alert is evaluated represented in ISO 8601 duration format.BooleanisMigrated()Get the isMigrated property: the value indicating whether this alert rule is migrated.OffsetDateTimelastUpdatedTime()Get the lastUpdatedTime property: Last time the rule was updated in ISO8601 format.List<String>scopes()Get the scopes property: the list of resource id's that this metric alert is scoped to.intseverity()Get the severity property: Alert severity {0, 1, 2, 3, 4}.StringtargetResourceRegion()Get the targetResourceRegion property: the region of the target resource(s) on which the alert is created/updated.StringtargetResourceType()Get the targetResourceType property: the resource type of the target resource(s) on which the alert is created/updated.voidvalidate()Validates the instance.DurationwindowSize()Get the windowSize property: the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold.MetricAlertResourceInnerwithActions(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.MetricAlertResourceInnerwithAutoMitigate(Boolean autoMitigate)Set the autoMitigate property: the flag that indicates whether the alert should be auto resolved or not.MetricAlertResourceInnerwithCriteria(MetricAlertCriteria criteria)Set the criteria property: defines the specific alert criteria information.MetricAlertResourceInnerwithDescription(String description)Set the description property: the description of the metric alert that will be included in the alert email.MetricAlertResourceInnerwithEnabled(boolean enabled)Set the enabled property: the flag that indicates whether the metric alert is enabled.MetricAlertResourceInnerwithEvaluationFrequency(Duration evaluationFrequency)Set the evaluationFrequency property: how often the metric alert is evaluated represented in ISO 8601 duration format.MetricAlertResourceInnerwithLocation(String location)MetricAlertResourceInnerwithScopes(List<String> scopes)Set the scopes property: the list of resource id's that this metric alert is scoped to.MetricAlertResourceInnerwithSeverity(int severity)Set the severity property: Alert severity {0, 1, 2, 3, 4}.MetricAlertResourceInnerwithTags(Map<String,String> tags)MetricAlertResourceInnerwithTargetResourceRegion(String targetResourceRegion)Set the targetResourceRegion property: the region of the target resource(s) on which the alert is created/updated.MetricAlertResourceInnerwithTargetResourceType(String targetResourceType)Set the targetResourceType property: the resource type of the target resource(s) on which the alert is created/updated.MetricAlertResourceInnerwithWindowSize(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.
-
-
-
Method Detail
-
description
public String description()
Get the description property: the description of the metric alert that will be included in the alert email.- Returns:
- the description value.
-
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:
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
public MetricAlertResourceInner withSeverity(int severity)
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
public MetricAlertResourceInner withEnabled(boolean enabled)
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
public List<String> scopes()
Get the scopes property: the list of resource id's that this metric alert is scoped to.- Returns:
- the scopes value.
-
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:
scopes- the scopes value to set.- Returns:
- the MetricAlertResourceInner object itself.
-
evaluationFrequency
public Duration evaluationFrequency()
Get the evaluationFrequency property: how often the metric alert is evaluated represented in ISO 8601 duration format.- Returns:
- the evaluationFrequency value.
-
withEvaluationFrequency
public MetricAlertResourceInner withEvaluationFrequency(Duration evaluationFrequency)
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
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:
- the windowSize value.
-
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:
windowSize- the windowSize value to set.- Returns:
- the MetricAlertResourceInner object itself.
-
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:
- the targetResourceType value.
-
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:
targetResourceType- the targetResourceType value to set.- Returns:
- the MetricAlertResourceInner object itself.
-
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:
- the targetResourceRegion value.
-
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:
targetResourceRegion- the targetResourceRegion value to set.- Returns:
- the MetricAlertResourceInner object itself.
-
criteria
public MetricAlertCriteria criteria()
Get the criteria property: defines the specific alert criteria information.- Returns:
- the criteria value.
-
withCriteria
public MetricAlertResourceInner withCriteria(MetricAlertCriteria criteria)
Set the criteria property: defines the specific alert criteria information.- Parameters:
criteria- the criteria value to set.- Returns:
- the MetricAlertResourceInner object itself.
-
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:
- the autoMitigate value.
-
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:
autoMitigate- the autoMitigate value to set.- Returns:
- the MetricAlertResourceInner object itself.
-
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:
- the actions value.
-
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:
actions- the actions value to set.- Returns:
- the MetricAlertResourceInner object itself.
-
lastUpdatedTime
public OffsetDateTime lastUpdatedTime()
Get the lastUpdatedTime property: Last time the rule was updated in ISO8601 format.- Returns:
- the lastUpdatedTime value.
-
isMigrated
public Boolean isMigrated()
Get the isMigrated property: the value indicating whether this alert rule is migrated.- Returns:
- the isMigrated value.
-
withLocation
public MetricAlertResourceInner withLocation(String location)
- Overrides:
withLocationin classcom.azure.core.management.Resource
-
withTags
public MetricAlertResourceInner withTags(Map<String,String> tags)
- Overrides:
withTagsin classcom.azure.core.management.Resource
-
validate
public void validate()
Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
-