Switches the network type of a MongoDB instance.
Operation description
This operation applies to replica set instances and sharded cluster instances. Single-node instances are not supported. Only the transform from the classic network type to the VPC network type is supported.
This operation supports only instances that run MongoDB 4.2 or earlier and use local disks.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dds:ModifyDBInstanceNetworkType |
update |
*Instance
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DBInstanceId |
string |
Yes |
The instance ID. |
dds-bp11483712c1**** |
| NetworkType |
string |
Yes |
The target network type to which you want to switch the instance. Valid values:
|
VPC |
| VpcId |
string |
No |
The VPC ID. Note
This parameter is required when the NetworkType parameter settings is set to VPC. |
vpc-bp1n3i15v90el48nx**** |
| VSwitchId |
string |
No |
The vSwitch ID in the VPC. Note
This parameter is required when the NetworkType parameter settings is set to VPC. |
vsw-bp1vj604nj5a9zz74**** |
| RetainClassic |
string |
No |
Specifies whether to retain the original classic network address when you switch the network type to VPC. Settings. Valid values:
Note
|
False |
| ClassicExpiredDays |
integer |
No |
The retention period of the original classic network address when you switch the network type to VPC. Settings. Valid values: 14, 30, 60, and 120. Unit: days. Note
This parameter is required when the NetworkType parameter settings is set to VPC and the RetainClassic parameter settings is set to True. |
30 |
| ZoneId |
string |
Yes |
The zone ID. You can call the DescribeRegions operation to query the zone ID. |
cn-hangzhou-b |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
D0E605FD-6ECE-5FBE-84A4-99AAB1B8**** |
Examples
Success response
JSON format
{
"RequestId": "D0E605FD-6ECE-5FBE-84A4-99AAB1B8****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 500 | InstanceVpcAuthMode.NotSupported | Instance VpcAuthMode is NotSupported. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.