Moves resources from one resource group to another. You can move multiple resources that reside in different regions, are used by different Alibaba Cloud services, or belong to different resource groups.

For more information about Alibaba Cloud services whose resources can be moved between resource groups, see the Supported by the API column in Alibaba Cloud services that support resource groups.

In this example, two virtual private clouds (VPCs) vpc-bp1sig0mjktx5ewx1**** and vpc-bp1visxm225pv49dz**** that reside in different regions and belong to different resource groups are moved to the resource group rg-aekzmeobk5w****.

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

Parameter Type Required Example Description
Action String Yes MoveResources

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

ResourceGroupId String Yes rg-aekzmeobk5w****

The ID of the resource group to which you want to move the resources.

Resources Array Yes

The resources that you want to move.

Note You can move a maximum of 10 resources at a time. If you want to move more than 10 resources, move them in batches.
ResourceId String No vpc-bp1sig0mjktx5ewx1****

The ID of the resource.

ResourceType String No vpc

The type of the resource.

RegionId String No cn-hangzhou

The region ID of the resource.

Service String No vpc

The ID of the Alibaba Cloud service to which the resource belongs.

Note
  • You can call the ListResources operation to obtain the values of the Service, RegionId, ResourceId, ResourceGroupId, and ResourceType request parameters.
  • For more information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
RequestId String C00B89D3-3247-11DE-95D8-A7C01FB0AB4F

The ID of the request.

Responses Array of response

The returned results.

Service String vpc

The ID of the Alibaba Cloud service.

ResourceId String vpc-bp1sig0mjktx5ewx1****

The ID of the resource.

ResourceType String vpc

The type of the resource.

RequestId String C00B89D3-3247-11DE-95D8-A7C01FB0AB4F

The ID of the request.

Status String FAIL

The status of the move task. Valid values:

  • SUCCESS
  • FAIL
ErrorCode String NoPermission

The error code returned.

Note This parameter is returned if the resource failed to be moved.
ErrorMsg String No permissions

The error message returned.

Note This parameter is returned if the resource failed to be moved.
RegionId String cn-hangzhou

The region ID of the resource.

Examples

Sample requests

https://resource-manager.aliyuncs.com/?Action=MoveResources
&ResourceGroupId=rg-aekzmeobk5w****
&Resources.1.ResourceId=vpc-bp1sig0mjktx5ewx1****
&Resources.1.ResourceType=vpc
&Resources.1.RegionId=cn-hangzhou
&Resources.1.Service=vpc
&Resources.2.ResourceId=vpc-bp1visxm225pv49dz****
&Resources.2.ResourceType=vpc
&Resources.2.RegionId=cn-beijing
&Resources.2.Service=vpc
&<Common request parameters>

Sample success responses

XML format

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

<?xml version="1.0" encoding="UTF-8" ?>
<MoveResourcesResponse>
    <RequestId>C00B89D3-3247-11DE-95D8-A7C01FB0AB4F</RequestId>
    <Responses>
        <Service>vpc</Service>
        <ResourceId>vpc-bp1sig0mjktx5ewx1****</ResourceId>
        <ResourceType>vpc</ResourceType>
        <RequestId>C00B89D3-3247-11DE-95D8-A7C01FB0AB4F</RequestId>
        <Status>SUCCESS</Status>
        <ErrorCode></ErrorCode>
        <ErrorMsg></ErrorMsg>
        <RegionId>cn-hangzhou</RegionId>
    </Responses>
    <Responses>
        <Service>vpc</Service>
        <ResourceId>vpc-bp1visxm225pv49dz****</ResourceId>
        <ResourceType>vpc</ResourceType>
        <RequestId>C00B89D3-3247-11DE-95D8-A7C01FB0AB4F</RequestId>
        <Status>SUCCESS</Status>
        <ErrorCode></ErrorCode>
        <ErrorMsg></ErrorMsg>
        <RegionId>cn-beijing</RegionId>
    </Responses>
</MoveResourcesResponse>

JSON format

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

{
  "RequestId" : "C00B89D3-3247-11DE-95D8-A7C01FB0AB4F",
  "Responses" : [ {
    "Service" : "vpc",
    "ResourceId" : "vpc-bp1sig0mjktx5ewx1****",
    "ResourceType" : "vpc",
    "RequestId" : "C00B89D3-3247-11DE-95D8-A7C01FB0AB4F",
    "Status" : "SUCCESS",
    "ErrorCode" : "",
    "ErrorMsg" : "",
    "RegionId" : "cn-hangzhou"
  }, {
    "Service" : "vpc",
    "ResourceId" : "vpc-bp1visxm225pv49dz****",
    "ResourceType" : "vpc",
    "RequestId" : "C00B89D3-3247-11DE-95D8-A7C01FB0AB4F",
    "Status" : "SUCCESS",
    "ErrorCode" : "",
    "ErrorMsg" : "",
    "RegionId" : "cn-beijing"
  } ]
}

Error codes

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