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

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 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 pooling feature. Valid values: 0, 1, and 2. The value 0 indicates that the connection pooling feature is disabled. The value 1 indicates that the session connection pooling feature is enabled. The value 2 indicates that the transaction connection pooling 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\":\"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:

  • DBInstanceId: the ID of the instance.
  • DBInstanceType: the role of the instance. Valid values: Master and ReadOnly.
  • NodeID: the IDs of the primary and secondary nodes on the primary instance if the instance runs RDS Cluster Edition.
  • NodeType: the type of the node if the instance runs RDS Cluster Edition. Valid values: Primary and Secondary. The value Primary indicates the primary node on the primary instance. The value Secondary indicates the secondary node on the primary instance.
  • Weight: the read weight of the instance. The read weight increases in increments of 100 and cannot exceed 10000.
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 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:

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