You need to enable JavaScript to run this app.
导航
TagResources
最近更新时间:2025.05.23 14:52:51首次发布时间:2025.05.23 14:52:51
我的收藏
有用
有用
无用
无用

为资源添加标签。

请求说明

  • 请求方式:POST
  • 请求地址:https://open.volcengineapi.com/?Action=TagResources&Version=2021-03-03

请求参数

参数类型是否必选示例值描述
ActionStringTagResources接口名称。当前 API 的名称为 TagResources
VersionString2021-03-03接口版本。当前 API 的版本为 2021-03-03
ResourceTypeStringWorkspace添加标签的资源类型,当前仅支持Workspace,即工作区。
ResourceIdsArray of String["e28ae750-bbb8-4ff4-abf4-1e0e0f88808c"]增加标签的资源 ID 列表。
TagsArray of Tag-资源标签。

Tag

参数类型是否必选示例值描述
KeyStringdoc标签的 Key。
ValuesArray of Stringdemo标签的 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 状态码错误码错误信息说明
403ProductUnsubscribedYou 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 服务。
400InvalidParameter.{{parameter}}The specified parameter {{parameter}} is invalid.输入不合法,如工作区名称不合法等。
400MissingParameter.{{parameter}}The required parameter {{parameter}} is missing.缺少必要的参数。