CloudWatch.ServiceResource.
metrics
¶A collection of Metric resources.A Metric 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 Metric resources in the collection.
See also: AWS API Documentation
Request Syntax
metric_iterator = cloudwatch.metrics.all()
cloudwatch.Metric
)filter
(**kwargs)¶Creates an iterable of all Metric resources in the collection filtered by kwargs passed to method. A Metric 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
metric_iterator = cloudwatch.metrics.filter(
Namespace='string',
MetricName='string',
Dimensions=[
{
'Name': 'string',
'Value': 'string'
},
],
NextToken='string',
RecentlyActive='PT3H',
IncludeLinkedAccounts=True|False,
OwningAccount='string'
)
The dimensions to filter against. Only the dimensions that match exactly will be returned.
Represents filters for a dimension.
The dimension name to be matched.
The value of the dimension to be matched.
To filter the results to show only metrics that have had data points published in the past three hours, specify this parameter with a value of PT3H
. This is the only valid value for this parameter.
The results that are returned are an approximation of the value you specify. There is a low probability that the returned results include metrics with last published data as much as 40 minutes more than the specified time interval.
If you are using this operation in a monitoring account, specify true
to include metrics from source accounts in the returned data.
The default is false
.
true
for IncludeLinkedAccounts
.list(cloudwatch.Metric
)
A list of Metric resources
limit
(**kwargs)¶Creates an iterable up to a specified amount of Metric resources in the collection.
See also: AWS API Documentation
Request Syntax
metric_iterator = cloudwatch.metrics.limit(
count=123
)
cloudwatch.Metric
)page_size
(**kwargs)¶Creates an iterable of all Metric 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
metric_iterator = cloudwatch.metrics.page_size(
count=123
)
cloudwatch.Metric
)