Describes the specified tags.
You can use filters to limit the results. For example, you can query for the tags for a specific Auto Scaling group. You can specify multiple values for a filter. A tag must match at least one of the specified values for it to be included in the results.
You can also specify multiple filters. The result includes information for a particular tag only if it matches all the filters. If there's no match, no special message is returned.
For more information, see Tag Auto Scaling groups and instances in the Amazon EC2 Auto Scaling User Guide.
Parameters:
-
filters
(Optional[Filters], default:
None
)
–
One or more filters to scope the tags to return. The maximum number of filters per filter type (for example, auto-scaling-group) is 1000.
-
next_token
(Optional[XmlString], default:
None
)
–
The token for the next set of items to return. (You received this token from a previous call.)
-
max_records
(Optional[MaxRecords], default:
None
)
–
The maximum number of items to return with this call. The default value is 50 and the maximum value is 100.
Raises:
-
InvalidNextToken
–
The NextToken value is not valid.
-
ResourceContentionFault
–
You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, instance, or load balancer).
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
To describe tags
This example describes the tags for the specified Auto Scaling group.
>>> await client.describe_tags(filters=[{'Values': ['my-auto-scaling-group'], 'Name': 'auto-scaling-group'}])
Source code in docs_src/capo_auto_scaling/_services/async_auto_scaling.py
| async def describe_tags(
self,
*,
config_overrides: Optional[AsyncAutoScalingClientConfig] = None,
filters: Optional["capo_auto_scaling.types.filters.Filters"] = None,
next_token: Optional["capo_auto_scaling.types.xml_string.XmlString"] = None,
max_records: Optional["capo_auto_scaling.types.max_records.MaxRecords"] = None,
) -> "capo_auto_scaling.types.tags_type.TagsType":
"""<p>Describes the specified tags.</p> <p>You can use filters to limit the results. For example, you can query for the tags for a specific Auto Scaling group. You can specify multiple values for a filter. A tag must match at least one of the specified values for it to be included in the results.</p> <p>You can also specify multiple filters. The result includes information for a particular tag only if it matches all the filters. If there's no match, no special message is returned.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-tagging.html">Tag Auto Scaling groups and instances</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>
Args:
filters: <p>One or more filters to scope the tags to return. The maximum number of filters per filter type (for example, <code>auto-scaling-group</code>) is 1000.</p>
next_token: <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
max_records: <p>The maximum number of items to return with this call. The default value is <code>50</code> and the maximum value is <code>100</code>.</p>
Raises:
capo_auto_scaling.errors.invalid_next_token.InvalidNextToken: <p>The <code>NextToken</code> value is not valid.</p>
capo_auto_scaling.errors.resource_contention_fault.ResourceContentionFault: <p>You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, instance, or load balancer).</p>
capo_auto_scaling.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To describe tags
This example describes the tags for the specified Auto Scaling group.
>>> await client.describe_tags(filters=[{'Values': ['my-auto-scaling-group'], 'Name': 'auto-scaling-group'}])
"""
async def _handler(
req: "AsyncOperationRequest[capo_auto_scaling.types.describe_tags_type.DescribeTagsType]",
) -> AsyncOperationResponse["capo_auto_scaling.types.tags_type.TagsType"]:
import capo_auto_scaling._operations.auto_scaling_2011_01_01.describe_tags
(
output,
http_response,
) = await capo_auto_scaling._operations.auto_scaling_2011_01_01.describe_tags.async_describe_tags(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DescribeTags")
)
input_: capo_auto_scaling.types.describe_tags_type.DescribeTagsType = {}
if filters is not None:
input_["filters"] = filters
if next_token is not None:
input_["next_token"] = next_token
if max_records is not None:
input_["max_records"] = max_records
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|