All Products
Search
Document Center

PolarDB:DescribeDBClusterEndpoints

最終更新日:Oct 17, 2024

Queries the endpoints of a PolarDB cluster.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
DBClusterIdstringYes

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.
pc-*************
DBEndpointIdstringNo

The ID of the endpoint.

pe-*************

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

2DC120BF-6EBA-4C63-BE99-B09F9E******
Itemsarray<object>

The information about the endpoints.

DBEndpointobject
NodeWithRolesstring

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, such as Reader1 and Reader2.

Note This parameter is valid only for PolarDB for PostgreSQL clusters and PolarDB for PostgreSQL (Compatible with Oracle)) clusters.
Reader1
Nodesstring

The nodes in the endpoint.

pi-***************,pi-***************
ReadWriteModestring

The read/write mode. Valid values:

  • ReadWrite: handles read and write requests. Automatic read/write splitting is enabled.
  • ReadOnly: handles read-only requests.
ReadOnly
AddressItemsarray<object>

The details of the endpoint.

Addressobject

1

VSwitchIdstring

The ID of the vSwitch.

vsw-************
PrivateZoneConnectionStringstring

The private domain name that is bound to the endpoint.

***.***.**.com
ConnectionStringstring

The endpoint.

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

The network type of the endpoint. Valid values:

  • Public
  • Private
Private
Portstring

The port.

1521
VpcInstanceIdstring

The ID of the virtual private cloud (VPC) instance.

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

The ID of the VPC.

vpc-***************
IPAddressstring

The IP address.

192.***.***.***
DBEndpointIdstring

The ID of the endpoint.

pe-*************
EndpointConfigstring

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. Only load may be returned.

  • MasterAcceptReads: indicates whether the primary node processes read requests. Valid values:

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

The name of the endpoint.

test
EndpointTypestring

The type of the endpoint. Valid values:

  • Cluster: the default endpoint.
  • Primary: the primary endpoint.
  • Custom: a custom cluster endpoint.
Custom
AutoAddNewNodesstring

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

  • Enable
  • Disable
Enable
DBClusterIdstring

The ID of the cluster.

pc-bp1s826a1up******

Examples

Sample success responses

JSONformat

{
  "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******",
      "SccMode": "",
      "PolarSccTimeoutAction": "",
      "PolarSccWaitTimeout": ""
    }
  ]
}

Error codes

HTTP status codeError codeError messageDescription
404InvalidDBCluster.NotFoundThe DBClusterId provided does not exist in our records.The specified DBClusterId parameter does not exist in the current record.
404InvalidDBClusterId.NotFoundThe DBClusterId provided does not exist in our records.The specified DBClusterId parameter does not exist in the current record.
404InvalidDBClusterId.MalformedThe specified parameter DBClusterId is not valid.The specified DBClusterId parameter is invalid.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-07-30The Error code has changed. The response structure of the API has changedView Change Details
2023-09-12The Error code has changedView Change Details
2023-07-20The Error code has changed. The request parameters of the API has changedView Change Details
2023-05-11The Error code has changedView Change Details
2022-07-13The Error code has changedView Change Details