CloudWatch.Metric.
alarms
¶A collection of Alarm resources.A Alarm Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources.
all
()¶Creates an iterable of all Alarm resources in the collection.
See also: AWS API Documentation
Request Syntax
alarm_iterator = metric.alarms.all()
cloudwatch.Alarm
)delete
()¶Deletes the specified alarms. You can delete up to 100 alarms in one operation. However, this total can include no more than one composite alarm. For example, you could delete 99 metric alarms and one composite alarms with one operation, but you can't delete two composite alarms with one operation.
In the event of an error, no alarms are deleted.
Note
It is possible to create a loop or cycle of composite alarms, where composite alarm A depends on composite alarm B, and composite alarm B also depends on composite alarm A. In this scenario, you can't delete any composite alarm that is part of the cycle because there is always still a composite alarm that depends on that alarm that you want to delete.
To get out of such a situation, you must break the cycle by changing the rule of one of the composite alarms in the cycle to remove a dependency that creates the cycle. The simplest change to make to break a cycle is to change the AlarmRule
of one of the alarms to false
.
Additionally, the evaluation of composite alarms stops if CloudWatch detects a cycle in the evaluation path.
See also: AWS API Documentation
Request Syntax
response = metric.alarms.delete()
disable_actions
()¶Disables the actions for the specified alarms. When an alarm's actions are disabled, the alarm actions do not execute when the alarm state changes.
See also: AWS API Documentation
Request Syntax
response = metric.alarms.disable_actions()
enable_actions
()¶Enables the actions for the specified alarms.
See also: AWS API Documentation
Request Syntax
response = metric.alarms.enable_actions()
filter
(**kwargs)¶Creates an iterable of all Alarm resources in the collection filtered by kwargs passed to method. A Alarm collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources.
See also: AWS API Documentation
Request Syntax
alarm_iterator = metric.alarms.filter(
Statistic='SampleCount'|'Average'|'Sum'|'Minimum'|'Maximum',
ExtendedStatistic='string',
Dimensions=[
{
'Name': 'string',
'Value': 'string'
},
],
Period=123,
Unit='Seconds'|'Microseconds'|'Milliseconds'|'Bytes'|'Kilobytes'|'Megabytes'|'Gigabytes'|'Terabytes'|'Bits'|'Kilobits'|'Megabits'|'Gigabits'|'Terabits'|'Percent'|'Count'|'Bytes/Second'|'Kilobytes/Second'|'Megabytes/Second'|'Gigabytes/Second'|'Terabytes/Second'|'Bits/Second'|'Kilobits/Second'|'Megabits/Second'|'Gigabits/Second'|'Terabits/Second'|'Count/Second'|'None'
)
ExtendedStatistics
.The dimensions associated with the metric. If the metric has any associated dimensions, you must specify them in order for the call to succeed.
A dimension is a name/value pair that is part of the identity of a metric. Because dimensions are part of the unique identifier for a metric, whenever you add a unique name/value pair to one of your metrics, you are creating a new variation of that metric. For example, many Amazon EC2 metrics publish InstanceId
as a dimension name, and the actual instance ID as the value for that dimension.
You can assign up to 30 dimensions to a metric.
The name of the dimension. Dimension names must contain only ASCII characters, must include at least one non-whitespace character, and cannot start with a colon ( :
).
The value of the dimension. Dimension values must contain only ASCII characters and must include at least one non-whitespace character.
list(cloudwatch.Alarm
)
A list of Alarm resources
limit
(**kwargs)¶Creates an iterable up to a specified amount of Alarm resources in the collection.
See also: AWS API Documentation
Request Syntax
alarm_iterator = metric.alarms.limit(
count=123
)
cloudwatch.Alarm
)page_size
(**kwargs)¶Creates an iterable of all Alarm resources in the collection, but limits the number of items returned by each service call by the specified amount.
See also: AWS API Documentation
Request Syntax
alarm_iterator = metric.alarms.page_size(
count=123
)
cloudwatch.Alarm
)