Queries the endpoints of a specified PolarDB cluster.

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

ParameterTypeRequiredExampleDescription
ActionStringYesDescribeDBClusterEndpoints

The operation that you want to perform. Set the value to DescribeDBClusterEndpoints.

DBClusterIdStringYespc-*************

The ID of the cluster.

Note You can call the DescribeDBClusters operation to query the details of the clusters that belong to your Alibaba Cloud account, such as cluster IDs.
DBEndpointIdStringNope-*************

The ID of the endpoint.

Response parameters

ParameterTypeExampleDescription
RequestIdString2DC120BF-6EBA-4C63-BE99-B09F9E******

The ID of the request.

ItemsArray of DBEndpoint

Details about endpoints

NodeWithRolesStringReader1

The role name of each node in the endpoint. The role name of the primary node is Writer. Multiple read-only nodes can be associated with an endpoint. Therefore, the role name of each read-only node is suffixed with a number. For example, you can use Reader1 and Reader2 as the role names.

Note This parameter is returned for only PolarDB for PostgreSQL clusters and PolarDB for PostgreSQL(Compatible with Oracle) clusters.
NodesStringpi-***************,pi-***************

The list of nodes that have endpoints.

ReadWriteModeStringReadOnly

The read/write mode. Valid values:

  • ReadWrite: receives and forwards read and write requests. Automatic read/write splitting is enabled.
  • ReadOnly: The account has the read-only permissions on the database.
AddressItemsArray of Address

Details about endpoints.

VSwitchIdStringvsw-************

The vSwitch ID of the endpont.

PrivateZoneConnectionStringString***.***.**.com

The private domain name that is bound to the endpoint.

ConnectionStringString********.rwlb.polardb-pg-public.rds.aliyuncs.com

The endpoint of the cluster.

NetTypeStringPrivate

The network type of the endpoint. Valid values:

  • Public
  • Private

PortString1521

The port number.

VpcInstanceIdStringpe-*************

The VPC ID of the cluster.

Note This parameter is returned for only PolarDB for MySQL clusters.
VPCIdStringvpc-***************

The VPC ID of the endpoint.

IPAddressString192.***.***.***

The IP address of the endpoint.

DBEndpointIdStringpe-*************

The ID of the endpoint.

EndpointConfigString{\"DistributedTransaction\":\"off\",\"ConsistLevel\":\"0\",\"LoadBalanceStrategy\":\"load\",\"MasterAcceptReads\":\"on\"}

The advanced configurations of the endpoint.

  • DistributedTransaction: indicates whether transaction splitting is enabled. Valid values:
    • on
    • off
  • ConsistLevel: the consistency level of sessions. Valid values:
    • 0: eventual consistency.
    • 1: session consistency
    • 2: global consistency.
  • LoadBalanceStrategy: the load balancing policy that automatically schedules loads. Set the value to load.
  • MasterAcceptReads: indicates whether the primary node processes read requests. Valid values:
    • on
    • off
DBEndpointDescriptionStringtest

The name of the endpoint.

EndpointTypeStringCustom

The type of the endpoint. Valid values:

  • Cluster: default endpoint
  • Primary: primary endpoint
  • Custom: a custom cluster endpoint
AutoAddNewNodesStringEnable

Indicates whether newly added nodes are automatically associated with the default cluster endpoint. Valid values:

  • Enable
  • Disable
DBClusterIdStringpc-bp1s826a1up******

The ID of the cluster.

Examples

Sample requests

http(s)://polardb.aliyuncs.com/?Action=DescribeDBClusterEndpoints
&DBClusterId=pc-*************
&DBEndpointId=pe-*************
&<Common request parameters>

Sample success responses

XML format

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

<DescribeDBClusterEndpointsResponse>
    <RequestId>2DC120BF-6EBA-4C63-BE99-B09F9E******</RequestId>
    <Items>
        <NodeWithRoles>Reader1</NodeWithRoles>
        <Nodes>pi-***************,pi-***************</Nodes>
        <ReadWriteMode>ReadOnly</ReadWriteMode>
        <AddressItems>
            <VSwitchId>vsw-************</VSwitchId>
            <PrivateZoneConnectionString>***.***.**.com</PrivateZoneConnectionString>
            <ConnectionString>********.rwlb.polardb-pg-public.rds.aliyuncs.com</ConnectionString>
            <NetType>Private</NetType>
            <Port>1521</Port>
            <VpcInstanceId>pe-*************</VpcInstanceId>
            <VPCId>vpc-***************</VPCId>
            <IPAddress>192.***.***.***</IPAddress>
        </AddressItems>
        <DBEndpointId>pe-*************</DBEndpointId>
        <EndpointConfig>{\"DistributedTransaction\":\"off\",\"ConsistLevel\":\"0\",\"LoadBalanceStrategy\":\"load\",\"MasterAcceptReads\":\"on\"}</EndpointConfig>
        <DBEndpointDescription>test</DBEndpointDescription>
        <EndpointType>Custom</EndpointType>
        <AutoAddNewNodes>Enable</AutoAddNewNodes>
        <DBClusterId>pc-bp1s826a1up******</DBClusterId>
    </Items>
</DescribeDBClusterEndpointsResponse>

JSON format

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

{
  "RequestId" : "2DC120BF-6EBA-4C63-BE99-B09F9E******",
  "Items" : [ {
    "NodeWithRoles" : "Reader1",
    "Nodes" : "pi-***************,pi-***************",
    "ReadWriteMode" : "ReadOnly",
    "AddressItems" : [ {
      "VSwitchId" : "vsw-************",
      "PrivateZoneConnectionString" : "***.***.**.com",
      "ConnectionString" : "********.rwlb.polardb-pg-public.rds.aliyuncs.com",
      "NetType" : "Private",
      "Port" : "1521",
      "VpcInstanceId" : "pe-*************",
      "VPCId" : "vpc-***************",
      "IPAddress" : "192.***.***.***"
    } ],
    "DBEndpointId" : "pe-*************",
    "EndpointConfig" : "{\\\"DistributedTransaction\\\":\\\"off\\\",\\\"ConsistLevel\\\":\\\"0\\\",\\\"LoadBalanceStrategy\\\":\\\"load\\\",\\\"MasterAcceptReads\\\":\\\"on\\\"}",
    "DBEndpointDescription" : "test",
    "EndpointType" : "Custom",
    "AutoAddNewNodes" : "Enable",
    "DBClusterId" : "pc-bp1s826a1up******"
  } ]
}

Error codes

HttpCodeError codeError messageDescription
404InvalidDBCluster.NotFoundThe DBClusterId provided does not exist in our records.The error message returned because the specified DBClusterId does not exist in the current record.
404InvalidDBClusterId.NotFoundThe DBClusterId provided does not exist in our records.The error message returned because the specified DBClusterId does not exist in the current record.

For a list of error codes, visit the API Error Center.