获取资源的标签列表。
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | ListTagsForResources | 接口名称。当前 API 的名称为 ListTagsForResources 。 |
Version | String | 是 | 2021-03-03 | 接口版本。当前 API 的版本为 2021-03-03 。 |
TagFilters | Array of TagFilter | 否 | - | 标签过滤条件。 |
ResourceType | String | 是 | Workspace | 资源类型,当前仅支持Workspace ,即工作区。 |
ResourceIds | Array of String | 否 | ["e28ae750-bbb8-4ff4-abf4-1e0e0f88808c"] | 资源 ID。 |
NextToken | String | 否 | 1 | 当前页数,最小值或默认值均为 1。 |
MaxResults | Long | 否 | 10 | 单页数量:
|
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Key | String | 是 | doc | 标签的 Key。 |
Values | Array of String | 否 | demo | 标签的 Vlaue。 |
POST https://open.volcengineapi.com/?Action=ListTagsForResources&Version=2021-03-03 Content-Type: application/json { "ResourceType": "Workspace", "ResourceIds": [ "e28ae750-bbb8-4ff4-abf4-1e0e0f88808c" ], "TagFilters": [ { "Key": "doc", "Values": [ "demo" ] } ], "NextToken": "1", "MaxResults": 10 }
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
NextToken | String | 1 | 当前页数,最小值或默认值均为 1。 |
ResourceTags | Array of ResourceTag | - | 符合筛选条件的资源和标签。 |
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
TagKey | String | doc | 标签的 Key。 |
TagValue | String | demo | 标签的 Value。 |
ResourceID | String | ["e28ae750-bbb8-4ff4-abf4-1e0e0f88808c"] | 资源 ID。 |
ResourceType | String | workspace | 资源类型,当前仅支持workspace ,即工作区。 |
HTTP/1.1: 200 OK Content-Type: application/json { "ResponseMetadata": { "RequestId": "20230604110420****100232280022D31", "Action": "ListTagsForResources", "Version": "2021-03-03", "Service": "vmp", "Region": "cn-north-1" }, "Result": { "NextToken": "1", "ResourceTags": [ { "TagKey": "doc", "TagValue": "demo", "ResourceID": "["e28ae750-bbb8-4ff4-abf4-1e0e0f88808c"]", "ResourceType": "workspace" } ] } }
本接口错误码如下表所示,公共错误码请参见 公共错误码。
HTTP 状态码 | 错误码 | 错误信息 | 说明 |
---|---|---|---|
403 | ProductUnsubscribed | You are not subscribed to the Volcengine Managed Service for Prometheus (VMP). Please go to the VMP console web page to subscribe to the service | 当前账号未订阅 VMP 服务。 |
400 | InvalidParameter.{{parameter}} | The specified parameter {{parameter}} is invalid. | 输入不合法,如工作区名称不合法等。 |
400 | MissingParameter.{{parameter}} | The required parameter {{parameter}} is missing. | 缺少必要的参数。 |