All Products
Search
Document Center

ApsaraDB RDS:ModifyDBProxy

Last Updated:May 29, 2023

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.
OperationAccess levelResource typeCondition keyAssociated operation
rds:ModifyDBProxyWRITE
  • RDS
    acs:rds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
  • rds:ResourceTag
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

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

rm-uf6wjk5xxxxxxx
ConfigDBProxyServicestringYes

Specifies whether to enable or disable the database proxy feature. Valid values:

  • Startup: enables the database proxy feature.
  • Shutdown: disables the database proxy feature.
Startup
DBProxyInstanceNumstringNo

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
RegionIdstringNo

The region ID of the instance. You can call the DescribeRegions operation to query most recent region list.

cn-hangzhou
InstanceNetworkTypestringNo

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
VPCIdstringNo

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
VSwitchIdstringNo

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
DBProxyEngineTypestringNo

An internal parameter. You do not need to specify this parameter.

normal
ResourceGroupIdstringNo

The ID of the resource group.

rg-acfmy*****

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

FC452BB1-EED8-4278-95C7-0324B3710DF1

Examples

Sample success responses

JSONformat

{
  "RequestId": "FC452BB1-EED8-4278-95C7-0324B3710DF1"
}

Error codes

HTTP status codeError codeError messageDescription
400MaxscaleAlreadyExistThe Maxscale is already existed.The specified Maxscale already exists.
400MaxscaleNotSupportMaxscale not supportedDedicated proxy is not supported by the instance. Please check the configuration information about enabling dedicated proxy.
400NetWork.NotFoundNetWork.NotFoundThe network is unavailable.
400InvalidVpcParameterEither VPC ID or vSwitch ID is incorrect. Please check again.The operation failed. Check the value of the VPCId parameter.
400MaxscaleInternalErrorDatabase proxy status is CLASS_CHANGING.The specifications of the database proxy are being changed. Restart the RDS instance later.
400InvalidDBInstanceNameSpecified 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.
404MaxscaleCreatingThe relative maxscale instance is being created or deleted.-
404Maxscale.NotFoundThe relative maxscale instance is not found.No associated maxscale instance is found.
404InvalidVSwitchId.NotFoundThe 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 timeSummary of changesOperation
2022-06-08The error codes of the API operation change.,The input parameters of the API operation change.
Change itemChange content
Error CodesThe error codes of the API operation change.
    delete Error Codes: 400
    delete Error Codes: 404
Input ParametersThe input parameters of the API operation change.
    Added Input Parameters: DBProxyEngineType