Interface MetricAlarm.Builder
- All Superinterfaces:
Buildable
,CopyableBuilder<MetricAlarm.Builder,
,MetricAlarm> SdkBuilder<MetricAlarm.Builder,
,MetricAlarm> SdkPojo
- Enclosing class:
MetricAlarm
-
Method Summary
Modifier and TypeMethodDescriptionactionsEnabled
(Boolean actionsEnabled) Indicates whether actions should be executed during any changes to the alarm state.alarmActions
(String... alarmActions) The actions to execute when this alarm transitions to theALARM
state from any other state.alarmActions
(Collection<String> alarmActions) The actions to execute when this alarm transitions to theALARM
state from any other state.The Amazon Resource Name (ARN) of the alarm.alarmConfigurationUpdatedTimestamp
(Instant alarmConfigurationUpdatedTimestamp) The time stamp of the last update to the alarm configuration.alarmDescription
(String alarmDescription) The description of the alarm.The name of the alarm.comparisonOperator
(String comparisonOperator) The arithmetic operation to use when comparing the specified statistic and threshold.comparisonOperator
(ComparisonOperator comparisonOperator) The arithmetic operation to use when comparing the specified statistic and threshold.datapointsToAlarm
(Integer datapointsToAlarm) The number of data points that must be breaching to trigger the alarm.dimensions
(Collection<Dimension> dimensions) The dimensions for the metric associated with the alarm.dimensions
(Consumer<Dimension.Builder>... dimensions) The dimensions for the metric associated with the alarm.dimensions
(Dimension... dimensions) The dimensions for the metric associated with the alarm.evaluateLowSampleCountPercentile
(String evaluateLowSampleCountPercentile) Used only for alarms based on percentiles.evaluationPeriods
(Integer evaluationPeriods) The number of periods over which data is compared to the specified threshold.evaluationState
(String evaluationState) If the value of this field isPARTIAL_DATA
, the alarm is being evaluated based on only partial data.evaluationState
(EvaluationState evaluationState) If the value of this field isPARTIAL_DATA
, the alarm is being evaluated based on only partial data.extendedStatistic
(String extendedStatistic) The percentile statistic for the metric associated with the alarm.insufficientDataActions
(String... insufficientDataActions) The actions to execute when this alarm transitions to theINSUFFICIENT_DATA
state from any other state.insufficientDataActions
(Collection<String> insufficientDataActions) The actions to execute when this alarm transitions to theINSUFFICIENT_DATA
state from any other state.metricName
(String metricName) The name of the metric associated with the alarm, if this is an alarm based on a single metric.metrics
(Collection<MetricDataQuery> metrics) An array of MetricDataQuery structures, used in an alarm based on a metric math expression.metrics
(Consumer<MetricDataQuery.Builder>... metrics) An array of MetricDataQuery structures, used in an alarm based on a metric math expression.metrics
(MetricDataQuery... metrics) An array of MetricDataQuery structures, used in an alarm based on a metric math expression.The namespace of the metric associated with the alarm.The actions to execute when this alarm transitions to theOK
state from any other state.okActions
(Collection<String> okActions) The actions to execute when this alarm transitions to theOK
state from any other state.The period, in seconds, over which the statistic is applied.stateReason
(String stateReason) An explanation for the alarm state, in text format.stateReasonData
(String stateReasonData) An explanation for the alarm state, in JSON format.stateTransitionedTimestamp
(Instant stateTransitionedTimestamp) The date and time that the alarm'sStateValue
most recently changed.stateUpdatedTimestamp
(Instant stateUpdatedTimestamp) The time stamp of the last update to the value of either theStateValue
orEvaluationState
parameters.stateValue
(String stateValue) The state value for the alarm.stateValue
(StateValue stateValue) The state value for the alarm.The statistic for the metric associated with the alarm, other than percentile.The statistic for the metric associated with the alarm, other than percentile.The value to compare with the specified statistic.thresholdMetricId
(String thresholdMetricId) In an alarm based on an anomaly detection model, this is the ID of theANOMALY_DETECTION_BAND
function used as the threshold for the alarm.treatMissingData
(String treatMissingData) Sets how this alarm is to handle missing data points.The unit of the metric associated with the alarm.unit
(StandardUnit unit) The unit of the metric associated with the alarm.Methods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copy
Methods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation, build
Methods inherited from interface software.amazon.awssdk.core.SdkPojo
equalsBySdkFields, sdkFieldNameToField, sdkFields
-
Method Details
-
alarmName
The name of the alarm.
- Parameters:
alarmName
- The name of the alarm.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
alarmArn
The Amazon Resource Name (ARN) of the alarm.
- Parameters:
alarmArn
- The Amazon Resource Name (ARN) of the alarm.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
alarmDescription
The description of the alarm.
- Parameters:
alarmDescription
- The description of the alarm.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
alarmConfigurationUpdatedTimestamp
The time stamp of the last update to the alarm configuration.
- Parameters:
alarmConfigurationUpdatedTimestamp
- The time stamp of the last update to the alarm configuration.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
actionsEnabled
Indicates whether actions should be executed during any changes to the alarm state.
- Parameters:
actionsEnabled
- Indicates whether actions should be executed during any changes to the alarm state.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
okActions
The actions to execute when this alarm transitions to the
OK
state from any other state. Each action is specified as an Amazon Resource Name (ARN).- Parameters:
okActions
- The actions to execute when this alarm transitions to theOK
state from any other state. Each action is specified as an Amazon Resource Name (ARN).- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
okActions
The actions to execute when this alarm transitions to the
OK
state from any other state. Each action is specified as an Amazon Resource Name (ARN).- Parameters:
okActions
- The actions to execute when this alarm transitions to theOK
state from any other state. Each action is specified as an Amazon Resource Name (ARN).- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
alarmActions
The actions to execute when this alarm transitions to the
ALARM
state from any other state. Each action is specified as an Amazon Resource Name (ARN).- Parameters:
alarmActions
- The actions to execute when this alarm transitions to theALARM
state from any other state. Each action is specified as an Amazon Resource Name (ARN).- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
alarmActions
The actions to execute when this alarm transitions to the
ALARM
state from any other state. Each action is specified as an Amazon Resource Name (ARN).- Parameters:
alarmActions
- The actions to execute when this alarm transitions to theALARM
state from any other state. Each action is specified as an Amazon Resource Name (ARN).- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
insufficientDataActions
The actions to execute when this alarm transitions to the
INSUFFICIENT_DATA
state from any other state. Each action is specified as an Amazon Resource Name (ARN).- Parameters:
insufficientDataActions
- The actions to execute when this alarm transitions to theINSUFFICIENT_DATA
state from any other state. Each action is specified as an Amazon Resource Name (ARN).- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
insufficientDataActions
The actions to execute when this alarm transitions to the
INSUFFICIENT_DATA
state from any other state. Each action is specified as an Amazon Resource Name (ARN).- Parameters:
insufficientDataActions
- The actions to execute when this alarm transitions to theINSUFFICIENT_DATA
state from any other state. Each action is specified as an Amazon Resource Name (ARN).- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
stateValue
The state value for the alarm.
- Parameters:
stateValue
- The state value for the alarm.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
stateValue
The state value for the alarm.
- Parameters:
stateValue
- The state value for the alarm.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
stateReason
An explanation for the alarm state, in text format.
- Parameters:
stateReason
- An explanation for the alarm state, in text format.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
stateReasonData
An explanation for the alarm state, in JSON format.
- Parameters:
stateReasonData
- An explanation for the alarm state, in JSON format.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
stateUpdatedTimestamp
The time stamp of the last update to the value of either the
StateValue
orEvaluationState
parameters.- Parameters:
stateUpdatedTimestamp
- The time stamp of the last update to the value of either theStateValue
orEvaluationState
parameters.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
metricName
The name of the metric associated with the alarm, if this is an alarm based on a single metric.
- Parameters:
metricName
- The name of the metric associated with the alarm, if this is an alarm based on a single metric.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
namespace
The namespace of the metric associated with the alarm.
- Parameters:
namespace
- The namespace of the metric associated with the alarm.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
statistic
The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use
ExtendedStatistic
.- Parameters:
statistic
- The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, useExtendedStatistic
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
statistic
The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use
ExtendedStatistic
.- Parameters:
statistic
- The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, useExtendedStatistic
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
extendedStatistic
The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.
- Parameters:
extendedStatistic
- The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
dimensions
The dimensions for the metric associated with the alarm.
- Parameters:
dimensions
- The dimensions for the metric associated with the alarm.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
dimensions
The dimensions for the metric associated with the alarm.
- Parameters:
dimensions
- The dimensions for the metric associated with the alarm.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
dimensions
The dimensions for the metric associated with the alarm.
This is a convenience method that creates an instance of theDimension.Builder
avoiding the need to create one manually viaDimension.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed todimensions(List<Dimension>)
.- Parameters:
dimensions
- a consumer that will call methods onDimension.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
period
The period, in seconds, over which the statistic is applied.
- Parameters:
period
- The period, in seconds, over which the statistic is applied.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
unit
The unit of the metric associated with the alarm.
- Parameters:
unit
- The unit of the metric associated with the alarm.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
unit
The unit of the metric associated with the alarm.
- Parameters:
unit
- The unit of the metric associated with the alarm.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
evaluationPeriods
The number of periods over which data is compared to the specified threshold.
- Parameters:
evaluationPeriods
- The number of periods over which data is compared to the specified threshold.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
datapointsToAlarm
The number of data points that must be breaching to trigger the alarm.
- Parameters:
datapointsToAlarm
- The number of data points that must be breaching to trigger the alarm.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
threshold
The value to compare with the specified statistic.
- Parameters:
threshold
- The value to compare with the specified statistic.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
comparisonOperator
The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand.
- Parameters:
comparisonOperator
- The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
comparisonOperator
The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand.
- Parameters:
comparisonOperator
- The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
treatMissingData
Sets how this alarm is to handle missing data points. The valid values are
breaching
,notBreaching
,ignore
, andmissing
. For more information, see Configuring how CloudWatch alarms treat missing data.If this parameter is omitted, the default behavior of
missing
is used.- Parameters:
treatMissingData
- Sets how this alarm is to handle missing data points. The valid values arebreaching
,notBreaching
,ignore
, andmissing
. For more information, see Configuring how CloudWatch alarms treat missing data.If this parameter is omitted, the default behavior of
missing
is used.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
evaluateLowSampleCountPercentile
Used only for alarms based on percentiles. If
ignore
, the alarm state does not change during periods with too few data points to be statistically significant. Ifevaluate
or this parameter is not used, the alarm is always evaluated and possibly changes state no matter how many data points are available.- Parameters:
evaluateLowSampleCountPercentile
- Used only for alarms based on percentiles. Ifignore
, the alarm state does not change during periods with too few data points to be statistically significant. Ifevaluate
or this parameter is not used, the alarm is always evaluated and possibly changes state no matter how many data points are available.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
metrics
An array of MetricDataQuery structures, used in an alarm based on a metric math expression. Each structure either retrieves a metric or performs a math expression. One item in the Metrics array is the math expression that the alarm watches. This expression by designated by having
ReturnData
set to true.- Parameters:
metrics
- An array of MetricDataQuery structures, used in an alarm based on a metric math expression. Each structure either retrieves a metric or performs a math expression. One item in the Metrics array is the math expression that the alarm watches. This expression by designated by havingReturnData
set to true.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
metrics
An array of MetricDataQuery structures, used in an alarm based on a metric math expression. Each structure either retrieves a metric or performs a math expression. One item in the Metrics array is the math expression that the alarm watches. This expression by designated by having
ReturnData
set to true.- Parameters:
metrics
- An array of MetricDataQuery structures, used in an alarm based on a metric math expression. Each structure either retrieves a metric or performs a math expression. One item in the Metrics array is the math expression that the alarm watches. This expression by designated by havingReturnData
set to true.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
metrics
An array of MetricDataQuery structures, used in an alarm based on a metric math expression. Each structure either retrieves a metric or performs a math expression. One item in the Metrics array is the math expression that the alarm watches. This expression by designated by having
This is a convenience method that creates an instance of theReturnData
set to true.MetricDataQuery.Builder
avoiding the need to create one manually viaMetricDataQuery.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed tometrics(List<MetricDataQuery>)
.- Parameters:
metrics
- a consumer that will call methods onMetricDataQuery.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
thresholdMetricId
In an alarm based on an anomaly detection model, this is the ID of the
ANOMALY_DETECTION_BAND
function used as the threshold for the alarm.- Parameters:
thresholdMetricId
- In an alarm based on an anomaly detection model, this is the ID of theANOMALY_DETECTION_BAND
function used as the threshold for the alarm.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
evaluationState
If the value of this field is
PARTIAL_DATA
, the alarm is being evaluated based on only partial data. This happens if the query used for the alarm returns more than 10,000 metrics. For more information, see Create alarms on Metrics Insights queries.- Parameters:
evaluationState
- If the value of this field isPARTIAL_DATA
, the alarm is being evaluated based on only partial data. This happens if the query used for the alarm returns more than 10,000 metrics. For more information, see Create alarms on Metrics Insights queries.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
evaluationState
If the value of this field is
PARTIAL_DATA
, the alarm is being evaluated based on only partial data. This happens if the query used for the alarm returns more than 10,000 metrics. For more information, see Create alarms on Metrics Insights queries.- Parameters:
evaluationState
- If the value of this field isPARTIAL_DATA
, the alarm is being evaluated based on only partial data. This happens if the query used for the alarm returns more than 10,000 metrics. For more information, see Create alarms on Metrics Insights queries.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
stateTransitionedTimestamp
The date and time that the alarm's
StateValue
most recently changed.- Parameters:
stateTransitionedTimestamp
- The date and time that the alarm'sStateValue
most recently changed.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-