该接口用于查询PolarDB集群的地址信息。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String DescribeDBClusterEndpoints

系统规定参数,取值:DescribeDBClusterEndpoints。

DBClusterId String pc-xxxxxxxxxx

集群ID。

DBEndpointId String pe-xxxxxxxx

集群地址ID。例如pe-xxxxxxxx。

返回数据

名称 类型 示例值 描述
Items Array

集群地址ID。

AddressItems Array

连接串信息。

ConnectionString String pc-xxxxxxxxxx.w.polardb.cn-qd-pldb1.rds.aliyuncs.com

连接串。

IPAddress String 172.xx.xx.xx

IP地址。

NetType String Private

IP 网络类型:

  • Public(公网)。
  • Private(私网)。
Port String 3306

端口。

PrivateZoneConnectionString String xxx.xxx.xx.com

绑定的私有域名,

VPCId String vpc-xxxxxxxxxx

专有网络ID。

VSwitchId String vsw-xxxxxxxxxx

虚拟交换机ID。

VpcInstanceId String pc-xxxxxxxxxx

VPC实例ID。

AutoAddNewNodes String Enable

新节点是否自动加入默认集群地址:

  • Enable
  • Disable
DBEndpointId String pe-xxxxxxxxxx

地址ID。

EndpointConfig String {\"TrackLSNPerTab\":\"off\",\"ConsistLevel\":\"1\",\"StrictMultiStmt\":\"off\",\"MultiplexingPersistPoolMax\":\"1000\",\"MasterAcceptReads\":\"off\",\"DistributedTransaction\":\"on\",\"PinOnceAfterWrite\":\"off\",\"ConnectionPersist\":\"off\",\"MultiplexingPersistMaxTime\":\"1800\",\"StrictSPCalls\":\"off\",\"CausalConsistRead\":\"1\",\"PersistMaxTime\":\"60\",\"LoadBalanceStrategy\":\"load\",\"PersistPoolMax\":\"200\"}

集群地址的高级配置。

  • DistributedTransaction:事务拆分状态,取值:
    • on:事务拆分处于开启状态。
    • off:事务拆分处于关闭状态。
  • ConsistLevel:会话一致性级别,取值:
    • 0:最终一致性。
    • 1:会话一致性。
  • LoadBalanceStrategy:负载均衡策略,基于负载的自动调度,取值:load
EndpointType String Primary

集群地址类型:

  • Cluster:集群默认地址。
  • Primary:主地址。
  • Custom:自定义集群地址。
Nodes String pi-xxxxxxxxxx,pi-xxxxxxxxxxx

连接地址配置的节点列表。

ReadWriteMode String ReadWrite

读写模式:

  • ReadWrite:可读可写(自动读写分离)。
  • ReadOnly:只读。
RequestId String EBD2201B-DD1C-4282-840E-0001284449A5

请求ID。

示例

请求示例

http(s)://polardb.aliyuncs.com/?Action=DescribeDBClusterEndpoints
&DBClusterId=pc-xxxxxxxxxx
&<公共请求参数>

正常返回示例

XML 格式

<RequestId>EBD2201B-DD1C-4282-840E-0001284449A5</RequestId>
<Items>
    <DBEndpointId>pe-xxxxxxxxxx</DBEndpointId>
    <EndpointType>Primary</EndpointType>
    <AddressItems>
        <PrivateZoneConnectionString>xxx.xxx.xx.com</PrivateZoneConnectionString>
        <VPCId>vpc-xxxxxxxxxx</VPCId>
        <Port>3306</Port>
        <VSwitchId>vsw-xxxxxxxxxx</VSwitchId>
        <VpcInstanceId>pc-xxxxxxxxxx</VpcInstanceId>
        <ConnectionString>pc-xxxxxxxxxx.w.polardb.cn-qd-pldb1.rds.aliyuncs.com</ConnectionString>
        <IPAddress>172.xx.xx.xx</IPAddress>
        <NetType>Private</NetType>
    </AddressItems>
    <Nodes>pi-xxxxxxxxxx</Nodes>
    <EndpointConfig>{}</EndpointConfig>
</Items>
<Items>
    <DBEndpointId>pe-xxxxxxxxxx</DBEndpointId>
    <AutoAddNewNodes>Enable</AutoAddNewNodes>
    <EndpointType>Cluster</EndpointType>
    <AddressItems>
        <VPCId>vpc-xxxxxxxxxx</VPCId>
        <Port>3306</Port>
        <VSwitchId>vsw-xxxxxxxxxx</VSwitchId>
        <VpcInstanceId>pc-xxxxxxxxxx</VpcInstanceId>
        <ConnectionString>pc-xxxxxxxxxx.rwlb.rds.aliyuncs.com</ConnectionString>
        <IPAddress>192.xx.xx.xx</IPAddress>
        <NetType>Private</NetType>
    </AddressItems>
    <Nodes>pi-xxxxxxx,pi-xxxxxxxx</Nodes>
    <ReadWriteMode>ReadWrite</ReadWriteMode>
    <EndpointConfig>{"TrackLSNPerTab":"off","ConsistLevel":"1","StrictMultiStmt":"off","MultiplexingPersistPoolMax":"1000","MasterAcceptReads":"off","DistributedTransaction":"on","PinOnceAfterWrite":"off","ConnectionPersist":"off","MultiplexingPersistMaxTime":"1800","StrictSPCalls":"off","CausalConsistRead":"1","PersistMaxTime":"60","LoadBalanceStrategy":"load","PersistPoolMax":"200"}</EndpointConfig>
</Items>

JSON 格式

{
	"RequestId": "EBD2201B-DD1C-4282-840E-0001284449A5",
	"Items": [
		{
			"DBEndpointId": "pe-xxxxxxxxxx",
			"EndpointType": "Primary",
			"AddressItems": [
				{
					"PrivateZoneConnectionString": "xxx.xxx.xx.com",
					"VPCId": "vpc-xxxxxxxxxx",
					"Port": "3306",
					"VSwitchId": "vsw-xxxxxxxxxx",
					"VpcInstanceId": "pc-xxxxxxxxxx",
					"ConnectionString": "pc-xxxxxxxxxx.w.polardb.cn-qd-pldb1.rds.aliyuncs.com",
					"IPAddress": "172.xx.xx.xx",
					"NetType": "Private"
				}
			],
			"Nodes": "pi-xxxxxxxxxx",
			"EndpointConfig": "{}"
		},
		{
			"DBEndpointId": "pe-xxxxxxxxxx",
			"AutoAddNewNodes": "Enable",
			"EndpointType": "Cluster",
			"AddressItems": [
				{
					"VPCId": "vpc-xxxxxxxxxx",
					"Port": "3306",
					"VSwitchId": "vsw-xxxxxxxxxx",
					"VpcInstanceId": "pc-xxxxxxxxxx",
					"ConnectionString": "pc-xxxxxxxxxx.rwlb.rds.aliyuncs.com",
					"IPAddress": "192.xx.xx.xx",
					"NetType": "Private"
				}
			],
			"Nodes": "pi-xxxxxxx,pi-xxxxxxxx",
			"ReadWriteMode": "ReadWrite",
			"EndpointConfig": "{\"TrackLSNPerTab\":\"off\",\"ConsistLevel\":\"1\",\"StrictMultiStmt\":\"off\",\"MultiplexingPersistPoolMax\":\"1000\",\"MasterAcceptReads\":\"off\",\"DistributedTransaction\":\"on\",\"PinOnceAfterWrite\":\"off\",\"ConnectionPersist\":\"off\",\"MultiplexingPersistMaxTime\":\"1800\",\"StrictSPCalls\":\"off\",\"CausalConsistRead\":\"1\",\"PersistMaxTime\":\"60\",\"LoadBalanceStrategy\":\"load\",\"PersistPoolMax\":\"200\"}"
		}
	]
}

错误码

访问错误中心查看更多错误码。