Enables or disables the dedicated proxy feature for an instance.
Operation Description
- The dedicated proxy feature of ApsaraDB RDS for MySQL provides capabilities such as read/write splitting and short-lived connection optimization. For more information, see What are database proxies?
- The database proxy feature of ApsaraDB RDS for PostgreSQL supports read/write splitting. For more information, see What are database proxies?
Before you call this operation, make sure that the following requirements are met:
If the instance runs MySQL, the instance must run one of the following MySQL versions and RDS editions:
- MySQL 8.0 with a minor engine version of 20191204 or later on RDS Enterprise Edition
- MySQL 8.0 with a minor engine version of 20190915 or later on RDS High-availability Edition
- MySQL 5.7 with a minor engine version of 20191128 or later on RDS Enterprise Edition
- MySQL 5.7 with a minor engine version of 20190925 or later on RDS High-availability Edition
- MySQL 5.6 with a minor engine version of 20200229 or later on RDS High-availability Edition
If the instance runs PostgreSQL, the instance must meet the following requirements:
- The instance runs PostgreSQL 10, PostgreSQL 11, PostgreSQL 12, PostgreSQL 13, PostgreSQL 14, or PostgreSQL 15.
- The instance uses cloud disks.
- The instance runs RDS High-availability Edition.
- The instance is a primary instance.
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
rds:ModifyDBProxy | WRITE |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
DBInstanceId | string | Yes | The ID of the instance. You can call the DescribeDBInstances operation to query the ID of the instance. | rm-uf6wjk5xxxxxxx |
ConfigDBProxyService | string | Yes | Specifies whether to enable or disable the database proxy feature. Valid values:
| Startup |
DBProxyInstanceNum | string | No | The number of proxy instances that are enabled. Valid values: 1 to 60. Default value: 1. NoteThe capability to process requests increases in proportion with the number of proxy instances. You can specify a proper number of proxy instances based on the monitoring information of database loads. | 1 |
RegionId | string | No | The region ID of the instance. You can call the DescribeRegions operation to query most recent region list. | cn-hangzhou |
InstanceNetworkType | string | No | The network type of the instance. Set the value to VPC. NoteThis parameter is required if you enable the database proxy feature for an ApsaraDB RDS for MySQL instance that uses cloud disks or an ApsaraDB RDS for PostgreSQL instance. | VPC |
VPCId | string | No | The ID of the virtual private cloud (VPC) to which the instance belongs. You can call the DescribeDBInstanceAttribute operation to query the VPC ID of the instance. NoteThis parameter is required if you enable the database proxy feature for an ApsaraDB RDS for MySQL instance that uses cloud disks or an ApsaraDB RDS for PostgreSQL instance. | vpc-xxxxxxxxxxxx |
VSwitchId | string | No | The ID of the vSwitch that is associated with the specified VPC. You can call the DescribeDBInstanceAttribute operation to query the VPC ID of the instance. NoteThis parameter is required if you enable the database proxy feature for an ApsaraDB RDS for MySQL instance that uses cloud disks or an ApsaraDB RDS for PostgreSQL instance. | vsw-xxxxxxxxxxxx |
DBProxyEngineType | string | No | An internal parameter. You do not need to specify this parameter. | normal |
ResourceGroupId | string | No | The ID of the resource group. | rg-acfmy***** |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "FC452BB1-EED8-4278-95C7-0324B3710DF1"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | MaxscaleAlreadyExist | The Maxscale is already existed. | The specified Maxscale already exists. |
400 | MaxscaleNotSupport | Maxscale not supported | Dedicated proxy is not supported by the instance. Please check the configuration information about enabling dedicated proxy. |
400 | NetWork.NotFound | NetWork.NotFound | The network is unavailable. |
400 | InvalidVpcParameter | Either VPC ID or vSwitch ID is incorrect. Please check again. | The operation failed. Check the value of the VPCId parameter. |
400 | MaxscaleInternalError | Database proxy status is CLASS_CHANGING. | The specifications of the database proxy are being changed. Restart the RDS instance later. |
400 | InvalidDBInstanceName | Specified parameter DBInstanceName is not valid. | The value of the DBInstanceName parameter is invalid. Check that the value of this parameter is not null or an empty string. |
404 | MaxscaleCreating | The relative maxscale instance is being created or deleted. | - |
404 | Maxscale.NotFound | The relative maxscale instance is not found. | No associated maxscale instance is found. |
404 | InvalidVSwitchId.NotFound | The specified VSwitch is invalid. | The operation failed. The vSwitch ID is invalid. Check the vSwitch ID. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
2022-06-08 | The error codes of the API operation change.,The input parameters of the API operation change. | |||||||||||
|