All Products
Search
Document Center

ApsaraDB RDS:ModifyDBInstanceNetworkType

Last Updated:May 29, 2023

Changes the network type of an instance.

Operation Description

Prerequisites

The network type of the instance is classic network.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
rds:ModifyDBInstanceNetworkTypeWRITE
  • RDS
    acs:rds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
  • rds:ResourceTag
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

The ID of the instance.

rm-uf6wjk5xxxxxxx
RetainClassicstringNo

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

  • True: retains the classic network endpoint.
  • False: does not retain the classic network endpoint.

Default value: False.

True
ClassicExpiredDaysstringNo

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

NoteIf 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.

NoteThis 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 ID of the VPC.

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. ApsaraDB RDS automatically assigns an internal IP address to the instance based on the values of the VPCId and VSwitchId parameters.

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 an internal IP address to the read-only instance based on the values of the VPCId and VSwitchId parameters.

NoteThis value is valid when a read/write splitting endpoint of the classic network type exists.
192.168.0.22

Response parameters

ParameterTypeDescriptionExample
object
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 codes of the API operation change.
Change itemChange content
API DescriptionAPI Description Update
Error CodesThe error codes of the API operation change.
    delete Error Codes: 400
    delete Error Codes: 403