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

This operation is supported for replica set instances that run MongoDB 4.2 or earlier and sharded cluster instances. This operation is not supported for standalone instances.

Note If you have applied for a public endpoint for the instance, you must call the ReleasePublicNetworkAddress operation to release the public endpoint before you call the MigrateAvailableZone operation.

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 virtual private cloud (VPC), you must specify the Vswitch parameter.
ZoneId String Yes cn-hangzhou-b

The ID of the destination zone.

Note
  • The destination zone must be in the same region as the source zone of the instance.
  • You can call the DescribeRegions operation to query zone IDs.
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 that you specify.

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

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

JSON format

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

Error codes

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