You can call the DescribeDBProxyEndpoint operation to query the details about a proxy endpoint that is used to connect to the database proxy of an instance.
Before you call the DescribeDBProxyEndpoint operation, make sure that the ModifyDBProxy operation is called to enable the database proxy feature for the instance.
- 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?
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DescribeDBProxyEndpoint |
The operation that you want to perform. Set the value to DescribeDBProxyEndpoint. |
DBInstanceId | String | Yes | rm-bp1ja4f56s7us**** |
The ID of the instance. You can call the DescribeDBInstances operation to query the ID of the instance. |
DBProxyEndpointId | String | No | keaxncrjluwu0gue**** |
The name of the proxy terminal to which the proxy endpoint belongs. You can call the DescribeDBProxy operation to query the name of the proxy terminal. |
DBProxyConnectString | String | No | testproxy****.rwlb.rds.aliyuncs.com |
The proxy endpoint that you want to query. You can call the DescribeDBProxy operation to query the proxy endpoint. |
RegionId | String | Yes | cn-hangzhou |
The region ID of the instance. You can call the DescribeRegions operation to query most recent region list. |
DBProxyEngineType | String | No | normal |
An internal parameter. You do not need to specify this parameter. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
DBProxyConnectStringNetType | String | InnerString |
The network type of the proxy endpoint. Valid values:
|
DBProxyFeatures | String | TransactionReadSqlRouteOptimizeStatus:1;ConnectionPersist:0;ReadWriteSpliting:1 |
The configuration of the proxy terminal. The value of this parameter is a JSON string that consists of the following fields:
|
RequestId | String | 847BA085-B377-4BFA-8267-F82345ECE1D2 |
The ID of the request. |
ReadOnlyInstanceWeight | String | [{\"Availability\":\"Available\",\"DBInstanceId\":\"rm-2z****\",\"DBInstanceType\":\"Master\",\"NodeId\":\"rn-t2****\",\"NodeType\":\"Primary\",\"Weight\":0}, {\"Availability\":\"Available\",\"DBInstanceId\":\"rm-2z****\",\"DBInstanceType\":\"Master\",\"NodeId\":\"rn-z9****\",\"NodeType\":\"Secondary\",\"Weight\":400}, {\"Availability\":\"Available\",,\"DBInstanceId\":\"rm-2z****\",\"DBInstanceType\":\"Master\",\"NodeId\":\"rn-1c****\",\"NodeType\":\"Secondary\",\"Weight\":400}]] |
The read weights of the instance and its read-only instances. The value of this parameter is a JSON string that consists of the following fields:
|
ReadOnlyInstanceDistributionType | String | Standard |
The method that is used to assign read weights. For more information, see Modify the latency threshold and read weights of ApsaraDB RDS for MySQL instances. Valid values:
|
ReadOnlyInstanceMaxDelayTime | String | 30 |
The latency threshold that is allowed for read/write splitting. If the latency on a read-only instance exceeds the specified threshold, ApsaraDB RDS no longer forwards read requests to the read-only instance. |
DbProxyEndpointReadWriteMode | String | ReadWrite |
The read and write attributes of the proxy terminal. Valid values:
|
DbProxyEndpointAliases | String | proxyterminal-test |
The description of the proxy terminal. |
DBProxyEndpointId | String | keaxncrjluwu0gue**** |
The ID of the proxy endpoint. |
DBProxyConnectStringPort | String | 3306 |
The port number that is associated with the proxy endpoint. |
DBProxyConnectString | String | testproxy****.rwlb.rds.aliyuncs.com |
The proxy endpoint queried. |
DBProxyEngineType | String | normal |
An internal parameter. You can ignore this parameter. |
EndpointConnectItems | Array of EndpointConnectItems |
An array that consists of the information about the proxy endpoint. |
|
EndpointConnectItems | |||
DbProxyEndpointPort | String | 3306 |
The port number that is associated with the proxy endpoint. Default value: 3306. |
DbProxyEndpointConnectString | String | testproxy****.rwlb.rds.aliyuncs.com |
The proxy endpoint queried. |
DbProxyEndpointNetType | String | 2 |
The network type of the proxy endpoint. Valid values:
|
Examples
Sample requests
http(s)://rds.aliyuncs.com/?Action=DescribeDBProxyEndpoint
&DBInstanceId=rm-bp1ja4f56s7us****
&RegionId=cn-hangzhou
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeDBProxyEndpointResponse>
<DBProxyConnectStringNetType>InnerString</DBProxyConnectStringNetType>
<DBProxyFeatures>TransactionReadSqlRouteOptimizeStatus:1;ConnectionPersist:0;ReadWriteSpliting:1</DBProxyFeatures>
<RequestId>847BA085-B377-4BFA-8267-F82345ECE1D2</RequestId>
<ReadOnlyInstanceWeight>[{\"Availability\":\"Available\",\"DBInstanceId\":\"rr-bp****\",\"DBInstanceType\":\"ReadOnly\",\"NodeId\":\"rr-bp****\",\"NodeType\":\"ReadOnly\",\"Weight\":400}, {\"Availability\":\"Available\",\"DBInstanceId\":\"rm-2z****\",\"DBInstanceType\":\"Master\",\"NodeId\":\"rm-2z****-instance-2\",\"NodeType\":\"Secondary\",\"Weight\":400}, {\"Availability\":\"Available\",\"DBInstanceId\":\"rm-2z****\",\"DBInstanceType\":\"Master\",\"NodeId\":\"rm-2z****-instance-3\",\"NodeType\":\"Secondary\",\"Weight\":400}, {\"Availability\":\"Available\",,\"DBInstanceId\":\"rm-2z****\",\"DBInstanceType\":\"Master\",\"NodeId\":\"rm-2z****-instance-1\",\"NodeType\":\"Primary\",\"Weight\":0}]]</ReadOnlyInstanceWeight>
<ReadOnlyInstanceDistributionType>Standard</ReadOnlyInstanceDistributionType>
<ReadOnlyInstanceMaxDelayTime>30</ReadOnlyInstanceMaxDelayTime>
<DbProxyEndpointReadWriteMode>ReadWrite</DbProxyEndpointReadWriteMode>
<DbProxyEndpointAliases>proxyterminal-test</DbProxyEndpointAliases>
<DBProxyEndpointId>keaxncrjluwu0gue****</DBProxyEndpointId>
<DBProxyConnectStringPort>3306</DBProxyConnectStringPort>
<DBProxyConnectString>testproxy****.rwlb.rds.aliyuncs.com</DBProxyConnectString>
<DBProxyEngineType>normal</DBProxyEngineType>
<EndpointConnectItems>
<DbProxyEndpointPort>3306</DbProxyEndpointPort>
<DbProxyEndpointConnectString>testproxy****.rwlb.rds.aliyuncs.com</DbProxyEndpointConnectString>
<DbProxyEndpointNetType>2</DbProxyEndpointNetType>
</EndpointConnectItems>
</DescribeDBProxyEndpointResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"DBProxyConnectStringNetType" : "InnerString",
"DBProxyFeatures" : "TransactionReadSqlRouteOptimizeStatus:1;ConnectionPersist:0;ReadWriteSpliting:1",
"RequestId" : "847BA085-B377-4BFA-8267-F82345ECE1D2",
"ReadOnlyInstanceWeight" : "[{\\\"Availability\\\":\\\"Available\\\",\\\"DBInstanceId\\\":\\\"rr-bp****\\\",\\\"DBInstanceType\\\":\\\"ReadOnly\\\",\\\"NodeId\\\":\\\"rr-bp****\\\",\\\"NodeType\\\":\\\"ReadOnly\\\",\\\"Weight\\\":400}, {\\\"Availability\\\":\\\"Available\\\",\\\"DBInstanceId\\\":\\\"rm-2z****\\\",\\\"DBInstanceType\\\":\\\"Master\\\",\\\"NodeId\\\":\\\"rm-2z****-instance-2\\\",\\\"NodeType\\\":\\\"Secondary\\\",\\\"Weight\\\":400}, {\\\"Availability\\\":\\\"Available\\\",\\\"DBInstanceId\\\":\\\"rm-2z****\\\",\\\"DBInstanceType\\\":\\\"Master\\\",\\\"NodeId\\\":\\\"rm-2z****-instance-3\\\",\\\"NodeType\\\":\\\"Secondary\\\",\\\"Weight\\\":400}, {\\\"Availability\\\":\\\"Available\\\",,\\\"DBInstanceId\\\":\\\"rm-2z****\\\",\\\"DBInstanceType\\\":\\\"Master\\\",\\\"NodeId\\\":\\\"rm-2z****-instance-1\\\",\\\"NodeType\\\":\\\"Primary\\\",\\\"Weight\\\":0}]]",
"ReadOnlyInstanceDistributionType" : "Standard",
"ReadOnlyInstanceMaxDelayTime" : "30",
"DbProxyEndpointReadWriteMode" : "ReadWrite",
"DbProxyEndpointAliases" : "proxyterminal-test",
"DBProxyEndpointId" : "keaxncrjluwu0gue****",
"DBProxyConnectStringPort" : "3306",
"DBProxyConnectString" : "testproxy****.rwlb.rds.aliyuncs.com",
"DBProxyEngineType" : "normal",
"EndpointConnectItems" : [ {
"DbProxyEndpointPort" : "3306",
"DbProxyEndpointConnectString" : "testproxy****.rwlb.rds.aliyuncs.com",
"DbProxyEndpointNetType" : "2"
} ]
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidEndPoint.Format | The specified EndPoint is not valid. | The error message returned because the DBProxyEndpointId parameter is not specified or the ID specified by the DBProxyEndpointId parameter cannot be found. |
400 | InvalidDBInstanceName | Specified parameter DBInstanceName is not valid. | The error message returned because the value of the DBInstanceName parameter is invalid. Check whether the value is null or an empty string. |
400 | Endpoint.NotFound | The specified EndPoint is not valid. | The error message returned because the specified proxy terminal does not exist. |
403 | IncorrectKindCode | The current KindCode of the custins does not support the operation. | The error message returned because the configuration of the instance does not support this operation. Check the configuration of the primary instance. |
403 | IncorrectDBInstanceType | The current database instance type does not support the operation. | The error message returned because the configuration of the instance does not support this operation. |
404 | Endpoint.NotFound | Specified endpoint is not found. | The error message returned because the port number that you specified cannot be found. |
For a list of error codes, visit the API Error Center.