Changes the network type of an ApsaraDB for MongoDB instance.
This operation is applicable only to replica set instances and sharded cluster instances.
Debugging
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 DescribeRegions operation to query the region ID. |
DBInstanceId | String | Yes | dds-bp11483712c1**** |
The ID of the instance. |
NetworkType | String | Yes | VPC |
The network type to switch to. Valid values:
|
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. Note This parameter is required when the NetworkType parameter is set to VPC.
|
RetainClassic | String | No | False |
Specifies whether to retain the original classic network address when you change the network type to VPC. Valid values:
Note
|
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 and 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=False
&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.