为资源添加标签。
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | TagResources | 接口名称。当前 API 的名称为 TagResources 。 |
Version | String | 是 | 2021-03-03 | 接口版本。当前 API 的版本为 2021-03-03 。 |
ResourceType | String | 是 | Workspace | 添加标签的资源类型,当前仅支持Workspace ,即工作区。 |
ResourceIds | Array of String | 是 | ["e28ae750-bbb8-4ff4-abf4-1e0e0f88808c"] | 增加标签的资源 ID 列表。 |
Tags | Array of Tag | 是 | - | 资源标签。 |
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Key | String | 否 | doc | 标签的 Key。 |
Values | Array of String | 否 | demo | 标签的 Value。 |
POST https://open.volcengineapi.com/?Action=TagResources&Version=2021-03-03 Content-Type: application/json { "ResourceType": "Workspace", "ResourceIds": [ "e28ae750-bbb8-4ff4-abf4-1e0e0f88808c" ], "Tags": [ { "Key": "doc", "Values": [ "demo" ] } ] }
无
HTTP/1.1: 200 OK Content-Type: application/json { "ResponseMetadata": { "RequestId": "20230604110420****100232280022D31", "Action": "TagResources", "Version": "2021-03-03", "Service": "vmp", "Region": "cn-north-1" } }
本接口错误码如下表所示,公共错误码请参见 公共错误码。
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. | 缺少必要的参数。 |