Interface MetricAlarm.Builder
-
- All Superinterfaces:
Buildable
,CopyableBuilder<MetricAlarm.Builder,MetricAlarm>
,SdkBuilder<MetricAlarm.Builder,MetricAlarm>
,SdkPojo
- Enclosing class:
- MetricAlarm
public static interface MetricAlarm.Builder extends SdkPojo, CopyableBuilder<MetricAlarm.Builder,MetricAlarm>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MetricAlarm.Builder
actionsEnabled(Boolean actionsEnabled)
Indicates whether actions should be executed during any changes to the alarm state.MetricAlarm.Builder
alarmActions(String... alarmActions)
The actions to execute when this alarm transitions to theALARM
state from any other state.MetricAlarm.Builder
alarmActions(Collection<String> alarmActions)
The actions to execute when this alarm transitions to theALARM
state from any other state.MetricAlarm.Builder
alarmArn(String alarmArn)
The Amazon Resource Name (ARN) of the alarm.MetricAlarm.Builder
alarmConfigurationUpdatedTimestamp(Instant alarmConfigurationUpdatedTimestamp)
The time stamp of the last update to the alarm configuration.MetricAlarm.Builder
alarmDescription(String alarmDescription)
The description of the alarm.MetricAlarm.Builder
alarmName(String alarmName)
The name of the alarm.MetricAlarm.Builder
comparisonOperator(String comparisonOperator)
The arithmetic operation to use when comparing the specified statistic and threshold.MetricAlarm.Builder
comparisonOperator(ComparisonOperator comparisonOperator)
The arithmetic operation to use when comparing the specified statistic and threshold.MetricAlarm.Builder
datapointsToAlarm(Integer datapointsToAlarm)
The number of data points that must be breaching to trigger the alarm.MetricAlarm.Builder
dimensions(Collection<Dimension> dimensions)
The dimensions for the metric associated with the alarm.MetricAlarm.Builder
dimensions(Consumer<Dimension.Builder>... dimensions)
The dimensions for the metric associated with the alarm.MetricAlarm.Builder
dimensions(Dimension... dimensions)
The dimensions for the metric associated with the alarm.MetricAlarm.Builder
evaluateLowSampleCountPercentile(String evaluateLowSampleCountPercentile)
Used only for alarms based on percentiles.MetricAlarm.Builder
evaluationPeriods(Integer evaluationPeriods)
The number of periods over which data is compared to the specified threshold.MetricAlarm.Builder
evaluationState(String evaluationState)
If the value of this field isPARTIAL_DATA
, the alarm is being evaluated based on only partial data.MetricAlarm.Builder
evaluationState(EvaluationState evaluationState)
If the value of this field isPARTIAL_DATA
, the alarm is being evaluated based on only partial data.MetricAlarm.Builder
extendedStatistic(String extendedStatistic)
The percentile statistic for the metric associated with the alarm.MetricAlarm.Builder
insufficientDataActions(String... insufficientDataActions)
The actions to execute when this alarm transitions to theINSUFFICIENT_DATA
state from any other state.MetricAlarm.Builder
insufficientDataActions(Collection<String> insufficientDataActions)
The actions to execute when this alarm transitions to theINSUFFICIENT_DATA
state from any other state.MetricAlarm.Builder
metricName(String metricName)
The name of the metric associated with the alarm, if this is an alarm based on a single metric.MetricAlarm.Builder
metrics(Collection<MetricDataQuery> metrics)
An array of MetricDataQuery structures, used in an alarm based on a metric math expression.MetricAlarm.Builder
metrics(Consumer<MetricDataQuery.Builder>... metrics)
An array of MetricDataQuery structures, used in an alarm based on a metric math expression.MetricAlarm.Builder
metrics(MetricDataQuery... metrics)
An array of MetricDataQuery structures, used in an alarm based on a metric math expression.MetricAlarm.Builder
namespace(String namespace)
The namespace of the metric associated with the alarm.MetricAlarm.Builder
okActions(String... okActions)
The actions to execute when this alarm transitions to theOK
state from any other state.MetricAlarm.Builder
okActions(Collection<String> okActions)
The actions to execute when this alarm transitions to theOK
state from any other state.MetricAlarm.Builder
period(Integer period)
The period, in seconds, over which the statistic is applied.MetricAlarm.Builder
stateReason(String stateReason)
An explanation for the alarm state, in text format.MetricAlarm.Builder
stateReasonData(String stateReasonData)
An explanation for the alarm state, in JSON format.MetricAlarm.Builder
stateTransitionedTimestamp(Instant stateTransitionedTimestamp)
The date and time that the alarm'sStateValue
most recently changed.MetricAlarm.Builder
stateUpdatedTimestamp(Instant stateUpdatedTimestamp)
The time stamp of the last update to the value of either theStateValue
orEvaluationState
parameters.MetricAlarm.Builder
stateValue(String stateValue)
The state value for the alarm.MetricAlarm.Builder
stateValue(StateValue stateValue)
The state value for the alarm.MetricAlarm.Builder
statistic(String statistic)
The statistic for the metric associated with the alarm, other than percentile.MetricAlarm.Builder
statistic(Statistic statistic)
The statistic for the metric associated with the alarm, other than percentile.MetricAlarm.Builder
threshold(Double threshold)
The value to compare with the specified statistic.MetricAlarm.Builder
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.MetricAlarm.Builder
treatMissingData(String treatMissingData)
Sets how this alarm is to handle missing data points.MetricAlarm.Builder
unit(String unit)
The unit of the metric associated with the alarm.MetricAlarm.Builder
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, sdkFields
-
-
-
-
Method Detail
-
alarmName
MetricAlarm.Builder alarmName(String 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
MetricAlarm.Builder alarmArn(String 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
MetricAlarm.Builder alarmDescription(String 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
MetricAlarm.Builder alarmConfigurationUpdatedTimestamp(Instant 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
MetricAlarm.Builder actionsEnabled(Boolean 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
MetricAlarm.Builder okActions(Collection<String> 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
MetricAlarm.Builder okActions(String... 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
MetricAlarm.Builder alarmActions(Collection<String> 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
MetricAlarm.Builder alarmActions(String... 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
MetricAlarm.Builder insufficientDataActions(Collection<String> 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
MetricAlarm.Builder insufficientDataActions(String... 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
MetricAlarm.Builder stateValue(String 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
,StateValue
-
stateValue
MetricAlarm.Builder stateValue(StateValue 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
,StateValue
-
stateReason
MetricAlarm.Builder stateReason(String 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
MetricAlarm.Builder stateReasonData(String 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
MetricAlarm.Builder stateUpdatedTimestamp(Instant 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
MetricAlarm.Builder metricName(String 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
MetricAlarm.Builder namespace(String 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
MetricAlarm.Builder statistic(String statistic)
The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use
ExtendedStatistic
.
-
statistic
MetricAlarm.Builder statistic(Statistic statistic)
The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use
ExtendedStatistic
.
-
extendedStatistic
MetricAlarm.Builder extendedStatistic(String 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
MetricAlarm.Builder dimensions(Collection<Dimension> 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
MetricAlarm.Builder dimensions(Dimension... 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
MetricAlarm.Builder dimensions(Consumer<Dimension.Builder>... 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 to#dimensions(List
.) - 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:
#dimensions(java.util.Collection
)
-
period
MetricAlarm.Builder period(Integer 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
MetricAlarm.Builder unit(String 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:
StandardUnit
,StandardUnit
-
unit
MetricAlarm.Builder unit(StandardUnit 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:
StandardUnit
,StandardUnit
-
evaluationPeriods
MetricAlarm.Builder evaluationPeriods(Integer 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
MetricAlarm.Builder datapointsToAlarm(Integer 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
MetricAlarm.Builder threshold(Double 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
MetricAlarm.Builder comparisonOperator(String 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
,ComparisonOperator
-
comparisonOperator
MetricAlarm.Builder comparisonOperator(ComparisonOperator 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
,ComparisonOperator
-
treatMissingData
MetricAlarm.Builder treatMissingData(String 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
MetricAlarm.Builder evaluateLowSampleCountPercentile(String 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
MetricAlarm.Builder metrics(Collection<MetricDataQuery> 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
MetricAlarm.Builder metrics(MetricDataQuery... 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
MetricAlarm.Builder metrics(Consumer<MetricDataQuery.Builder>... 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 to#metrics(List
.) - 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:
#metrics(java.util.Collection
)
-
thresholdMetricId
MetricAlarm.Builder thresholdMetricId(String 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
MetricAlarm.Builder evaluationState(String 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
,EvaluationState
-
evaluationState
MetricAlarm.Builder evaluationState(EvaluationState 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
,EvaluationState
-
stateTransitionedTimestamp
MetricAlarm.Builder stateTransitionedTimestamp(Instant 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.
-
-