Migrates an ApsaraDB for MongoDB instance to a specified destination zone.

Precautions

  • This operation is available only for replica set instances that run MongoDB 4.2 or earlier and sharded cluster instances.
  • If you have applied for a public endpoint for the ApsaraDB for MongoDB instance, you must call the ReleasePublicNetworkAddress operation to release the public endpoint before you call the MigrateAvailableZone operation.
  • Transparent data encryption (TDE) is disabled for the instance.
  • The source zone and the destination zone belong to the same region.
  • A vSwitch is created in the destination zone. This prerequisite must be met if the instance resides in a virtual private cloud (VPC). For more information about how to create a vSwitch, see Work with vSwitches.

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 MigrateAvailableZone

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

DBInstanceId String Yes dds-bp1ece71ff2f****

The ID of the instance.

Note If the instance is deployed in a VPC, you must specify the Vswitch parameter.
ZoneId String Yes cn-hangzhou-b

The ID of the destination zone.

Note
  • The source zone and the destination zone belong to the same region.
  • You can call the DescribeRegions operation to query the most recent zone list.
Vswitch String No vsw-bp1buy0h9myt5i9e7****

The ID of the vSwitch in the destination zone.

Note If the instance is deployed in a VPC, you must specify this parameter.
EffectiveTime String No Immediately

The time when the instance is migrated to the destination zone. Valid values:

  • Immediately: The instance is immediately migrated to the destination zone.
  • MaintainTime: The instance is migrated to the destination zone during the maintenance window of the instance.

Default value: Immediately.

Response parameters

Parameter Type Example Description
RequestId String 0FDDC511-7252-4A4A-ADDA-5CB1BF63****

The ID of the request.

Examples

Sample requests

http(s)://mongodb.aliyuncs.com/?Action=MigrateAvailableZone
&DBInstanceId=dds-bp1ece71ff2f****
&ZoneId=cn-hangzhou-b
&EffectiveTime=Immediately
&<Common request parameters>

Sample success responses

XML format

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

<MigrateAvailableZoneResponse>
    <RequestId>0FDDC511-7252-4A4A-ADDA-5CB1BF63****</RequestId>
</MigrateAvailableZoneResponse>

JSON format

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

{
  "RequestId" : "0FDDC511-7252-4A4A-ADDA-5CB1BF63****"
}

Error codes

HTTP status code Error code Error message Description
400 UnsupportedDBTdeStatus Specified DB TDEStatus does not support this operation. The error message returned because TDE is enabled for the instance.

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