云主机绑定标签

本页目录

https://www.cloudam.cn/vps/cvmresource/tags?regionId={REGION_ID}&accountId={ACCOUNT_ID}&provider={PROVIDER}

请求方式:POST

云主机绑定标签

URL Parameters

ParameterTypeDescription
providerString云厂商,目前仅支持京东云
Example: jdcloud
regionIdString地域id
Example: cn-east-2
ACCOUNT_IDString你的Cloudam账户ID, Cloudam会随Token一起提前发送给客户
Example: demoaccount

Body Attributes(Body属性)

AttributeTypeDescription
ipAddressesArray云主机IP列表
tagsArray标签列表
tags.keyString标签键
tags.valueString标签值

Request(请求)

Headers(HTTP头) 注: 请首先联系Cloudam获取API Token,token相当于密码,请妥善保护。

{
"Authorization": "Bearer ${token}",
"Content-Type": "application/json"
}

Body(请求体JSON)

{
"ipAddresses": [
"114.67.81.105"
],
"tags": [
{
"key": "foo",
"value": "bar"
},
{
"key": "group",
"value": "test"
}
]
}

Response(响应) - 200

Headers(响应头)

{
"Content-Type": "application/json"
}

Body(响应体JSON) -- 正确响应

{
"errorCode": "",
"success": true
}

Response Body Attributes(响应Body属性)

AttributeTypeDescription
successboolean执行成功则返回true,失败则返回false
errorCodeStringUser.NotAllowed:用户Token无效或过期;参数错误