Class Alarm
- 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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAlarm.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringarn()The Amazon Resource Name (ARN) of the alarm.static Alarm.Builderbuilder()ComparisonOperatorcomparisonOperator()The arithmetic operation used when comparing the specified statistic and threshold.StringcomparisonOperatorAsString()The arithmetic operation used when comparing the specified statistic and threshold.List<ContactProtocol>contactProtocols()The contact protocols for the alarm, such asEmail,SMS(text messaging), or both.List<String>contactProtocolsAsStrings()The contact protocols for the alarm, such asEmail,SMS(text messaging), or both.InstantcreatedAt()The timestamp when the alarm was created.IntegerdatapointsToAlarm()The number of data points that must not within the specified threshold to trigger the alarm.booleanequals(Object obj)booleanequalsBySdkFields(Object obj)IntegerevaluationPeriods()The number of periods over which data is compared to the specified threshold.<T> Optional<T>getValueForField(String fieldName, Class<T> clazz)booleanhasContactProtocols()For responses, this returns true if the service returned a value for the ContactProtocols property.inthashCode()booleanhasNotificationTriggers()For responses, this returns true if the service returned a value for the NotificationTriggers property.ResourceLocationlocation()An object that lists information about the location of the alarm.MetricNamemetricName()The name of the metric associated with the alarm.StringmetricNameAsString()The name of the metric associated with the alarm.MonitoredResourceInfomonitoredResourceInfo()An object that lists information about the resource monitored by the alarm.Stringname()The name of the alarm.BooleannotificationEnabled()Indicates whether the alarm is enabled.List<AlarmState>notificationTriggers()The alarm states that trigger a notification.List<String>notificationTriggersAsStrings()The alarm states that trigger a notification.Integerperiod()The period, in seconds, over which the statistic is applied.ResourceTyperesourceType()The Lightsail resource type of the alarm.StringresourceTypeAsString()The Lightsail resource type of the alarm.List<SdkField<?>>sdkFields()static Class<? extends Alarm.Builder>serializableBuilderClass()AlarmStatestate()The current state of the alarm.StringstateAsString()The current state of the alarm.MetricStatisticstatistic()The statistic for the metric associated with the alarm.StringstatisticAsString()The statistic for the metric associated with the alarm.StringsupportCode()The support code.Doublethreshold()The value against which the specified statistic is compared.Alarm.BuildertoBuilder()StringtoString()Returns a string representation of this object.TreatMissingDatatreatMissingData()Specifies how the alarm handles missing data points.StringtreatMissingDataAsString()Specifies how the alarm handles missing data points.MetricUnitunit()The unit of the metric associated with the alarm.StringunitAsString()The unit of the metric associated with the alarm.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
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.
-
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,
resourceTypewill returnResourceType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromresourceTypeAsString().- Returns:
- The Lightsail resource type of the alarm.
- See Also:
ResourceType
-
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,
resourceTypewill returnResourceType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromresourceTypeAsString().- Returns:
- The Lightsail resource type of the alarm.
- See Also:
ResourceType
-
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,
comparisonOperatorwill returnComparisonOperator.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromcomparisonOperatorAsString().- Returns:
- The arithmetic operation used when comparing the specified statistic and threshold.
- See Also:
ComparisonOperator
-
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,
comparisonOperatorwill returnComparisonOperator.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromcomparisonOperatorAsString().- Returns:
- The arithmetic operation used when comparing the specified statistic and threshold.
- See Also:
ComparisonOperator
-
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,
treatMissingDatawill returnTreatMissingData.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromtreatMissingDataAsString().- 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,
treatMissingDatawill returnTreatMissingData.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromtreatMissingDataAsString().- 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,
statisticwill returnMetricStatistic.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromstatisticAsString().- 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,
statisticwill returnMetricStatistic.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromstatisticAsString().- 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
-
-
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,
metricNamewill returnMetricName.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available frommetricNameAsString().- Returns:
- The name of the metric associated with the alarm.
- See Also:
MetricName
-
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,
metricNamewill returnMetricName.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available frommetricNameAsString().- 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,
statewill returnAlarmState.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromstateAsString().- 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,
statewill returnAlarmState.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromstateAsString().- 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,
unitwill returnMetricUnit.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromunitAsString().- 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,
unitwill returnMetricUnit.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromunitAsString().- 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 theisEmpty()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 theisEmpty()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()
- Specified by:
toBuilderin interfaceToCopyableBuilder<Alarm.Builder,Alarm>
-
builder
public static Alarm.Builder builder()
-
serializableBuilderClass
public static Class<? extends Alarm.Builder> serializableBuilderClass()
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFieldsin interfaceSdkPojo
-
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.
-
-