Queries the list of tags.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer automatically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListTagResources

The operation that you want to perform.

Set the value to ListTagResources.

ResourceType String Yes filesystem

The type of the resource.

Set the value to filesystem.

ResourceId.N RepeatList No 03e08484f0

The ID of the resource N.

The ID of the file system. Valid values of N: 1 to 50.

Tag.N.Key String No nastest

The key of the tag N.

Limits:

  • A tag key cannot be null.
  • Valid values of N: 1 to 20.
  • The tag key can be a maximum of 128 characters in length.
  • The tag key cannot start with aliyun or acs:.
  • The tag key cannot contain http:// or https://.
Tag.N.Value String No filetest

The value of the tag N.

Limits:

  • Valid values of N: 1 to 20.
  • The tag value can be a maximum of 128 characters in length.
  • The tag value cannot start with aliyun or acs:.
  • The tag value cannot contain http:// or https://.
NextToken String No N/A

The token for the next query.

Response parameters

Parameter Type Example Description
NextToken String N/A

The token for the next query. If the value of this parameter is null, no queries are performed after the current query.

RequestId String 2D69A58F-345C-4FDE-88E4-BF518948****

The ID of the request.

TagResources Array of TagResource

The list of resources.

TagResource
ResourceId String i-2zebd226fxed6h4iadhe

The ID of the resource.

ResourceType String filesystem

The type of the resource.

TagKey String test1

The tag key.

TagValue String test

The tag value.

Examples

Sample requests

http(s)://[Endpoint]/? Action=ListTagResources
&ResourceType=filesystem
&<Common request parameters>

Sample success responses

XML format

<ListTagResourcesResponse>
      <RequestId>2D69A58F-345C-4FDE-88E4-BF518948****</RequestId>
      <NextToken>1d2db86sca4384811e0b5e8707e68181f</NextToken>
      <TagResources>
            <TagResource>
                  <ResourceId>i-2zebd226fxed6h4iadhe</ResourceId>
                  <ResourceType>instance</ResourceType>
                  <TagKey>env</TagKey>
                  <TagValue>product</TagValue>
            </TagResource>
            <TagResource>
                  <ResourceId>i-2zebd226fxed6h4iadhe</ResourceId>
                  <ResourceType>instance</ResourceType>
                  <TagKey>owner</TagKey>
                  <TagValue>zhangsan</TagValue>
            </TagResource>
      </TagResources>
</ListTagResourcesResponse>

JSON format

{
    "ListTagResourcesResponse": {
        "RequestId": "2D69A58F-345C-4FDE-88E4-BF518948****",
        "NextToken": "1d2db86sca4384811e0b5e8707e68181f",
        "TagResources": {
            "TagResource": [
                {
                    "ResourceId": "i-2zebd226fxed6h4iadhe",
                    "ResourceType": "instance",
                    "TagKey": "env",
                    "TagValue": "product"
                },
                {
                    "ResourceId": "i-2zebd226fxed6h4iadhe",
                    "ResourceType": "instance",
                    "TagKey": "owner",
                    "TagValue": "zhangsan"
                }
            ]
        }
    }
}

Error codes

HttpCode Error code Error message Description
400 MissingParameter.ResourceIdOrTag Either ResourceId or Tag must be specified. This error message returned because neither of the ResourceId and TagKey parameters is specified.
400 InvalidNextToken The NextToken is invalid. The error message returned because the value of the NextToken parameter is invalid.
400 NumberExceed.ResourceIds The maximum number of ResourceIds is exceeded. The maximum is 50. The error message returned because the number of resource IDs has exceeded the upper limit. You can specify a maximum of 50 resource IDs.
400 MissingParameter.ResourceIds You must specify ResourceIds. The error message returned because the ResourceId parameter is not specified.
400 Duplicate.ResourceId The request contains duplicated ResourceId. The error message returned because the specified resource ID already exists.
400 NumberExceed.Tags The maximum number of Tags is exceeded. The maximum is 20. The error message returned because the number of tags has exceeded the upper limit. You can specify a maximum of 20 tags.
400 Duplicate.TagKey The Tag.N.Key contains a duplicated key. The error message returned because the specified tag key already exists.
400 InvalidResourceId.NotFound The ResourceId does not exist. The error message returned because the specified resource ID does not exist.
400 InvalidParameter.TagKey The specified Tag.n.Key is invalid. The error message returned because the value of the TagKey parameter is invalid.
400 InvalidParameter.TagValue The specified Tag.n.Value is invalid. The error message returned because the value of the TagValue parameter is invalid.

For a list of error codes, visit the API Error Center.