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 ApsaraDB RDS 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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

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 the 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:

  • InnerString: internal network
  • OuterString: Internet
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:

  • TransactionReadSqlRouteOptimizeStatus: the status of the transaction splitting feature. Valid values: 0 and 1. The value 0 indicates that the feature is disabled. The value 1 indicates that the feature is enabled.
  • ConnectionPersist: the status of the connection pool feature. Valid values: 0, 1, and 2. The value 0 indicates that the connection pool feature is disabled. The value 1 indicates that the session connection pool feature is enabled. The value 2 indicates that the transaction connection pool feature is enabled.
  • ReadWriteSpliting: the status of the read/write splitting feature. Valid values: 0 and 1. The value 0 indicates that the feature is disabled. The value 1 indicates that the feature is enabled.
  • PinPreparedStmt: an internal field that is available only for ApsaraDB RDS for PostgrSQL instances.
    Note If the instance runs PostgreSQL, you can change only the value of the ReadWriteSpliting field. The TransactionReadSqlRouteOptimizeStatus and PinPreparedStmt fields are set to their default values 1.
RequestId String 847BA085-B377-4BFA-8267-F82345ECE1D2

The ID of the request.

ReadOnlyInstanceWeight String [{\"Availability\":\"Available\",\"DBInstanceId\":\"rr-bp176984qewd8****\",\"DBInstanceType\":\"ReadOnly\",\"Weight\":400},{\"Availability\":\"Available\",\"DBInstanceId\":\"rm-bp1ja4f56s7us****\",\"DBInstanceType\":\"Master\",\"Weight\":0}]

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:

  • DBInstanceId: the ID of the instance.
  • DBInstanceType: the role of the instance. Valid values: Master and ReadOnly.
  • Weight: the read weight of the instance. The read weight increases in increments of 100 and cannot exceed 10000.
Note If no read-only instances are attached to the instance, this operation returns null for this parameter.
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:

  • Standard: ApsaraDB RDS automatically allocates read weights to the instance and its read-only instances based on the specifications of the instances.
  • Custom: You must manually assign read weights to the instance and its read-only instances.
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:

  • ReadWrite: The proxy terminal supports read and write requests.
  • ReadOnly: The proxy terminal supports only read requests.
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 bound to the proxy endpoint.

DBProxyConnectString String testproxy****.rwlb.rds.aliyuncs.com

The proxy endpoint queried.

DBProxyEngineType String normal

An internal parameter. This operation does not return a value for 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:

  • 0: Internet
  • 1: classic network
  • 2: virtual private cloud (VPC)

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>
    <DbProxyEndpointReadWriteMode>ReadWrite</DbProxyEndpointReadWriteMode>
    <ReadOnlyInstanceDistributionType>Standard</ReadOnlyInstanceDistributionType>
    <DBProxyConnectString>testproxy****.rwlb.rds.aliyuncs.com</DBProxyConnectString>
    <RequestId>336E33D5-8C02-4265-9627-704BF9F3954B</RequestId>
    <DBProxyEndpointId>keaxncrjluwu0guehzae</DBProxyEndpointId>
    <DbProxyEndpointAliases>proxyterminal-test</DbProxyEndpointAliases>
    <DBProxyFeatures>TransactionReadSqlRouteOptimizeStatus:1;ConnectionPersist:0;ReadWriteSpliting:1;PinPreparedStmt:0</DBProxyFeatures>
    <ReadOnlyInstanceWeight>[{"Availability":"Available","DBInstanceId":"rr-bp176984qewd8****","DBInstanceType":"ReadOnly","Weight":400},{"Availability":"Available","DBInstanceId":"rm-bp1ja4f56s7us****","DBInstanceType":"Master","Weight":0}]</ReadOnlyInstanceWeight>
    <ReadOnlyInstanceMaxDelayTime>30</ReadOnlyInstanceMaxDelayTime>
    <DBProxyConnectStringNetType>InnerString</DBProxyConnectStringNetType>
    <EndpointConnectItems>
        <EndpointConnectItems>
            <DbProxyEndpointNetType>2</DbProxyEndpointNetType>
            <DbProxyEndpointPort>3306</DbProxyEndpointPort>
            <DbProxyEndpointConnectString>testproxy****.rwlb.rds.aliyuncs.com</DbProxyEndpointConnectString>
        </EndpointConnectItems>
        <EndpointConnectItems>
            <DbProxyEndpointNetType>0</DbProxyEndpointNetType>
            <DbProxyEndpointPort>3306</DbProxyEndpointPort>
            <DbProxyEndpointConnectString>test****.rwlb.rds.aliyuncs.com</DbProxyEndpointConnectString>
        </EndpointConnectItems>
    </EndpointConnectItems>
    <DBProxyConnectStringPort>3306</DBProxyConnectStringPort>
</DescribeDBProxyEndpointResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "DbProxyEndpointReadWriteMode" : "ReadWrite",
  "ReadOnlyInstanceDistributionType" : "Standard",
  "DBProxyConnectString" : "testproxy****.rwlb.rds.aliyuncs.com",
  "RequestId" : "336E33D5-8C02-4265-9627-704BF9F3954B",
  "DBProxyEndpointId" : "keaxncrjluwu0guehzae",
  "DbProxyEndpointAliases" : "proxyterminal-test",
  "DBProxyFeatures" : "TransactionReadSqlRouteOptimizeStatus:1;ConnectionPersist:0;ReadWriteSpliting:1;PinPreparedStmt:0",
  "ReadOnlyInstanceWeight" : "[{\"Availability\":\"Available\",\"DBInstanceId\":\"rr-bp176984qewd8****\",\"DBInstanceType\":\"ReadOnly\",\"Weight\":400},{\"Availability\":\"Available\",\"DBInstanceId\":\"rm-bp1ja4f56s7us****\",\"DBInstanceType\":\"Master\",\"Weight\":0}]",
  "ReadOnlyInstanceMaxDelayTime" : "30",
  "DBProxyConnectStringNetType" : "InnerString",
  "EndpointConnectItems" : {
    "EndpointConnectItems" : [ {
      "DbProxyEndpointNetType" : "2",
      "DbProxyEndpointPort" : "3306",
      "DbProxyEndpointConnectString" : "testproxy****.rwlb.rds.aliyuncs.com"
    }, {
      "DbProxyEndpointNetType" : "0",
      "DbProxyEndpointPort" : "3306",
      "DbProxyEndpointConnectString" : "test****.rwlb.rds.aliyuncs.com"
    } ]
  },
  "DBProxyConnectStringPort" : "3306"
}

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