Removes tags from resources.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

ParameterTypeRequiredExampleDescription
ActionStringYesUntagResources

The operation that you want to perform. Set the value to UntagResources.

RegionIdStringYescn-hangzhou

The region ID of the Classic Load Balancer (CLB) instance.

You can call the DescribeRegions operation to query the most recent region list.

ResourceTypeStringYesinstance

The type of the resource. Valid values:

  • instance: a CLB instance
  • certificate: a certificate
  • acl: an access control list (ACL)
  • listener: a listener
  • vservergroup: a vServer group
  • masterslaveservergroup: a primary/secondary server group
AllBooleanNotrue

Specifies whether to remove all tags from the specified resources. This parameter takes effect only if TagKey.N is not specified.

Valid values: true and false.

ResourceId.NStringNolb-bp16qjewdsunr41m1****

The resource ID. You can specify up to 20 IDs.

Note If you want to specify the ID of a listener, set ResourceId to a value in the LoadBalancerId_Listener protocol_Port format, where LoadBalancerId specifies the ID of the CLB instance, and Port specifies the listener port. Example: lb-bp1snb10sbml4_http_80.
TagKey.NStringNoFinanceDept

The key of tag N to remove from the resource. You can specify up to 20 tag keys. The tag key cannot be an empty string.

The tag key can be up to 64 characters in length, and cannot contain http:// or https://. The tag key cannot start with aliyun or acs:.

Note If you do not specify TagKey, all tags added to the specified resources are removed.

Response parameters

ParameterTypeExampleDescription
RequestIdStringC46FF5A8-C5F0-4024-8262-B16B639225A0

The request ID.

Examples

Sample requests

http(s)://[Endpoint]/?Action=UntagResources
&RegionId=cn-hangzhou
&ResourceType=instance
&All=true
&ResourceId=["lb-bp16qjewdsunr41m1****"]
&TagKey=["FinanceDept"]
&Common request parameters

Sample success responses

XML format

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

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

JSON format

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

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

Error codes

HttpCodeError codeError messageDescription
400TagTypeNotSameThe category of tags in the same request must be the same.The specified tags in the request are of different types.
400ResourceNotExist%s.The specified resource is not found.
400DeniedForNoneTagCreator%s.The system tag is not created by the current account.
400DeniedForScopeNotEqual%s.The key of a system tag cannot have different Scope values.
400InvalidParam.ResourceTypeThe specified ResourceType is invalid.The specified resource type is invalid. Specify a valid resource type and try again.
400InvalidParam.TagKeyThe specified TagKey is invalid.The specified tag key is invalid. Specify a valid tag key and try again.
400InvalidParam.TagValueThe specified TagValue is invalid.The specified tag value is invalid. Specify a valid tag value and try again.
400InvalidParam.TagKeyOrValueThe specified TagKey or TagValue is invalid.The specified tag key or tag value is invalid. Specify a valid key-value pair and try again.
400InvalidParam.TagOwnerUidThe specified TagOwnerUid is invalid.TagOwnerUid is set to an invalid value. Specify a valid value and try again.
400InvalidParam.TagOwnerBidThe specified TagOwnerBid is invalid.TagOwnerBid is set to an invalid value. Specify a valid value and try again.
400MissingParam.TagOwnerUidThe parameter TagOwnerUid is required.TagOwnerUid is not specified.
400MissingParam.TagOwnerBidThe parameter TagOwnerBid is required.TagOwnerBid is not specified.
400InvalidParameter.RegionIdThe specified RegionId does not exist.The specified region ID is not found.
400MissingParam.ResourceIdThe parameter ResourceId is required.ResourceId is not specified.
400DeniedForOperateCustomTag%s.You cannot modify or delete the tag with the current account.
400Duplicate.TagKeyThe param TagKey has duplicate value.The specified tag key already exists.
400SizeLimitExceeded.ResourceIdThe maximum size of ResourceId is exceeded.The length of the specified resource ID exceeds the limit. Specify a valid resource ID and try again.
400SizeLimitExceeded.TagKeyThe maximum size of TagKey is exceeded.The length of the specified tag key exceeds the limit. Specify a valid tag key and try again.

For a list of error codes, see Service error codes.