为资源批量绑定标签。
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | TagResources | 接口名称。当前 API 的名称为 TagResources 。 |
Version | String | 是 | 2018-01-01 | 接口版本。当前 API 的版本为 2018-01-01 。 |
ResourceIds | Array of String | 否 | ["188906***48"] | 绑定标签的资源列表,当前为告警策略 ID 列表。 |
ResourceType | String | 否 | rule | 绑定标签的资源类型,当前仅支持rule ,即告警策略。 |
Tags | Array of ResourceTag | 否 | - | 与资源绑定的标签详情。 |
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Key | String | 否 | doc | 标签键。
|
Value | String | 否 | demo | 标签值。
|
POST https://open.volcengineapi.com?Action=TagResources&Version=2018-01-01
Content-Type: application/json
{
"ResourceIds": [
"188906***48"
],
"ResourceType": "rule",
"Tags": [
{
"Key": "doc",
"Value": "demo"
}
]
}
json
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Data | Object of TagResourcesResp | - | 返回内容。 |
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
FailedResources | Array of String | ["188906***12"] | 绑定标签失败的资源 ID 列表。仅在请求失败时不为空。 |
SucceedResources | Array of String | ["188906***48"] | 绑定标签成功的资源 ID 列表。 |
{
"ResponseMetadata": {
"Action": "TagResources",
"Region": "cn-beijing",
"Service": "Volc_Observe",
"Version": "2018-01-01",
"RequestId": "20230604110420****100232280022D31"
},
"Result": {
"Data": {
"FailedResources": [
"188906***12"
],
"SucceedResources": [
"188906***48"
]
}
}
}
json
本接口无特有的错误码。更多信息请参见 错误码。