Switches an ApsaraDB for RDS instance between its internal and public endpoints.
To save endpoint resources, you can call this operation to switch an instance between its internal and public endpoints. After the endpoint that is used to connect to the instance is changed, you must update the endpoint information in the code of your application and restart the application.
Before you call this operation, make sure that the following requirements are met:
- The instance is connected by using its internal or public endpoint.
- The instance is in the Running state.
- The number of times that you have switched the instance between its internal and public endpoints within the last 24 hours does not reach 20.
- The instance resides in a classic network.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | SwitchDBInstanceNetType |
The operation that you want to perform. Set the value to SwitchDBInstanceNetType. |
ConnectionStringPrefix | String | Yes | test1234 |
The prefix of the custom endpoint. The prefix must be 8 to 64 characters in length and can contain letters and digits. It must start with a lowercase letter. A complete endpoint is in the following format: <Prefix>. <Database engine>.rds.aliyuncs.com. Example: test1234.mysql.rds.aliyuncs.com. |
DBInstanceId | String | Yes | rm-uf6wjk5xxxxxxx |
The ID of the instance. |
ClientToken | String | No | ETnLKlblzczshOTUbOCzxxxxxx |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length. |
Port | String | No | 3306 |
The port associated with the endpoint. Valid values: 3001 to 3999. |
ConnectionStringType | String | No | Normal |
The type of the endpoint. Valid values:
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 65BDA532-28AF-4122-AA39-B382721EEE64 |
The ID of the request. |
Examples
Sample requests
http(s)://rds.aliyuncs.com/? Action=SwitchDBInstanceNetType
&DBInstanceId=rm-uf6wjk5xxxxxxx
&ConnectionStringPrefix=rm-xxxxxx
&<Common request parameters>
Sample success responses
XML
format
<SwitchDBInstanceNetTypeResponse>
<RequestId> 65BDA532-28AF-4122-AA39-B382721EEE64</RequestId></SwitchDBInstanceNetTypeResponse>
JSON
format
{
"RequestId": " 65BDA532-28AF-4122-AA39-B382721EEE64"
}
Error codes
For a list of error codes, visit the API Error Center.