You need to enable JavaScript to run this app.
导航

ListTagsForResources

最近更新时间2024.04.22 16:36:18

首次发布时间2023.09.13 10:28:05

调用ListTagsForResources接口,查询满足指定条件的标签信息。

调试

请求参数

下表中,TagFilters.N.a类型参数中的“N”表示待查询标签的序号,需按照数字顺序从1开始填写,取值范围为1~10。多个标签之间使用&分隔。

名称
类型是否必选示例值
描述
ActionStringListTagsForResources要执行的操作,取值为ListTagsForResources。
VersionString2020-04-01API版本信息,当前版本为2020-04-01。

ResourceType

String

endpointservice

资源的类型,取值如下:

  • endpointservice:终端节点服务
  • endpoint:接口终端节点
  • gatewayendpoint:网关终端节点

ResourceIds.N

String

ResourceIds.1=epsvc-2fe630gurkl37k5gfuy33****&ResourceIds.2=epsvc-2fe630gurkl58k5gfuy26****

资源的ID。

说明

  • 参数 - N:表示资源 ID的序号,单次调用数量上限50个。
  • 多个资源 ID之间使用&分隔。

TagFilters.N.Key

String

TagFilters.1.Key=k1&TagFilters.2.Key=k2

根据标签查询资源时指定的标签键。
指定多个标签键时,表示查询同时包含所有指定标签键的资源。

TagFilters.N.Values.N

String

TagFilters.1.Value.1=v1&TagFilters.1.Value.2=v2&TagFilters.2.Value.1=v3

根据标签查询资源时指定的标签值。每个标签键最多可指定3个标签值。

  • 未传入该参数时,表示查询指定标签键下所有标签值对应的标签所关联的终端节点或终端节点服务实例。
  • 该参数取值为空时,表示查询指定标签键下标签值为空的标签所关联的终端节点或终端节点服务实例。
  • 同一个标签键指定多个标签值时,表示查询各个标签值对应标签所关联终端节点或终端节点服务实例的集合。

说明

如果传入该参数,则必须先传入TagFilters.N.Key

NextTokenStringcaeba0bbb2be03f84eb48b699f0a****下一次查询开始的Token。
MaxResultsInteger50单次查询的数量,默认为 10,最大为100。

TagType

String

custom

标签类型,取值如下:

  • custom:用户标签。
  • system:系统标签。
  • 该参数可以为空,此时查询全部类型的标签。

返回数据

名称
类型示例值
描述
RequestIdString2021062415303301022514515207C4****请求ID。
NextTokenStringcaeba0bbb2be03f84eb48b699f0a****本次调用返回的查询凭证值,返回为空表示没有下一页。
ResourceTagsArray of Struct-资源及其附加的标签信息。具体参见下表“ResourceTag”。

ResourceTag

名称
类型示例值描述

ResourceType

String

CLB

资源的类型。

  • endpointservice:终端节点服务
  • endpoint:接口终端节点
  • gatewayendpoint:网关终端节点
ResourceIdStringepsvc-2fe6fszjgeznk5oxruv0u****资源的ID。
TagKeyStringk1资源附加标签的标签键。
TagValueStringv1资源附加标签的标签值。

请求示例

GET /?Action=ListTagsForResources&Version=2020-04-01&ResourceType=endpointservice HTTP/1.1
Host: open.volcengineapi.com
Service: privatelink
Region: cn-guangzhou

返回示例

{
    "ResponseMetadata": {
        "RequestId": "2021062415303301022514515207C4****",
        "Action": "ListTagsForResources",
        "Version": "2020-04-01",
        "Service": "privatelink",
        "Region": "cn-guangzhou"
    },
    "Result": {
        "NextToken": "caeba0bbb2be03f84eb48b699f0a****",
        "ResourceTags": [
            {
                "ResourceType": "endpointservice",
                "ResourceId": "epsvc-273w3e33y2y9s7fap8u2j****",
                "TagKey": "k1",
                "TagValue": "v1"
            }
        ]
    }
}

错误码

此处仅展示当前API的错误码,更多错误码请参见公共错误码

HttpCode错误码错误信息描述
HttpCode错误码错误信息描述
------------

400

MissingParameter

The request is missing a required parameter. Ensure that you have supplied all the required parameters for the request; for example, the 'XXX'.

该请求缺少必要参数。请确保发起请求已提供全部必要参数,比如XXX。

说明

其中,XXX表示缺少的参数名称。

400InvalidIncorrectOrder.MalformedThe specified index order is malformed.指定的索引顺序参数格式不合法。
400InvalidMaxResult.MalformedThe specified MaxResult is malformed.指定的 MaxResult 参数格式不合法。
400InvalidNextToken.MalformedThe specified NextToken is malformed.指定的 NextToken 参数格式不合法。
400InvalidResourceType.MalformedThe specified ResourceType is malformed.指定的 ResourceType 参数格式不合法。
400InvalidTagKey.MalformedThe specified TagKey is malformed.指定的 TagKey 参数格式不合法。
400InvalidTagType.MalformedThe specified TagType is malformed.指定的 TagType 参数格式不合法。
400InvalidTagValue.MalformedThe specified TagValue is malformed.指定的 TagValue 参数格式不合法。
400LimitExceeded.ResourceYou've reached the limit on the number of resources that you can operate at a time.已达到单次可操作资源数量的上限。
400LimitExceeded.TagFilterKeyYou've reached the limit on the number of tag keys that you can filter.已达到单次可指定过滤标签键数量的上限。
400LimitExceeded.TagFilterValuesYou've reached the limit on the number of tag values that you can filter.已达到单次可指定过滤标签键值数量的上限。
404InvalidResource.NotFoundThe specified resource does not exist.指定的资源不存在。