RemoveTags

Last Updated: Mar 28, 2018

Description

Removes one or more tags from the specified ECS resource, such as instances, disks, snapshots, images, and security groups.

Request parameters

Name Type Required Description
Action String Yes The name of this interface. Value: RemoveTags.
RegionId String Yes The ID of the region to which the ECS resource belongs. For more information, see Regions and zones, or call DescribeRegions to obtain the latest region list.
ResourceType String Yes Indicates the type of resource when you bind a tag to it. Optional values:
  • image
  • instance
  • snapshot
  • disk
  • securitygroup
All values are in lowercase.
ResourceId String Yes The resource ID. For example, if you set the ResourceType to instance, the ResourceId can be interpreted as InstanceId.
Tag.n.Key String No The tag key where n ranges from 1 to 5. You can call DescribeTags to view your available tags.
Tag.n.Value String No The tag value where n ranges from 1 to 5. If you do not use this parameter, the tag that is specified by the Tag.n.Key is removed from the specified resource.

Response parameters

For more information about all the common response parameters, see Common parameters.

Examples

Request example

  1. https://ecs.aliyuncs.com/?Action=RemoveTags
  2. &ResourceId=s-946ntx4wr
  3. &ResourceType=snapshot
  4. &RegionId=cn-shenzhen
  5. &Tag.1.Key=test
  6. &Tag.1.Value=api
  7. &<Common Request Parameters>

Response example

XML format

  1. <RemoveTagsResponse>
  2. <RequestId>6A2C8AB5-E15D-478C-B56A-CF3DAF060028</RequestId>
  3. </RemoveTagsResponse>

JSON format

  1. {
  2. "RequestId": "6A2C8AB5-E15D-478C-B56A-CF3DAF060028"
  3. }

Error codes

Error code Error message HTTP status code Meaning
InvalidTagCount The specified tags are beyond the permitted range. 400 You can remove up to five tags from specified ECS resource in this query request.
InvalidResourceId.NotSupported The specified ResourceId does not support tagging. 403 You cannot remove tags from the specified ECS resource
InvalidResourceId.NotFound The specified ResourceId is not found in our records. 404 The specified ResourceId does not exist.
InvalidRegionId.NotFound The RegionId provided does not exist in our records. 404 The specified RegionId does not exist.
InvalidResourceType.NotFound The ResourceType provided does not exist in our records. 404 The specified ResourceType does not exist.
Thank you! We've received your feedback.