Describes one or more of your available tags. You can set criteria to match tags, such as by specifying the ECS resource types, resource IDs, tag keys, or tag values. We use the AND (&&) operator for your conditions and return a specific list of results from your operation.


In particular, if a tag key (Tag.n.Key) is specified, but no tag value (Tag.n.Value) is specified, all tags related to the tag-key are queried. If the tag key-value is specified, tag that exactly matches the queried key-value.

Request parameters

Name Type Required Description
Action String Yes The name of this interface. Value: DescribeTags.
RegionId String Yes Regional ID. For more information, call DescribeRegions to obtain the latest region list.
ResourceType String Yes The type of the ECS resource. Optional values:
  • disk
  • instance
  • image
  • securitygroup
  • snapshot
Values are case-sensitive.
ResourceId String No The resource ID. For example, if you set the ResourceType to instance, the ResourceId the ResourceId can be interpreted as InstanceId.
Tag.n.Key String No The tag key where n ranges from 1 to 5.
Tag.n.Value String No The tag value where n ranges from 1 to 5.
PageNumber Integer No

Displays the tags on several pages. 

Initial value: 1.

Default value: 1.

PageSize Integer No

The maximum entries on a page.

Maximum: 100.

Default: 50.

Response parameters

Name Type Description
Tags TagSetItem Returns a specific list of tags.
TotalCount Integer The total number of tags.
PageSize Integer The maximum entries on a page.
PageNumber Integer Displays the tags on several pages.


Request example
&Tag. 1. Key=test
&Tag. 1. Value=api
&<Common Request Parameters>
Response example

XML format

JSON format
  "PageNumber": 1,
  "PageSize": 50,
  "RequestId": "B04B8CF3-4489-432D-83BA-6F128E4F2295",
  "Tags": {
    "Tag": [
        "TagKey": "test",
        "TagValue": "api"
  "TotalCount": 1

Error codes

Error codes specific to this interface are as follows. For more error codes, see API Error Center.

Error code Error message HTTP status code  Meaning
invalidTagKey.Malformed The parameter Tag.n.Key is illegal. 400 The specified Tag.n.Key is invalid.
InvalidTagValue.Malformed The parameter Tag.n.Value is illegal. 400 The specified Tag.n.Value is invalid.
InvalidRegionId.NotFound The RegionId provided does not exist in our records. 404 The specified RegionId does not exist.
InvalidResourceType.NotFound The ResourceType provided does not exist in our records. 404 The specified ResourceType does not exist.