java.lang.Object
software.amazon.awssdk.services.lightsail.model.Alarm
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<Alarm.Builder,Alarm>

@Generated("software.amazon.awssdk:codegen") public final class Alarm extends Object implements SdkPojo, Serializable, ToCopyableBuilder<Alarm.Builder,Alarm>

Describes an alarm.

An alarm is a way to monitor your Lightsail resource metrics. For more information, see Alarms in Amazon Lightsail.

See Also:
  • Method Details

    • name

      public final String name()

      The name of the alarm.

      Returns:
      The name of the alarm.
    • arn

      public final String arn()

      The Amazon Resource Name (ARN) of the alarm.

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

      public final Instant createdAt()

      The timestamp when the alarm was created.

      Returns:
      The timestamp when the alarm was created.
    • location

      public final ResourceLocation location()

      An object that lists information about the location of the alarm.

      Returns:
      An object that lists information about the location of the alarm.
    • resourceType

      public final ResourceType resourceType()

      The Lightsail resource type of the alarm.

      If the service returns an enum value that is not available in the current SDK version, resourceType will return ResourceType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from resourceTypeAsString().

      Returns:
      The Lightsail resource type of the alarm.
      See Also:
    • resourceTypeAsString

      public final String resourceTypeAsString()

      The Lightsail resource type of the alarm.

      If the service returns an enum value that is not available in the current SDK version, resourceType will return ResourceType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from resourceTypeAsString().

      Returns:
      The Lightsail resource type of the alarm.
      See Also:
    • supportCode

      public final String supportCode()

      The support code. Include this code in your email to support when you have questions about your Lightsail alarm. This code enables our support team to look up your Lightsail information more easily.

      Returns:
      The support code. Include this code in your email to support when you have questions about your Lightsail alarm. This code enables our support team to look up your Lightsail information more easily.
    • monitoredResourceInfo

      public final MonitoredResourceInfo monitoredResourceInfo()

      An object that lists information about the resource monitored by the alarm.

      Returns:
      An object that lists information about the resource monitored by the alarm.
    • comparisonOperator

      public final ComparisonOperator comparisonOperator()

      The arithmetic operation used when comparing the specified statistic and threshold.

      If the service returns an enum value that is not available in the current SDK version, comparisonOperator will return ComparisonOperator.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from comparisonOperatorAsString().

      Returns:
      The arithmetic operation used when comparing the specified statistic and threshold.
      See Also:
    • comparisonOperatorAsString

      public final String comparisonOperatorAsString()

      The arithmetic operation used when comparing the specified statistic and threshold.

      If the service returns an enum value that is not available in the current SDK version, comparisonOperator will return ComparisonOperator.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from comparisonOperatorAsString().

      Returns:
      The arithmetic operation used when comparing the specified statistic and threshold.
      See Also:
    • evaluationPeriods

      public final Integer evaluationPeriods()

      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.
    • period

      public final Integer period()

      The period, in seconds, over which the statistic is applied.

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

      public final Double threshold()

      The value against which the specified statistic is compared.

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

      public final Integer datapointsToAlarm()

      The number of data points that must not within the specified threshold to trigger the alarm.

      Returns:
      The number of data points that must not within the specified threshold to trigger the alarm.
    • treatMissingData

      public final TreatMissingData treatMissingData()

      Specifies how the alarm handles missing data points.

      An alarm can treat missing data in the following ways:

      • breaching - Assume the missing data is not within the threshold. Missing data counts towards the number of times the metric is not within the threshold.

      • notBreaching - Assume the missing data is within the threshold. Missing data does not count towards the number of times the metric is not within the threshold.

      • ignore - Ignore the missing data. Maintains the current alarm state.

      • missing - Missing data is treated as missing.

      If the service returns an enum value that is not available in the current SDK version, treatMissingData will return TreatMissingData.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from treatMissingDataAsString().

      Returns:
      Specifies how the alarm handles missing data points.

      An alarm can treat missing data in the following ways:

      • breaching - Assume the missing data is not within the threshold. Missing data counts towards the number of times the metric is not within the threshold.

      • notBreaching - Assume the missing data is within the threshold. Missing data does not count towards the number of times the metric is not within the threshold.

      • ignore - Ignore the missing data. Maintains the current alarm state.

      • missing - Missing data is treated as missing.

      See Also:
    • treatMissingDataAsString

      public final String treatMissingDataAsString()

      Specifies how the alarm handles missing data points.

      An alarm can treat missing data in the following ways:

      • breaching - Assume the missing data is not within the threshold. Missing data counts towards the number of times the metric is not within the threshold.

      • notBreaching - Assume the missing data is within the threshold. Missing data does not count towards the number of times the metric is not within the threshold.

      • ignore - Ignore the missing data. Maintains the current alarm state.

      • missing - Missing data is treated as missing.

      If the service returns an enum value that is not available in the current SDK version, treatMissingData will return TreatMissingData.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from treatMissingDataAsString().

      Returns:
      Specifies how the alarm handles missing data points.

      An alarm can treat missing data in the following ways:

      • breaching - Assume the missing data is not within the threshold. Missing data counts towards the number of times the metric is not within the threshold.

      • notBreaching - Assume the missing data is within the threshold. Missing data does not count towards the number of times the metric is not within the threshold.

      • ignore - Ignore the missing data. Maintains the current alarm state.

      • missing - Missing data is treated as missing.

      See Also:
    • statistic

      public final MetricStatistic statistic()

      The statistic for the metric associated with the alarm.

      The following statistics are available:

      • Minimum - The lowest value observed during the specified period. Use this value to determine low volumes of activity for your application.

      • Maximum - The highest value observed during the specified period. Use this value to determine high volumes of activity for your application.

      • Sum - All values submitted for the matching metric added together. You can use this statistic to determine the total volume of a metric.

      • Average - The value of Sum / SampleCount during the specified period. By comparing this statistic with the Minimum and Maximum values, you can determine the full scope of a metric and how close the average use is to the Minimum and Maximum values. This comparison helps you to know when to increase or decrease your resources.

      • SampleCount - The count, or number, of data points used for the statistical calculation.

      If the service returns an enum value that is not available in the current SDK version, statistic will return MetricStatistic.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from statisticAsString().

      Returns:
      The statistic for the metric associated with the alarm.

      The following statistics are available:

      • Minimum - The lowest value observed during the specified period. Use this value to determine low volumes of activity for your application.

      • Maximum - The highest value observed during the specified period. Use this value to determine high volumes of activity for your application.

      • Sum - All values submitted for the matching metric added together. You can use this statistic to determine the total volume of a metric.

      • Average - The value of Sum / SampleCount during the specified period. By comparing this statistic with the Minimum and Maximum values, you can determine the full scope of a metric and how close the average use is to the Minimum and Maximum values. This comparison helps you to know when to increase or decrease your resources.

      • SampleCount - The count, or number, of data points used for the statistical calculation.

      See Also:
    • statisticAsString

      public final String statisticAsString()

      The statistic for the metric associated with the alarm.

      The following statistics are available:

      • Minimum - The lowest value observed during the specified period. Use this value to determine low volumes of activity for your application.

      • Maximum - The highest value observed during the specified period. Use this value to determine high volumes of activity for your application.

      • Sum - All values submitted for the matching metric added together. You can use this statistic to determine the total volume of a metric.

      • Average - The value of Sum / SampleCount during the specified period. By comparing this statistic with the Minimum and Maximum values, you can determine the full scope of a metric and how close the average use is to the Minimum and Maximum values. This comparison helps you to know when to increase or decrease your resources.

      • SampleCount - The count, or number, of data points used for the statistical calculation.

      If the service returns an enum value that is not available in the current SDK version, statistic will return MetricStatistic.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from statisticAsString().

      Returns:
      The statistic for the metric associated with the alarm.

      The following statistics are available:

      • Minimum - The lowest value observed during the specified period. Use this value to determine low volumes of activity for your application.

      • Maximum - The highest value observed during the specified period. Use this value to determine high volumes of activity for your application.

      • Sum - All values submitted for the matching metric added together. You can use this statistic to determine the total volume of a metric.

      • Average - The value of Sum / SampleCount during the specified period. By comparing this statistic with the Minimum and Maximum values, you can determine the full scope of a metric and how close the average use is to the Minimum and Maximum values. This comparison helps you to know when to increase or decrease your resources.

      • SampleCount - The count, or number, of data points used for the statistical calculation.

      See Also:
    • metricName

      public final MetricName metricName()

      The name of the metric associated with the alarm.

      If the service returns an enum value that is not available in the current SDK version, metricName will return MetricName.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from metricNameAsString().

      Returns:
      The name of the metric associated with the alarm.
      See Also:
    • metricNameAsString

      public final String metricNameAsString()

      The name of the metric associated with the alarm.

      If the service returns an enum value that is not available in the current SDK version, metricName will return MetricName.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from metricNameAsString().

      Returns:
      The name of the metric associated with the alarm.
      See Also:
    • state

      public final AlarmState state()

      The current state of the alarm.

      An alarm has the following possible states:

      • ALARM - The metric is outside of the defined threshold.

      • INSUFFICIENT_DATA - The alarm has just started, the metric is not available, or not enough data is available for the metric to determine the alarm state.

      • OK - The metric is within the defined threshold.

      If the service returns an enum value that is not available in the current SDK version, state will return AlarmState.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from stateAsString().

      Returns:
      The current state of the alarm.

      An alarm has the following possible states:

      • ALARM - The metric is outside of the defined threshold.

      • INSUFFICIENT_DATA - The alarm has just started, the metric is not available, or not enough data is available for the metric to determine the alarm state.

      • OK - The metric is within the defined threshold.

      See Also:
    • stateAsString

      public final String stateAsString()

      The current state of the alarm.

      An alarm has the following possible states:

      • ALARM - The metric is outside of the defined threshold.

      • INSUFFICIENT_DATA - The alarm has just started, the metric is not available, or not enough data is available for the metric to determine the alarm state.

      • OK - The metric is within the defined threshold.

      If the service returns an enum value that is not available in the current SDK version, state will return AlarmState.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from stateAsString().

      Returns:
      The current state of the alarm.

      An alarm has the following possible states:

      • ALARM - The metric is outside of the defined threshold.

      • INSUFFICIENT_DATA - The alarm has just started, the metric is not available, or not enough data is available for the metric to determine the alarm state.

      • OK - The metric is within the defined threshold.

      See Also:
    • unit

      public final MetricUnit unit()

      The unit of the metric associated with the alarm.

      If the service returns an enum value that is not available in the current SDK version, unit will return MetricUnit.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from unitAsString().

      Returns:
      The unit of the metric associated with the alarm.
      See Also:
    • unitAsString

      public final String unitAsString()

      The unit of the metric associated with the alarm.

      If the service returns an enum value that is not available in the current SDK version, unit will return MetricUnit.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from unitAsString().

      Returns:
      The unit of the metric associated with the alarm.
      See Also:
    • contactProtocols

      public final List<ContactProtocol> contactProtocols()

      The contact protocols for the alarm, such as Email, SMS (text messaging), or both.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasContactProtocols() method.

      Returns:
      The contact protocols for the alarm, such as Email, SMS (text messaging), or both.
    • hasContactProtocols

      public final boolean hasContactProtocols()
      For responses, this returns true if the service returned a value for the ContactProtocols property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • contactProtocolsAsStrings

      public final List<String> contactProtocolsAsStrings()

      The contact protocols for the alarm, such as Email, SMS (text messaging), or both.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasContactProtocols() method.

      Returns:
      The contact protocols for the alarm, such as Email, SMS (text messaging), or both.
    • notificationTriggers

      public final List<AlarmState> notificationTriggers()

      The alarm states that trigger a notification.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasNotificationTriggers() method.

      Returns:
      The alarm states that trigger a notification.
    • hasNotificationTriggers

      public final boolean hasNotificationTriggers()
      For responses, this returns true if the service returned a value for the NotificationTriggers property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • notificationTriggersAsStrings

      public final List<String> notificationTriggersAsStrings()

      The alarm states that trigger a notification.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasNotificationTriggers() method.

      Returns:
      The alarm states that trigger a notification.
    • notificationEnabled

      public final Boolean notificationEnabled()

      Indicates whether the alarm is enabled.

      Returns:
      Indicates whether the alarm is enabled.
    • toBuilder

      public Alarm.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<Alarm.Builder,Alarm>
      Returns:
      a builder for type T
    • builder

      public static Alarm.Builder builder()
    • serializableBuilderClass

      public static Class<? extends Alarm.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

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

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.