Class Alarm
- All Implemented Interfaces:
Serializable
,SdkPojo
,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:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal String
arn()
The Amazon Resource Name (ARN) of the alarm.static Alarm.Builder
builder()
final ComparisonOperator
The arithmetic operation used when comparing the specified statistic and threshold.final String
The arithmetic operation used when comparing the specified statistic and threshold.final List
<ContactProtocol> The contact protocols for the alarm, such asEmail
,SMS
(text messaging), or both.The contact protocols for the alarm, such asEmail
,SMS
(text messaging), or both.final Instant
The timestamp when the alarm was created.final Integer
The number of data points that must not within the specified threshold to trigger the alarm.final boolean
final boolean
equalsBySdkFields
(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.final Integer
The number of periods over which data is compared to the specified threshold.final <T> Optional
<T> getValueForField
(String fieldName, Class<T> clazz) final boolean
For responses, this returns true if the service returned a value for the ContactProtocols property.final int
hashCode()
final boolean
For responses, this returns true if the service returned a value for the NotificationTriggers property.final ResourceLocation
location()
An object that lists information about the location of the alarm.final MetricName
The name of the metric associated with the alarm.final String
The name of the metric associated with the alarm.final MonitoredResourceInfo
An object that lists information about the resource monitored by the alarm.final String
name()
The name of the alarm.final Boolean
Indicates whether the alarm is enabled.final List
<AlarmState> The alarm states that trigger a notification.The alarm states that trigger a notification.final Integer
period()
The period, in seconds, over which the statistic is applied.final ResourceType
The Lightsail resource type of the alarm.final String
The Lightsail resource type of the alarm.static Class
<? extends Alarm.Builder> final AlarmState
state()
The current state of the alarm.final String
The current state of the alarm.final MetricStatistic
The statistic for the metric associated with the alarm.final String
The statistic for the metric associated with the alarm.final String
The support code.final Double
The value against which the specified statistic is compared.Take this object and create a builder that contains all of the current property values of this object.final String
toString()
Returns a string representation of this object.final TreatMissingData
Specifies how the alarm handles missing data points.final String
Specifies how the alarm handles missing data points.final MetricUnit
unit()
The unit of the metric associated with the alarm.final String
The unit of the metric associated with the alarm.Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
name
The name of the alarm.
- Returns:
- The name of the alarm.
-
arn
The Amazon Resource Name (ARN) of the alarm.
- Returns:
- The Amazon Resource Name (ARN) of the alarm.
-
createdAt
The timestamp when the alarm was created.
- Returns:
- The timestamp when the alarm was created.
-
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
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 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:
-
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 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:
-
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
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
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 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:
-
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 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:
-
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
The period, in seconds, over which the statistic is applied.
- Returns:
- The period, in seconds, over which the statistic is applied.
-
threshold
The value against which the specified statistic is compared.
- Returns:
- The value against which the specified statistic is compared.
-
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
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 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:
-
-
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 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:
-
-
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 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:
-
-
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 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:
-
-
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 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:
-
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 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:
-
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 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:
-
-
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 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:
-
-
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 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:
-
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 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:
-
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
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
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
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
Indicates whether the alarm is enabled.
- Returns:
- Indicates whether the alarm is enabled.
-
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 interfaceToCopyableBuilder<Alarm.Builder,
Alarm> - Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
public final int hashCode() -
equals
-
equalsBySdkFields
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 anSdkPojo
class, and is generated based on a service model.If an
SdkPojo
class does not have any inherited fields,equalsBySdkFields
andequals
are essentially the same.- Specified by:
equalsBySdkFields
in interfaceSdkPojo
- Parameters:
obj
- the object to be compared with- Returns:
- true if the other object equals to this object by sdk fields, false otherwise.
-
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. -
getValueForField
-
sdkFields
-