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.
Operation description
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****.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
resourcemanager:MoveResources |
update |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ResourceGroupId |
string |
Yes |
The ID of the resource group to which you want to move the resources. |
rg-aekzmeobk5w**** |
| Resources |
array<object> |
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. |
|
|
object |
No |
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. |
||
| RegionId |
string |
No |
The region ID of the resource. |
cn-hangzhou |
| ResourceId |
string |
No |
The ID of the resource. |
i-23v38**** |
| ResourceType |
string |
No |
The type of the resource. |
instance |
| Service |
string |
No |
The ID of the Alibaba Cloud service to which the resource belongs. |
ecs |
You can call the ListResources operation to obtain the values of the
Service,RegionId,ResourceId,ResourceGroupId, andResourceTyperequest parameters.For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The ID of the request. |
C00B89D3-3247-11DE-95D8-A7C01FB0AB4F |
| Responses |
array<object> |
The returned results. |
|
|
object |
Responses |
||
| ErrorCode |
string |
The error code returned. Note
This parameter is returned if the resource failed to be moved. |
NoPermission |
| ErrorMsg |
string |
The error message returned. Note
This parameter is returned if the resource failed to be moved. |
没权限 |
| RegionId |
string |
The region ID of the resource. |
cn-hangzhou |
| RequestId |
string |
The ID of the request. |
C00B89D3-3247-11DE-95D8-A7C01FB0AB4F |
| ResourceId |
string |
The ID of the resource. |
i-23v38**** |
| ResourceType |
string |
The type of the resource. |
instance |
| Service |
string |
The ID of the Alibaba Cloud service. |
ecs |
| Status |
string |
The status of the move task. Valid values:
|
FAIL |
Examples
Success response
JSON format
{
"RequestId": "C00B89D3-3247-11DE-95D8-A7C01FB0AB4F",
"Responses": [
{
"ErrorCode": "NoPermission",
"ErrorMsg": "没权限",
"RegionId": "cn-hangzhou",
"RequestId": "C00B89D3-3247-11DE-95D8-A7C01FB0AB4F",
"ResourceId": "i-23v38****",
"ResourceType": "instance",
"Service": "ecs",
"Status": "FAIL"
}
]
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | SERVICE_REGION_NO_ENDPOINT | Please input right service and region | |
| 400 | EntityExists.AssociatedTransferTask | An associated transfer task is in progress. Try again later. | Resources that are associated with a specific resource are being transferred to another resource group together with the specific resource. Try again later. |
| 400 | NotAllowMove.ExistsAssociatedTransferRule | Associated resources cannot be transferred while the primary resource is being transferred. | The Transfer Associated Resources feature is enabled, but the resources associated with the specific resource do not support this feature. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.