All Products
Search
Document Center

:MoveResources

Last Updated:Dec 11, 2023

Moves resources from one resource group to another.

This API operation allows you to move multiple resources that reside in different regions or belong to different services or resource groups to the same resource group at a time.

For more information about Alibaba Cloud services whose resources can be moved between resource groups, see the API column in Services that work with Resource Group.

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.N.ResourceId String No i-23v38****

The resource ID.

Resources.N.ResourceType String No instance

The resource type.

You can obtain the resource type from the Resource type column in Services that work with Resource Group.

Resources.N.RegionId String No cn-hangzhou

The region ID of the resource.

Resources.N.Service String No ecs

The service code.

You can obtain the code from the Service code column in Services that work with Resource Group.

Response parameters

Parameter

Type

Example

Description

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

The request ID.

Responses Array of response

The returned result.

Service String ecs

The service code.

ResourceId String i-23v38****

The resource ID.

ResourceType String instance

The resource type.

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

The request ID.

Status String FAIL

The status. Valid values:

  • SUCCESS
  • FAIL
ErrorCode String NoPermission

The error code.

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

The error message.

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=i-23v38****
&Resources.1.ResourceType=instance
&Resources.1.RegionId=cn-hangzhou
&Resources.1.Service=ecs
&<Common request parameters>

Sample success responses

XML format

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

<MoveResourcesResponse>
    <RequestId>C00B89D3-3247-11DE-95D8-A7C01FB0AB4F</RequestId>
    <Responses>
        <Service>ecs</Service>
        <ResourceId>i-23v38****</ResourceId>
        <ResourceType>instance</ResourceType>
        <RequestId>C00B89D3-3247-11DE-95D8-A7C01FB0AB4F</RequestId>
        <Status>SUCCESS</Status>
        <ErrorCode/>
        <ErrorMsg/>
        <RegionId>cn-hangzhou</RegionId>
    </Responses>
</MoveResourcesResponse>

JSON format

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

{
  "RequestId" : "C00B89D3-3247-11DE-95D8-A7C01FB0AB4F",
  "Responses" : [ {
    "Service" : "ecs",
    "ResourceId" : "i-23v38****",
    "ResourceType" : "instance",
    "RequestId" : "C00B89D3-3247-11DE-95D8-A7C01FB0AB4F",
    "Status" : "SUCCESS",
    "ErrorCode" : "",
    "ErrorMsg" : "",
    "RegionId" : "cn-hangzhou"
  } ]
}

Error codes

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