@Generated(value="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.
| Modifier and Type | Class and Description |
|---|---|
static interface |
Alarm.Builder |
| Modifier and Type | Method and Description |
|---|---|
String |
arn()
The Amazon Resource Name (ARN) of the alarm.
|
static Alarm.Builder |
builder() |
ComparisonOperator |
comparisonOperator()
The arithmetic operation used when comparing the specified statistic and threshold.
|
String |
comparisonOperatorAsString()
The arithmetic operation used when comparing the specified statistic and threshold.
|
List<ContactProtocol> |
contactProtocols()
The contact protocols for the alarm, such as
Email, SMS (text messaging), or both. |
List<String> |
contactProtocolsAsStrings()
The contact protocols for the alarm, such as
Email, SMS (text messaging), or both. |
Instant |
createdAt()
The timestamp when the alarm was created.
|
Integer |
datapointsToAlarm()
The number of data points that must not within the specified threshold to trigger the alarm.
|
boolean |
equals(Object obj) |
boolean |
equalsBySdkFields(Object obj) |
Integer |
evaluationPeriods()
The number of periods over which data is compared to the specified threshold.
|
<T> Optional<T> |
getValueForField(String fieldName,
Class<T> clazz) |
boolean |
hasContactProtocols()
For responses, this returns true if the service returned a value for the ContactProtocols property.
|
int |
hashCode() |
boolean |
hasNotificationTriggers()
For responses, this returns true if the service returned a value for the NotificationTriggers property.
|
ResourceLocation |
location()
An object that lists information about the location of the alarm.
|
MetricName |
metricName()
The name of the metric associated with the alarm.
|
String |
metricNameAsString()
The name of the metric associated with the alarm.
|
MonitoredResourceInfo |
monitoredResourceInfo()
An object that lists information about the resource monitored by the alarm.
|
String |
name()
The name of the alarm.
|
Boolean |
notificationEnabled()
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.
|
Integer |
period()
The period, in seconds, over which the statistic is applied.
|
ResourceType |
resourceType()
The Lightsail resource type (e.g.,
Alarm). |
String |
resourceTypeAsString()
The Lightsail resource type (e.g.,
Alarm). |
List<SdkField<?>> |
sdkFields() |
static Class<? extends Alarm.Builder> |
serializableBuilderClass() |
AlarmState |
state()
The current state of the alarm.
|
String |
stateAsString()
The current state of the alarm.
|
MetricStatistic |
statistic()
The statistic for the metric associated with the alarm.
|
String |
statisticAsString()
The statistic for the metric associated with the alarm.
|
String |
supportCode()
The support code.
|
Double |
threshold()
The value against which the specified statistic is compared.
|
Alarm.Builder |
toBuilder() |
String |
toString()
Returns a string representation of this object.
|
TreatMissingData |
treatMissingData()
Specifies how the alarm handles missing data points.
|
String |
treatMissingDataAsString()
Specifies how the alarm handles missing data points.
|
MetricUnit |
unit()
The unit of the metric associated with the alarm.
|
String |
unitAsString()
The unit of the metric associated with the alarm.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcopypublic final String name()
The name of the alarm.
public final String arn()
The Amazon Resource Name (ARN) of the alarm.
public final Instant createdAt()
The timestamp when the alarm was created.
public final ResourceLocation location()
An object that lists information about the location of the alarm.
public final ResourceType resourceType()
The Lightsail resource type (e.g., 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().
Alarm).ResourceTypepublic final String resourceTypeAsString()
The Lightsail resource type (e.g., 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().
Alarm).ResourceTypepublic 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.
public final MonitoredResourceInfo monitoredResourceInfo()
An object that lists information about the resource monitored by the alarm.
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().
ComparisonOperatorpublic 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().
ComparisonOperatorpublic final Integer evaluationPeriods()
The number of periods over which data is compared to the specified threshold.
public final Integer period()
The period, in seconds, over which the statistic is applied.
public final Double threshold()
The value against which the specified statistic is compared.
public final Integer datapointsToAlarm()
The number of data points that must not within the specified threshold to trigger the alarm.
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().
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.
TreatMissingDatapublic 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().
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.
TreatMissingDatapublic 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().
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.
MetricStatisticpublic 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().
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.
MetricStatisticpublic 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().
MetricNamepublic 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().
MetricNamepublic 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().
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.
AlarmStatepublic 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().
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.
AlarmStatepublic 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().
MetricUnitpublic 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().
MetricUnitpublic 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.
Email, SMS (text messaging), or
both.public final boolean hasContactProtocols()
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.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.
Email, SMS (text messaging), or
both.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.
public final boolean hasNotificationTriggers()
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.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.
public final Boolean notificationEnabled()
Indicates whether the alarm is enabled.
public Alarm.Builder toBuilder()
toBuilder in interface ToCopyableBuilder<Alarm.Builder,Alarm>public static Alarm.Builder builder()
public static Class<? extends Alarm.Builder> serializableBuilderClass()
public final boolean equalsBySdkFields(Object obj)
equalsBySdkFields in interface SdkPojopublic final String toString()
Copyright © 2023. All rights reserved.