阿里云如何綁定標(biāo)簽
來源:技術(shù)員聯(lián)盟┆發(fā)布時(shí)間:2017-05-02 09:53┆點(diǎn)擊:
Tag 容許被創(chuàng)建在 ECS 的實(shí)例、磁盤、快照、鏡像、安全組上。
每個(gè)資源最多可以綁定 10 個(gè) Tag。
如果要綁定 Tag 的 Key 在指定的資源上已經(jīng)存在,則覆蓋 Value。
Tag.n.Key 與 Tag.n.Value 必須一一匹配。
請(qǐng)求參數(shù)
名稱
類型
是否必須
描述
Action
String
是
操作接口名,AddTags。
RegionId
String
是
資源所屬地域。
ResourceId
String
是
要?jiǎng)?chuàng)建 Tag 的資源 ID。
ResourceType
String
是
資源類型:
image
instance
snapshot
disk
securitygroup
所有值均為小寫。
Tag.n.Key
String
是
標(biāo)簽 key,n 從 1 開始,最大為 5。
最多支持 64 個(gè)字符
不支持 aliyun 開頭
不支持 和 https:// 開頭
不允許為空字符串。
Tag.n.Value
String
是
標(biāo)簽 value,n 從 1 開始,最大為 5。
最多支持 128 個(gè)字符
不支持 aliyun 開頭
不支持 和 https:// 開頭
允許為空字符串。
返回參數(shù)
名稱
類型
描述
RequestId
String
請(qǐng)求 ID
錯(cuò)誤碼
錯(cuò)誤代碼
描述
Http狀態(tài)碼
語義
MissingParameter
The input parameter "ResourceId" that is mandatory for processing this request is not supplied.
400
ResourceId 參數(shù)未指定
InvalidResourceId.NotFound
The specified ResourceId is not found in our records
404
指定的 ResourceId 不存在
MissingParameter
The input parameter "RegionId" that is mandatory for processing this request is not supplied.
400
RegionId 參數(shù)未指定
InvalidRegionId.NotFound
The RegionId provided does not exist in our records.
404
指定的 RegionId 不存在
MissingParameter
The input parameter "ResourceType" that is mandatory for processing this request is not supplied.
400
ResourceType 參數(shù)未指定
InvalidResourceType.NotFound
The ResourceType provided does not exist in our records.
404
指定的 ResourceType 不存在
MissingParameter.TagKey
The input parameter "Tag.n.Key" that is mandatory for processing this request is not supplied.
400
Tag.n.Key 參數(shù)未指定
InvalidTagKey.Malformed
The specified Tag.n.Key is not valid
400
指定的 Tag.n.Key 不合法
MissingParameter.TagValue
The input parameter "Tag.n.Value" that is mandatory for processing this request is not supplied.
400
Tag.n.Value 參數(shù)未指定
InvalidTagValue.Malformed
The specified Tag.n.Value is not valid
400
指定的 Tag.n.Value 不合法
OperationDenied.QuotaExceed
The quota of tags on resource is beyond permitted range
400
資源上的用戶 Tag 已經(jīng)超過 10 個(gè)
InvalidTag.Mismatch
The specified Tag.n.Key and Tag.n.Value are not match
400
Tag.n.Key 和 Tag.n.Value 沒有一一對(duì)應(yīng)
InvalidTagCount
The specified tags are beyond the permitted range
400
指定的 Tag 數(shù)超過了 5 個(gè)
InvalidResourceId.NotSupported
The specified ResourceId does not support tagging
403
指定的資源 ID 不支持打 Tag
示例
請(qǐng)求示例
https://ecs.aliyuncs.com/?Action=AddTags
&ResourceId=s-946ntx4wr
&ResourceType=snapshot
&RegionId=cn-shenzhen
&Tag.1.Key=test
&Tag.1.Value=api
&<公共請(qǐng)求參數(shù)>
返回示例
