Changes the network type of an AsparaDB for MongoDB instance.

This operation applies to replica set instances and sharded cluster instances, but not standalone instances.

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 ModifyDBInstanceNetworkType

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

RegionId String No cn-hangzhou

The region ID of the instance. You can call the DescribeDBInstanceAttribute operation to query the region ID of the instance.

DBInstanceId String Yes dds-bp11483712c1****

The ID of the instance.

NetworkType String Yes VPC

The network type to switch to. Valid values:

  • VPC
  • Classic
VpcId String No vpc-bp1n3i15v90el48nx****

The ID of the virtual private cloud (VPC).

Note This parameter is required when the NetworkType parameter is set to VPC.
VSwitchId String No vsw-bp1vj604nj5a9zz74****

The ID of the vSwitch in the VPC.

Note This parameter is required when the NetworkType parameter is set to VPC.
RetainClassic String No Flase

Specifies whether to retain the original classic network address when you change the network type to VPC. Valid values:

  • True: retains the original classic network address.
  • False: does not retain the original classic network address.
Note
  • This parameter is required when the NetworkType parameter is set to VPC.
  • If you set this parameter to True, you must also specify the ClassicExpiredDays parameter.
ClassicExpiredDays Integer No 30

The retention period of the original classic network address when you change the network type to VPC. Valid values: 14, 30, 60, and 120. Unit: days.

Note
  • This parameter is required when the NetworkType parameter is set to VPC.
  • This parameter is required when the RetainClassic parameter is set to True.

Response parameters

Parameter Type Example Description
RequestId String D0E605FD-6ECE-5FBE-84A4-99AAB1B8****

The ID of the request.

Examples

Sample requests

http(s)://mongodb.aliyuncs.com/?Action=ModifyDBInstanceNetworkType
&DBInstanceId=dds-bp11483712c1****
&NetworkType=VPC
&VpcId=vpc-bp1n3i15v90el48nx****
&VSwitchId=vsw-bp1vj604nj5a9zz74****
&RetainClassic=Flase
&<Common request parameters>

Sample success responses

XML format

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

<ModifyDBInstanceNetworkTypeResponse>
    <RequestId>D0E605FD-6ECE-5FBE-84A4-99AAB1B8****</RequestId>
</ModifyDBInstanceNetworkTypeResponse>

JSON format

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

{
  "RequestId" : "D0E605FD-6ECE-5FBE-84A4-99AAB1B8****"
}

Error codes

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