全部产品
Search
文档中心

云服务器 ECS:UntagResources

更新时间:Sep 13, 2023

调用UntagResources为指定的ECS资源列表统一解绑标签。解绑后,如果该标签没有绑定其他任何资源,会被自动删除。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称

类型

是否必选

示例值

描述

Action String UntagResources

系统规定参数。取值:UntagResources

RegionId String cn-hangzhou

资源所属的地域ID。您可以调用DescribeRegions查看最新的阿里云地域列表。

ResourceType String instance

资源类型定义。取值范围:

  • instance:ECS实例。
  • disk:磁盘。
  • snapshot:快照。
  • image:镜像。
  • securitygroup:安全组。
  • volume:存储卷。
  • eni:弹性网卡。
  • ddh:专有宿主机。
  • ddhcluster:专有宿主机集群。
  • keypair:SSH密钥对。
  • launchtemplate:启动模板。
  • reservedinstance:预留实例券。
  • snapshotpolicy:自动快照策略。
  • elasticityassurance:弹性保障。
  • capacityreservation:容量预定。
  • command:云助手命令。
  • invocation:云助手命令执行或文件下发结果。
  • activation:云助手托管实例激活码。
  • managedinstance:云助手托管实例。
All Boolean false

是否解绑资源上全部的标签。当请求中未设置TagKey.N时,该参数才有效。取值范围:

  • true:解绑。
  • false:不解绑。

默认值:false。

ResourceId.N String i-bp67acfmxazb4ph****

资源ID。

TagKey.N String TestKey

资源的标签键。

返回数据

名称

类型

示例值

描述

RequestId String C46FF5A8-C5F0-4024-8262-B16B639225A0

请求ID。

示例

请求示例

https://ecs.aliyuncs.com/?Action=UntagResources
&RegionId=cn-hangzhou
&ResourceType=instance
&ResourceId.1=i-bp1j6qtvdm8w0z1o0****
&TagKey.1=TestKey
&<公共请求参数>

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<UntagResourcesResponse>
    <RequestId>C46FF5A8-C5F0-4024-8262-B16B639225A0</RequestId>
</UntagResourcesResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "C46FF5A8-C5F0-4024-8262-B16B639225A0"
}

错误码

HttpCode

错误码

错误信息

描述

400 Duplicate.TagKey The Tag.N.Key contain duplicate key. 标签中存在重复的键,请保持键的唯一性。
400 InvalidTagKey.Malformed The specified Tag.n.Key is not valid. 指定的标签键参数有误。
400 InvalidTagValue.Malformed The specified Tag.n.Value is not valid. 指定的标签值参数有误。
400 OperationDenied.QuotaExceed The quota of tags on resource is beyond permitted range. 资源标签已达上限。
400 InvalidTag.Mismatch The specified Tag.n.Key and Tag.n.Value are not match. 指定的 Tag.N.Key 和 Tag.N.Value 不匹配。
400 InvalidTagCount The specified tags are beyond the permitted range. 指定的标记超出取值范围。
400 Invalid.Scope The specified scope is invalid. 可见范围参数无效。
403 PermissionDenied.TagOwnerUid The specified operator not have permission to set TagOwnerUid value. 无权设置标签归属者。
403 PermissionDenied.Scope The specified operator not have permission to set Scope value. 指定的操作员无权设置范围值。
403 InvalidResourceId.NotSupported The specified ResourceId does not support tagging. 指定的资源 ID 不支持标记。
403 NoPermission.Tag The operator is not permission for the tag. 您没有操作该资源标签的权限。
404 InvalidRegionId.NotFound %s 提供的地域 ID 不存在。
404 MissingParameter.TagOwnerUid The parameter - TagOwnerUid should not be null 参数 TagOwnerUid 不能为空。
404 MissingParameter.TagOwnerBid The parameter - TagOwnerBid should not be null 参数 TagOwnerBid 不能为空。
404 MissingParameter.Tags The parameter - Tags should not be null 参数 Tags 不能为空。
404 MissingParameter.RegionId The parameter - RegionId should not be null 参数 RegionId 不能为空。
404 InvalidResourceId.NotFound The specified ResourceIds are not found in our records. 指定的资源不存在,请检查参数 ResourceId 是否正确。
404 InvalidResourceType.NotFound The ResourceType provided does not exist in our records. 指定的资源类型不存在。
404 InvalidRegionId.NotFound The specified RegionId does not exist. 指定的地域 ID 不存在。

访问错误中心查看更多错误码。