Class Alarm

    • Method Detail

      • 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.
      • 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.
      • 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:
        TreatMissingData
      • 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:
        TreatMissingData
      • 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:
        MetricStatistic
      • 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:
        MetricStatistic
      • 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:
        MetricName
      • 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:
        AlarmState
      • 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:
        AlarmState
      • 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:
        MetricUnit
      • 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:
        MetricUnit
      • 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.
      • 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
      • 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)