MoveResources

Updated at: 2025-02-20 13:32

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****.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
OperationAccess levelResource typeCondition keyAssociated operation
resourcemanager:MoveResourcesupdate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ParameterTypeRequiredDescriptionExample
ResourceGroupIdstringYes

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

rg-aekzmeobk5w****
Resourcesarray<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.
objectYes

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.
ResourceIdstringNo

The ID of the resource.

vpc-bp1sig0mjktx5ewx1****
ResourceTypestringNo

The type of the resource.

vpc
RegionIdstringNo

The region ID of the resource.

cn-hangzhou
ServicestringNo

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

vpc
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

ParameterTypeDescriptionExample
ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The ID of the request.

C00B89D3-3247-11DE-95D8-A7C01FB0AB4F
Responsesarray<object>

The returned results.

responseobject

Responses

Servicestring

The ID of the Alibaba Cloud service.

vpc
ResourceIdstring

The ID of the resource.

vpc-bp1sig0mjktx5ewx1****
ResourceTypestring

The type of the resource.

vpc
RequestIdstring

The ID of the request.

C00B89D3-3247-11DE-95D8-A7C01FB0AB4F
Statusstring

The status of the move task. Valid values:

  • SUCCESS
  • FAIL
FAIL
ErrorCodestring

The error code returned.

Note
This parameter is returned if the resource failed to be moved.
NoPermission
ErrorMsgstring

The error message returned.

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

The region ID of the resource.

cn-hangzhou

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError message
HTTP status codeError codeError message
400SERVICE_REGION_NO_ENDPOINTPlease input right service and region

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
Change timeSummary of changesOperation
2024-04-11The Error code has changedView Change Details
2023-03-21The Error code has changedView Change Details
  • On this page (1)
  • Operation description
  • Debugging
  • Authorization information
  • Request parameters
  • Response parameters
  • Examples
  • Error codes
  • Change history
Feedback
phone Contact Us

Chat now with Alibaba Cloud Customer Service to assist you in finding the right products and services to meet your needs.

alicare alicarealicarealicare