Skip to content

ECS  >  Operations  >  list_attributes

list_attributes

Operation

list_attributes async

list_attributes(input: ListAttributesInput, plugins: list[Plugin] | None = None) -> ListAttributesOutput

Lists the attributes for Amazon ECS resources within a specified target type and cluster. When you specify a target type and cluster, ListAttributes returns a list of attribute objects, one for each attribute on each resource. You can filter the list of results to a single attribute name to only return results that have that name. You can also filter the results by attribute name and value. You can do this, for example, to see which container instances in a cluster are running a Linux AMI (ecs.os-type=linux).

Parameters:

Name Type Description Default
input ListAttributesInput

An instance of ListAttributesInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
ListAttributesOutput

An instance of ListAttributesOutput.

Input

ListAttributesInput dataclass

Bases: _SerdeShape

Dataclass for ListAttributesInput structure.

Attributes

attribute_name class-attribute instance-attribute
attribute_name: str | None = ...

The name of the attribute to filter the results with.

attribute_value class-attribute instance-attribute
attribute_value: str | None = ...

The value of the attribute to filter results with. You must also specify an attribute name to use this parameter.

cluster class-attribute instance-attribute
cluster: str | None = ...

The short name or full Amazon Resource Name (ARN) of the cluster to list attributes. If you do not specify a cluster, the default cluster is assumed.

max_results class-attribute instance-attribute
max_results: int | None = ...

The maximum number of cluster results that ListAttributes returned in paginated output. When this parameter is used, ListAttributes only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another ListAttributes request with the returned nextToken value. This value can be between 1 and 100. If this parameter isn't used, then ListAttributes returns up to 100 results and a nextToken value if applicable.

next_token class-attribute instance-attribute
next_token: str | None = ...

The nextToken value returned from a ListAttributes request indicating that more results are available to fulfill the request and further calls are needed. If maxResults was provided, it's possible the number of results to be fewer than maxResults.

Note

This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.

target_type class-attribute instance-attribute
target_type: str | None = ...

The type of the target to list attributes with.

Output

ListAttributesOutput dataclass

Bases: _SerdeShape

Attributes

attributes class-attribute instance-attribute
attributes: list[Attribute] | None = ...

A list of attribute objects that meet the criteria of the request.

next_token class-attribute instance-attribute
next_token: str | None = ...

The nextToken value to include in a future ListAttributes request. When the results of a ListAttributes request exceed maxResults, this value can be used to retrieve the next page of results. This value is null when there are no more results to return.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.