Class MetricAlarm

java.lang.Object
com.amazonaws.services.cloudwatch.model.MetricAlarm
All Implemented Interfaces:
Serializable, Cloneable

public class MetricAlarm extends Object implements Serializable, Cloneable

The MetricAlarm data type represents an alarm. You can use PutMetricAlarm to create or update an alarm.

See Also:
  • Constructor Details

    • MetricAlarm

      public MetricAlarm()
  • Method Details

    • setAlarmName

      public void setAlarmName(String alarmName)

      The name of the alarm.

      Parameters:
      alarmName - The name of the alarm.
    • getAlarmName

      public String getAlarmName()

      The name of the alarm.

      Returns:
      The name of the alarm.
    • withAlarmName

      public MetricAlarm withAlarmName(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.
    • setAlarmArn

      public void setAlarmArn(String alarmArn)

      The Amazon Resource Name (ARN) of the alarm.

      Parameters:
      alarmArn - The Amazon Resource Name (ARN) of the alarm.
    • getAlarmArn

      public String getAlarmArn()

      The Amazon Resource Name (ARN) of the alarm.

      Returns:
      The Amazon Resource Name (ARN) of the alarm.
    • withAlarmArn

      public MetricAlarm withAlarmArn(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.
    • setAlarmDescription

      public void setAlarmDescription(String alarmDescription)

      The description for the alarm.

      Parameters:
      alarmDescription - The description for the alarm.
    • getAlarmDescription

      public String getAlarmDescription()

      The description for the alarm.

      Returns:
      The description for the alarm.
    • withAlarmDescription

      public MetricAlarm withAlarmDescription(String alarmDescription)

      The description for the alarm.

      Parameters:
      alarmDescription - The description for the alarm.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setAlarmConfigurationUpdatedTimestamp

      public void setAlarmConfigurationUpdatedTimestamp(Date 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.
    • getAlarmConfigurationUpdatedTimestamp

      public Date getAlarmConfigurationUpdatedTimestamp()

      The time stamp of the last update to the alarm configuration.

      Returns:
      The time stamp of the last update to the alarm configuration.
    • withAlarmConfigurationUpdatedTimestamp

      public MetricAlarm withAlarmConfigurationUpdatedTimestamp(Date 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.
    • setActionsEnabled

      public void setActionsEnabled(Boolean actionsEnabled)

      Indicates whether actions should be executed during any changes to the alarm's state.

      Parameters:
      actionsEnabled - Indicates whether actions should be executed during any changes to the alarm's state.
    • getActionsEnabled

      public Boolean getActionsEnabled()

      Indicates whether actions should be executed during any changes to the alarm's state.

      Returns:
      Indicates whether actions should be executed during any changes to the alarm's state.
    • withActionsEnabled

      public MetricAlarm withActionsEnabled(Boolean actionsEnabled)

      Indicates whether actions should be executed during any changes to the alarm's state.

      Parameters:
      actionsEnabled - Indicates whether actions should be executed during any changes to the alarm's state.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • isActionsEnabled

      public Boolean isActionsEnabled()

      Indicates whether actions should be executed during any changes to the alarm's state.

      Returns:
      Indicates whether actions should be executed during any changes to the alarm's state.
    • getOKActions

      public List<String> getOKActions()

      The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Name (ARN).

      Returns:
      The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Name (ARN).
    • setOKActions

      public void setOKActions(Collection<String> oKActions)

      The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Name (ARN).

      Parameters:
      oKActions - The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Name (ARN).
    • withOKActions

      public MetricAlarm withOKActions(String... oKActions)

      The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Name (ARN).

      NOTE: This method appends the values to the existing list (if any). Use setOKActions(java.util.Collection) or withOKActions(java.util.Collection) if you want to override the existing values.

      Parameters:
      oKActions - The list of actions to execute when this alarm transitions into an 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.
    • withOKActions

      public MetricAlarm withOKActions(Collection<String> oKActions)

      The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Name (ARN).

      Parameters:
      oKActions - The list of actions to execute when this alarm transitions into an 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.
    • getAlarmActions

      public List<String> getAlarmActions()

      The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN).

      Returns:
      The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN).
    • setAlarmActions

      public void setAlarmActions(Collection<String> alarmActions)

      The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN).

      Parameters:
      alarmActions - The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN).
    • withAlarmActions

      public MetricAlarm withAlarmActions(String... alarmActions)

      The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN).

      NOTE: This method appends the values to the existing list (if any). Use setAlarmActions(java.util.Collection) or withAlarmActions(java.util.Collection) if you want to override the existing values.

      Parameters:
      alarmActions - The list of actions to execute when this alarm transitions into an 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.
    • withAlarmActions

      public MetricAlarm withAlarmActions(Collection<String> alarmActions)

      The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN).

      Parameters:
      alarmActions - The list of actions to execute when this alarm transitions into an 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.
    • getInsufficientDataActions

      public List<String> getInsufficientDataActions()

      The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).

      The current WSDL lists this attribute as UnknownActions.
      Returns:
      The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).

      The current WSDL lists this attribute as UnknownActions.
    • setInsufficientDataActions

      public void setInsufficientDataActions(Collection<String> insufficientDataActions)

      The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).

      The current WSDL lists this attribute as UnknownActions.
      Parameters:
      insufficientDataActions - The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).

      The current WSDL lists this attribute as UnknownActions.
    • withInsufficientDataActions

      public MetricAlarm withInsufficientDataActions(String... insufficientDataActions)

      The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).

      The current WSDL lists this attribute as UnknownActions.

      NOTE: This method appends the values to the existing list (if any). Use setInsufficientDataActions(java.util.Collection) or withInsufficientDataActions(java.util.Collection) if you want to override the existing values.

      Parameters:
      insufficientDataActions - The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).

      The current WSDL lists this attribute as UnknownActions.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • withInsufficientDataActions

      public MetricAlarm withInsufficientDataActions(Collection<String> insufficientDataActions)

      The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).

      The current WSDL lists this attribute as UnknownActions.
      Parameters:
      insufficientDataActions - The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).

      The current WSDL lists this attribute as UnknownActions.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setStateValue

      public void setStateValue(String stateValue)

      The state value for the alarm.

      Parameters:
      stateValue - The state value for the alarm.
      See Also:
    • getStateValue

      public String getStateValue()

      The state value for the alarm.

      Returns:
      The state value for the alarm.
      See Also:
    • withStateValue

      public MetricAlarm withStateValue(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:
    • setStateValue

      public void setStateValue(StateValue stateValue)

      The state value for the alarm.

      Parameters:
      stateValue - The state value for the alarm.
      See Also:
    • withStateValue

      public MetricAlarm withStateValue(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:
    • setStateReason

      public void setStateReason(String stateReason)

      A human-readable explanation for the alarm's state.

      Parameters:
      stateReason - A human-readable explanation for the alarm's state.
    • getStateReason

      public String getStateReason()

      A human-readable explanation for the alarm's state.

      Returns:
      A human-readable explanation for the alarm's state.
    • withStateReason

      public MetricAlarm withStateReason(String stateReason)

      A human-readable explanation for the alarm's state.

      Parameters:
      stateReason - A human-readable explanation for the alarm's state.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setStateReasonData

      public void setStateReasonData(String stateReasonData)

      An explanation for the alarm's state in machine-readable JSON format

      Parameters:
      stateReasonData - An explanation for the alarm's state in machine-readable JSON format
    • getStateReasonData

      public String getStateReasonData()

      An explanation for the alarm's state in machine-readable JSON format

      Returns:
      An explanation for the alarm's state in machine-readable JSON format
    • withStateReasonData

      public MetricAlarm withStateReasonData(String stateReasonData)

      An explanation for the alarm's state in machine-readable JSON format

      Parameters:
      stateReasonData - An explanation for the alarm's state in machine-readable JSON format
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setStateUpdatedTimestamp

      public void setStateUpdatedTimestamp(Date stateUpdatedTimestamp)

      The time stamp of the last update to the alarm's state.

      Parameters:
      stateUpdatedTimestamp - The time stamp of the last update to the alarm's state.
    • getStateUpdatedTimestamp

      public Date getStateUpdatedTimestamp()

      The time stamp of the last update to the alarm's state.

      Returns:
      The time stamp of the last update to the alarm's state.
    • withStateUpdatedTimestamp

      public MetricAlarm withStateUpdatedTimestamp(Date stateUpdatedTimestamp)

      The time stamp of the last update to the alarm's state.

      Parameters:
      stateUpdatedTimestamp - The time stamp of the last update to the alarm's state.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setMetricName

      public void setMetricName(String metricName)

      The name of the alarm's metric.

      Parameters:
      metricName - The name of the alarm's metric.
    • getMetricName

      public String getMetricName()

      The name of the alarm's metric.

      Returns:
      The name of the alarm's metric.
    • withMetricName

      public MetricAlarm withMetricName(String metricName)

      The name of the alarm's metric.

      Parameters:
      metricName - The name of the alarm's metric.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setNamespace

      public void setNamespace(String namespace)

      The namespace of alarm's associated metric.

      Parameters:
      namespace - The namespace of alarm's associated metric.
    • getNamespace

      public String getNamespace()

      The namespace of alarm's associated metric.

      Returns:
      The namespace of alarm's associated metric.
    • withNamespace

      public MetricAlarm withNamespace(String namespace)

      The namespace of alarm's associated metric.

      Parameters:
      namespace - The namespace of alarm's associated metric.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setStatistic

      public void setStatistic(String statistic)

      The statistic to apply to the alarm's associated metric.

      Parameters:
      statistic - The statistic to apply to the alarm's associated metric.
      See Also:
    • getStatistic

      public String getStatistic()

      The statistic to apply to the alarm's associated metric.

      Returns:
      The statistic to apply to the alarm's associated metric.
      See Also:
    • withStatistic

      public MetricAlarm withStatistic(String statistic)

      The statistic to apply to the alarm's associated metric.

      Parameters:
      statistic - The statistic to apply to the alarm's associated metric.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • setStatistic

      public void setStatistic(Statistic statistic)

      The statistic to apply to the alarm's associated metric.

      Parameters:
      statistic - The statistic to apply to the alarm's associated metric.
      See Also:
    • withStatistic

      public MetricAlarm withStatistic(Statistic statistic)

      The statistic to apply to the alarm's associated metric.

      Parameters:
      statistic - The statistic to apply to the alarm's associated metric.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • getDimensions

      public List<Dimension> getDimensions()

      The list of dimensions associated with the alarm's associated metric.

      Returns:
      The list of dimensions associated with the alarm's associated metric.
    • setDimensions

      public void setDimensions(Collection<Dimension> dimensions)

      The list of dimensions associated with the alarm's associated metric.

      Parameters:
      dimensions - The list of dimensions associated with the alarm's associated metric.
    • withDimensions

      public MetricAlarm withDimensions(Dimension... dimensions)

      The list of dimensions associated with the alarm's associated metric.

      NOTE: This method appends the values to the existing list (if any). Use setDimensions(java.util.Collection) or withDimensions(java.util.Collection) if you want to override the existing values.

      Parameters:
      dimensions - The list of dimensions associated with the alarm's associated metric.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • withDimensions

      public MetricAlarm withDimensions(Collection<Dimension> dimensions)

      The list of dimensions associated with the alarm's associated metric.

      Parameters:
      dimensions - The list of dimensions associated with the alarm's associated metric.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setPeriod

      public void setPeriod(Integer period)

      The period in seconds over which the statistic is applied.

      Parameters:
      period - The period in seconds over which the statistic is applied.
    • getPeriod

      public Integer getPeriod()

      The period in seconds over which the statistic is applied.

      Returns:
      The period in seconds over which the statistic is applied.
    • withPeriod

      public MetricAlarm withPeriod(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.
    • setUnit

      public void setUnit(String unit)

      The unit of the alarm's associated metric.

      Parameters:
      unit - The unit of the alarm's associated metric.
      See Also:
    • getUnit

      public String getUnit()

      The unit of the alarm's associated metric.

      Returns:
      The unit of the alarm's associated metric.
      See Also:
    • withUnit

      public MetricAlarm withUnit(String unit)

      The unit of the alarm's associated metric.

      Parameters:
      unit - The unit of the alarm's associated metric.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • setUnit

      public void setUnit(StandardUnit unit)

      The unit of the alarm's associated metric.

      Parameters:
      unit - The unit of the alarm's associated metric.
      See Also:
    • withUnit

      public MetricAlarm withUnit(StandardUnit unit)

      The unit of the alarm's associated metric.

      Parameters:
      unit - The unit of the alarm's associated metric.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • setEvaluationPeriods

      public void setEvaluationPeriods(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.
    • getEvaluationPeriods

      public Integer getEvaluationPeriods()

      The number of periods over which data is compared to the specified threshold.

      Returns:
      The number of periods over which data is compared to the specified threshold.
    • withEvaluationPeriods

      public MetricAlarm withEvaluationPeriods(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.
    • setThreshold

      public void setThreshold(Double threshold)

      The value against which the specified statistic is compared.

      Parameters:
      threshold - The value against which the specified statistic is compared.
    • getThreshold

      public Double getThreshold()

      The value against which the specified statistic is compared.

      Returns:
      The value against which the specified statistic is compared.
    • withThreshold

      public MetricAlarm withThreshold(Double threshold)

      The value against which the specified statistic is compared.

      Parameters:
      threshold - The value against which the specified statistic is compared.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setComparisonOperator

      public void setComparisonOperator(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.
      See Also:
    • getComparisonOperator

      public String getComparisonOperator()

      The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand.

      Returns:
      The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand.
      See Also:
    • withComparisonOperator

      public MetricAlarm withComparisonOperator(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:
    • setComparisonOperator

      public void setComparisonOperator(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.
      See Also:
    • withComparisonOperator

      public MetricAlarm withComparisonOperator(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:
    • toString

      public String toString()
      Returns a string representation of this object; useful for testing and debugging.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this object.
      See Also:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • clone

      public MetricAlarm clone()
      Overrides:
      clone in class Object