技术员联盟提供win764位系统下载,win10,win7,xp,装机纯净版,64位旗舰版,绿色软件,免费软件下载基地!

当前位置:主页 > 教程 > 服务器类 >

阿里云如何绑定标签

来源:技术员联盟┆发布时间:2017-05-02 09:53┆点击:

  Tag 容许被创建在 ECS 的实例、磁盘、快照、镜像、安全组上。

  每个资源最多可以绑定 10 个 Tag。

  如果要绑定 Tag 的 Key 在指定的资源上已经存在,则覆盖 Value。

  Tag.n.Key 与 Tag.n.Value 必须一一匹配。

  请求参数

名称 类型 是否必须 描述
Action   String     操作接口名,AddTags。  
RegionId   String     资源所属地域。  
ResourceId   String     要创建 Tag 的资源 ID。  
ResourceType   String     资源类型:

image

instance

snapshot

disk

securitygroup

所有值均为小写。
 
Tag.n.Key   String     标签 key,n 从 1 开始,最大为 5。
最多支持 64 个字符
不支持 aliyun 开头
不支持 和 https:// 开头
不允许为空字符串。
 
Tag.n.Value   String     标签 value,n 从 1 开始,最大为 5。
最多支持 128 个字符
不支持 aliyun 开头
不支持 和 https:// 开头
允许为空字符串。
 

  返回参数

名称 类型 描述
RequestId   String   请求 ID  

  错误码

错误代码 描述 Http状态码 语义
MissingParameter   The input parameter "ResourceId" that is mandatory for processing this request is not supplied.   400   ResourceId 参数未指定  
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 参数未指定  
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 参数未指定  
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 参数未指定  
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 参数未指定  
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 已经超过 10 个  
InvalidTag.Mismatch   The specified Tag.n.Key and Tag.n.Value are not match   400   Tag.n.Key 和 Tag.n.Value 没有一一对应  
InvalidTagCount   The specified tags are beyond the permitted range   400   指定的 Tag 数超过了 5 个  
InvalidResourceId.NotSupported   The specified ResourceId does not support tagging   403   指定的资源 ID 不支持打 Tag  

  示例

  请求示例

  https://ecs.aliyuncs.com/?Action=AddTags

  &ResourceId=s-946ntx4wr

  &ResourceType=snapshot

  &RegionId=cn-shenzhen

  &Tag.1.Key=test

  &Tag.1.Value=api

  &<公共请求参数>

  返回示例

阿里云如何绑定标签 三联