tencent cloud

标签

产品简介
产品概述
产品功能
应用场景
使用限制
支持标签 API 的资源类型
购买指南
快速入门
创建标签并绑定资源
通过标签查询资源
操作指南
创建标签
绑定资源
解绑标签
批量解绑或修改标签
删除标签
查看绑定资源
查询和编辑资源的标签
使用标签管理资源配额
资源标签导出
查询标签修改记录
创建者标签
标签策略
标签列表导出
API文档
History
Introduction
API Category
Making API Requests
Write APIs
Read APIs
Project APIs
Data Types
Error Codes
常见问题
词汇表

GetResources

PDF
聚焦模式
字号
最后更新时间: 2025-10-30 21:56:31

1. API Description

Domain name for API request: tag.intl.tencentcloudapi.com.

This API is used to query the list of resources associated with a tag.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: GetResources.
Version Yes String Common Params. The value used for this API: 2018-08-13.
Region No String Common Params. This parameter is not required for this API.
ResourceList.N No Array of String Six-segment resource description list. Tencent Cloud uses a six-segment value to describe a resource.
For example, ResourceList.1 = qcs::${ServiceType}:${Region}:${Account}:${ResourcePreifx}/${ResourceId}.
If this parameter is passed in, the list of all matching resources will be returned, and the specified MaxResults will become invalid.
Value range of N: 0–9
TagFilters.N No Array of TagFilter Tag key and value.
If multiple tags are specified, resources bound to all such tags will be queried.
Value range of N: 0–5
There can be up to 10 TagValues in each TagFilters.
PaginationToken No String The token value of the next page obtained from the response of the previous page.
Leave it empty for the first request.
MaxResults No Integer Number of data entries to return per page (up to 200).
Default value: 50.

3. Output Parameters

Parameter Name Type Description
PaginationToken String Token value obtained for the next page
ResourceTagMappingList Array of ResourceTagMapping List of resources and their associated tags (key-value pairs)
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Querying resource tag list

Input Example

POST / HTTP/1.1
Host: tag.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: GetResources
<Common request parameters>

{
    "ResourceList": [
        "qcs::cvm:ap-beijing:uin/100000558920:instance/ins-123",
        "qcs::cvm:ap-shanghai:uin/100000558920:instance/ins-345"
    ],
    "TagFilters": [
        {
            "TagKey": "11",
            "TagValue": [
                "11"
            ]
        },
        {
            "TagKey": "22",
            "TagValue": [
                "22"
            ]
        }
    ]
}

Output Example

{
    "Response": {
        "PaginationToken": "",
        "ResourceTagMappingList": [
            {
                "Resource": "qcs::cvm:ap-beijing:uin/100000558920:instance/ins-123",
                "Tags": [
                    {
                        "TagKey": "22",
                        "TagValue": "22"
                    },
                    {
                        "TagKey": "11",
                        "TagValue": "11"
                    }
                ]
            },
            {
                "Resource": "qcs::cvm:ap-shanghai:uin/100000558920:instance/ins-345",
                "Tags": [
                    {
                        "TagKey": "22",
                        "TagValue": "22"
                    },
                    {
                        "TagKey": "11",
                        "TagValue": "11"
                    }
                ]
            }
        ],
        "RequestId": "07cfd251-4ed1-426c-8133-e04a583063c0"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
AuthFailure.UnauthorizedOperation CAM authentication failed.
FailedOperation The operation failed.
FailedOperation.ResourceTagProcessing The resource tag is being processed.
InvalidParameter Incorrect parameter.
InvalidParameter.PaginationTokenInvalid The PaginationToken parameter is invalid.
InvalidParameter.ReservedTagKey System reserved tag keys qcloud, tencent and project cannot be created.
InvalidParameter.Tag Tag parameter error.
InvalidParameterValue.ResourceDescriptionError Resource description error.
InvalidParameterValue.TagKeyDuplicate There are duplicate TagKeys in TagList.
InvalidParameterValue.TagKeyEmpty Tag key cannot be empty.
InvalidParameterValue.TagKeyLengthExceeded Tag key length exceeds limit.
InvalidParameterValue.TagValueCharacterIllegal Tag value contains illegal characters.
InvalidParameterValue.TagValueLengthExceeded Tag value length exceeds limit.
LimitExceeded.ResourceNumPerRequest The number of resources requested at a time reaches the upper limit.
LimitExceeded.TagNumPerRequest The number of tags in a single request exceeds the limit.
LimitExceeded.TagValue Each tag key can have up to 1,000 values.

帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈