All Products
Search
Document Center

ApsaraDB RDS:ModifyDBInstanceNetworkType

Last Updated:Jul 05, 2024

Changes the network type of an ApsaraDB RDS instance from classic network to VPC

Operation description

Supported database engines

  • RDS MySQL
  • RDS PostgreSQL
  • RDS SQL Server

References

Note : Before you call this operation, carefully read the following documentation. Make sure that you fully understand the prerequisites and impacts for calling this operation.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

The instance ID. You can call the DescribeDBInstances operation to query the instance ID.

rm-uf6wjk5xxxxxxx
RetainClassicstringNo

Specifies whether to retain the classic network endpoint. Valid values:

  • True: retains the classic network endpoint.
  • False (default): does not retain the classic network endpoint.
True
ClassicExpiredDaysstringNo

The number of days for which you want to retain the classic network endpoint. Valid values: 1 to 120. Default value: 7.

Note If you set the RetainClassic parameter to True, you must also specify this parameter.
7
InstanceNetworkTypestringYes

The network type after the modification. Set the value to VPC.

VPC
ReadWriteSplittingClassicExpiredDaysintegerNo

The number of days for which you want to retain the read/write splitting endpoint of the classic network type. Valid values: 1 to 120. Default value: 7.

Note This parameter takes effect only when a read/write splitting endpoint of the classic network type exists and the RetainClassic parameter is set to True.
7
VPCIdstringNo

The VPC ID.

vpc-uf6f7l4fg90xxxxxx
VSwitchIdstringNo

The ID of the vSwitch. This parameter is required if the VPCId parameter is specified.

vsw-uf6adz52c2pxxxxx
PrivateIpAddressstringNo

The internal IP address of the instance. The internal IP address must be within the CIDR block supported by the specified vSwitch. The system automatically assigns a private IP address to an instance based on the values of VPCId and VSwitchId.

172.10.40.25
ReadWriteSplittingPrivateIpAddressstringNo

The internal IP address that corresponds to the read/write splitting endpoint of the instance. The internal IP address must be within the CIDR block supported by the specified vSwitch. The system automatically assigns a private IP address to an instance based on the values of VPCId and VSwitchId.

Note This parameter is valid when a read/write splitting endpoint of the classic network type exists.
192.168.0.22

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The ID of the request.

1AD222E9-E606-4A42-BF6D-8A4442913CEF
TaskIdstring

The ID of the task.

1025486523574
ConnectionStringstring

The endpoint that is used to connect to the instance.

rm-bp1*****************.mysql.rds.aliyuncs.com

Examples

Sample success responses

JSONformat

{
  "RequestId": "1AD222E9-E606-4A42-BF6D-8A4442913CEF",
  "TaskId": "1025486523574",
  "ConnectionString": "rm-bp1*****************.mysql.rds.aliyuncs.com"
}

Error codes

HTTP status codeError codeError messageDescription
400NetTypeExistsSpecified network type already exists.Failed to change the network type. The new network type is the type of network in which the RDS instance resides.
400VswitchIpExhaustedVswitch IP exhausted.The operation failed. No vSwitch IP addresses are available.
400OperationDenied.SwitchThe specified instance must not be switched to VPC.The operation failed. The RDS instance cannot be switched to a VPC.
400OperationDenied.DBInstanceNetTypeOperation is denied by the network type of current database instance.The operation failed. The operation is not supported for the network type of the RDS instance.
400OperationDenied.DBInstanceStatusOperation is denied by the current database instance status.The operation failed. The RDS instance is not in a ready state.
400OperationNotSupportedThis operation is not currently supported.This operation is not supported.
403OperationDenied.DBInstanceConnTypeThe current DB instance connection type does not support this operation.The operation failed. The operation is not supported for the network connection type of the RDS instance.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2022-06-23API Description Update. The Error code has changedView Change Details