調(diào)用CreateDBClusterEndpoint接口創(chuàng)建PolarDB自定義集群地址。
調(diào)試
您可以在OpenAPI Explorer中直接運(yùn)行該接口,免去您計算簽名的困擾。運(yùn)行成功后,OpenAPI Explorer可以自動生成SDK代碼示例。
請求參數(shù)
名稱 | 類型 | 是否必選 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | CreateDBClusterEndpoint | 系統(tǒng)規(guī)定參數(shù)。取值:CreateDBClusterEndpoint。 |
DBClusterId | String | 是 | pc-************** | 集群ID。 |
EndpointType | String | 是 | Custom | 自定義集群地址類型,取值固定為Custom。 |
Nodes | String | 否 | pi-**********,pi-********* | 加入目標(biāo)地址的讀負(fù)載節(jié)點(diǎn),多個節(jié)點(diǎn)間用英文逗號(,)分隔。 默認(rèn)為全部節(jié)點(diǎn)。 說明
|
ReadWriteMode | String | 否 | ReadOnly | 讀寫模式,取值范圍如下:
|
AutoAddNewNodes | String | 否 | Disable | 新節(jié)點(diǎn)是否自動加入本地址,取值范圍如下:
默認(rèn)取值為Disable。 |
EndpointConfig | String | 否 | {"ConsistLevel": "1","DistributedTransaction": "on"} | 集群地址的高級配置,格式為JSON,目前支持設(shè)置一致性級別、事務(wù)拆分、主庫不接受讀和連接池。
說明
|
ClientToken | String | 否 | 6000170000591aed949d0f****************** | 用于保證請求的冪等性,防止重復(fù)提交請求。由客戶端生成該參數(shù)值,保證在不同請求間唯一,大小寫敏感、不超過64個ASCII字符。 |
DBEndpointDescription | String | 否 | test | 自定義集群地址名稱。 |
返回數(shù)據(jù)
名稱 | 類型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | CD35F3-F3-44CA-AFFF-BAF869****** | 請求ID。 |
示例
請求示例
http(s)://polardb.aliyuncs.com/?Action=CreateDBClusterEndpoint
&DBClusterId=pc-**************
&EndpointType=Custom
&<公共請求參數(shù)>
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateDBClusterEndpointResponse>
<RequestId>CD35F3-F3-44CA-AFFF-BAF869******</RequestId>
</CreateDBClusterEndpointResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "CD35F3-F3-44CA-AFFF-BAF869******"
}
錯誤碼
HttpCode | 錯誤碼 | 錯誤信息 | 描述 |
---|---|---|---|
400 | ClusterEndpoint.StatusNotValid | Cluster endpoint status is not valid. | 集群地址的狀態(tài)無效. |
400 | EndpointNum.Error | Endpoint number error. | Endpoint號錯誤。 |
400 | LockTimeout | The request processing has failed due to lock timeout. | 由于鎖定超時,請求處理失敗 |
404 | EndpointConfig.Invalid | Endpoint config is invalid. | 集群地址的高級配置參數(shù)無效 |
404 | InvalidDBClusterId.NotFound | The DBClusterId provided does not exist in our records. | 當(dāng)前的記錄中不存在提供的 DBClusterId。 |
404 | EndpointConfig.Conflict | Endpoint config is invalid, CausalConsistRead should be session since node SCC mode enabled. | Endpoint配置無效,CausalConsistRead應(yīng)為會話,因?yàn)楣?jié)點(diǎn)SCC模式已啟用。 |
訪問錯誤中心查看更多錯誤碼。