Class CreateAlarmOptions.Builder
java.lang.Object
software.amazon.awscdk.services.cloudwatch.CreateAlarmOptions.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CreateAlarmOptions>
- Enclosing interface:
CreateAlarmOptions
@Stability(Stable)
public static final class CreateAlarmOptions.Builder
extends Object
implements software.amazon.jsii.Builder<CreateAlarmOptions>
A builder for
CreateAlarmOptions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionactionsEnabled
(Boolean actionsEnabled) Sets the value ofCreateAlarmOptions.getActionsEnabled()
alarmDescription
(String alarmDescription) Sets the value ofCreateAlarmOptions.getAlarmDescription()
Sets the value ofCreateAlarmOptions.getAlarmName()
build()
Builds the configured instance.comparisonOperator
(ComparisonOperator comparisonOperator) Sets the value ofCreateAlarmOptions.getComparisonOperator()
datapointsToAlarm
(Number datapointsToAlarm) Sets the value ofCreateAlarmOptions.getDatapointsToAlarm()
evaluateLowSampleCountPercentile
(String evaluateLowSampleCountPercentile) Sets the value ofCreateAlarmOptions.getEvaluateLowSampleCountPercentile()
evaluationPeriods
(Number evaluationPeriods) Sets the value ofCreateAlarmOptions.getEvaluationPeriods()
Sets the value ofCreateAlarmOptions.getThreshold()
treatMissingData
(TreatMissingData treatMissingData) Sets the value ofCreateAlarmOptions.getTreatMissingData()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
evaluationPeriods
Sets the value ofCreateAlarmOptions.getEvaluationPeriods()
- Parameters:
evaluationPeriods
- The number of periods over which data is compared to the specified threshold. This parameter is required.- Returns:
this
-
threshold
Sets the value ofCreateAlarmOptions.getThreshold()
- Parameters:
threshold
- The value against which the specified statistic is compared. This parameter is required.- Returns:
this
-
actionsEnabled
Sets the value ofCreateAlarmOptions.getActionsEnabled()
- Parameters:
actionsEnabled
- Whether the actions for this alarm are enabled.- Returns:
this
-
alarmDescription
Sets the value ofCreateAlarmOptions.getAlarmDescription()
- Parameters:
alarmDescription
- Description for the alarm.- Returns:
this
-
alarmName
Sets the value ofCreateAlarmOptions.getAlarmName()
- Parameters:
alarmName
- Name of the alarm.- Returns:
this
-
comparisonOperator
@Stability(Stable) public CreateAlarmOptions.Builder comparisonOperator(ComparisonOperator comparisonOperator) Sets the value ofCreateAlarmOptions.getComparisonOperator()
- Parameters:
comparisonOperator
- Comparison to use to check if metric is breaching.- Returns:
this
-
datapointsToAlarm
Sets the value ofCreateAlarmOptions.getDatapointsToAlarm()
- Parameters:
datapointsToAlarm
- The number of datapoints that must be breaching to trigger the alarm. This is used only if you are setting an "M out of N" alarm. In that case, this value is the M. For more information, see Evaluating an Alarm in the Amazon CloudWatch User Guide.- Returns:
this
-
evaluateLowSampleCountPercentile
@Stability(Stable) public CreateAlarmOptions.Builder evaluateLowSampleCountPercentile(String evaluateLowSampleCountPercentile) Sets the value ofCreateAlarmOptions.getEvaluateLowSampleCountPercentile()
- Parameters:
evaluateLowSampleCountPercentile
- Specifies whether to evaluate the data and potentially change the alarm state if there are too few data points to be statistically significant. Used only for alarms that are based on percentiles.- Returns:
this
-
treatMissingData
@Stability(Stable) public CreateAlarmOptions.Builder treatMissingData(TreatMissingData treatMissingData) Sets the value ofCreateAlarmOptions.getTreatMissingData()
- Parameters:
treatMissingData
- Sets how this alarm is to handle missing data points.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CreateAlarmOptions>
- Returns:
- a new instance of
CreateAlarmOptions
- Throws:
NullPointerException
- if any required attribute was not provided
-