Interface MetricAlarm.Builder

    • 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 the OK 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 the OK 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 the ALARM 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 the ALARM 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 the INSUFFICIENT_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 the INSUFFICIENT_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 or EvaluationState parameters.

        Parameters:
        stateUpdatedTimestamp - The time stamp of the last update to the value of either the StateValue or EvaluationState 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.

        Parameters:
        statistic - The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use ExtendedStatistic.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
        See Also:
        Statistic, Statistic
      • statistic

        MetricAlarm.Builder statistic​(Statistic 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, use ExtendedStatistic.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
        See Also:
        Statistic, Statistic
      • 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 the Dimension.Builder avoiding the need to create one manually via Dimension.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 on Dimension.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, and missing. 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 are breaching, notBreaching, ignore, and missing. 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. If evaluate 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. If ignore, the alarm state does not change during periods with too few data points to be statistically significant. If evaluate 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 having ReturnData 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 having ReturnData 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 ReturnData set to true.

        This is a convenience method that creates an instance of the MetricDataQuery.Builder avoiding the need to create one manually via MetricDataQuery.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 on MetricDataQuery.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 the ANOMALY_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 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.
        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 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.
        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's StateValue most recently changed.
        Returns:
        Returns a reference to this object so that method calls can be chained together.