Removes tags that are attached to Server Migration Center (SMC) resources. The SMC resources consist of migration sources and migration tasks.

Description

You can call this operation to remove tags that are attached to one or more SMC resources and deletes the tags if the tags are no longer in use.

Request parameters

Parameter Type Required Example Description
Action String Yes UntagResources

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

ResourceType String Yes sourceserver

The type of the SMC resource. Valid values:

  • sourceserver: migration source
  • replicationjob: migration task
All Boolean No false

Specifies whether to remove all tags that are attached to the specified SMC resource. This parameter is valid only if you do not set the TagKey.N parameter. Valid values:

  • true: removes all tags that are attached to the specified SMC resource. If no tags are attached to the specified SMC resource, no operation is performed.
  • false: removes no tags that are attached to the specified SMC resource.

Default value: false.

ResourceId.N String Yes s-bp12tueadp5ndleg****

The IDs of one or more SMC resources. SMC resources consist of migration sources and migration tasks.

TagKey.N String No smc

The key of tag N.

Response parameters

Parameter Type Example Description
RequestId String 2D69A58F-345C-4FDE-88E4-BF5189484043

The ID of the request.

Examples

Sample request

http(s)://smc.aliyuncs.com/?Action=UntagResources
&ResourceType=sourceserver
&All=false
&ResourceId=["s-bp12tueadp5ndleg****"]
&TagKey=["smc"]
&<Common request parameters>

Sample success responses

XML format

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

<UntagResourcesResponse>
    <RequestId>2D69A58F-345C-4FDE-88E4-BF5189484043</RequestId>
</UntagResourcesResponse>

JSON format

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

{
  "RequestId" : "2D69A58F-345C-4FDE-88E4-BF5189484043"
}

Error codes

HTTP status code Error code Error message Description
400 NumberExceed.Tags The maximum number of the Tag parameters cannot exceed 20. The error message returned because the number of specified tags exceeds the upper limit of 20.
400 MissingParameter.ResourceType You must specify ResourceType. The error message returned because the resource type is not specified.
400 InvalidResourceType.NotFound The specified ResourceType does not exist. The error message returned because the resource type does not exist.
400 NumberExceed.ResourceIds The maximum number of ResourceId parameters cannot exceed 50. The error message returned because the number of specified resource IDs exceeds the upper limit of 50.
400 Duplicate.ResourceId The ResourceId contains duplicate values. The error message returned because duplicate resource IDs are specified.
400 InvalidResourceId.NotFound The specified ResourceIds do not exist. The error message returned because the specified resource does not exist.

For a list of error codes, visit the API Error Center.