调用CreateDBClusterEndpoint接口创建PolarDB自定义集群地址。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | CreateDBClusterEndpoint | 系统规定参数。取值:CreateDBClusterEndpoint。 |
DBClusterId | String | 是 | pc-************** | 集群ID。 |
EndpointType | String | 是 | Custom | 自定义集群地址类型,取值固定为Custom。 |
Nodes | String | 否 | pi-**********,pi-********* | 加入目标地址的读负载节点,多个节点间用英文逗号(,)分隔。 默认为全部节点。 说明
|
ReadWriteMode | String | 否 | ReadOnly | 读写模式,取值范围如下:
|
AutoAddNewNodes | String | 否 | Disable | 新节点是否自动加入本地址,取值范围如下:
默认取值为Disable。 |
EndpointConfig | String | 否 | {"ConsistLevel": "1","DistributedTransaction": "on"} | 集群地址的高级配置,格式为JSON,目前支持设置一致性级别、事务拆分、主库不接受读和连接池。
说明
|
ClientToken | String | 否 | 6000170000591aed949d0f****************** | 用于保证请求的幂等性,防止重复提交请求。由客户端生成该参数值,保证在不同请求间唯一,大小写敏感、不超过64个ASCII字符。 |
DBEndpointDescription | String | 否 | test | 自定义集群地址名称。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | CD35F3-F3-44CA-AFFF-BAF869****** | 请求ID。 |
示例
请求示例
http(s)://polardb.aliyuncs.com/?Action=CreateDBClusterEndpoint
&DBClusterId=pc-**************
&EndpointType=Custom
&<公共请求参数>
正常返回示例
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. | 集群地址的状态无效. |
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. | 集群地址的高级配置参数无效 |
404 | InvalidDBClusterId.NotFound | The DBClusterId provided does not exist in our records. | 当前的记录中不存在提供的 DBClusterId。 |
404 | EndpointConfig.Conflict | Endpoint config is invalid, CausalConsistRead should be session since node SCC mode enabled. | Endpoint配置无效,CausalConsistRead应为会话,因为节点SCC模式已启用。 |
访问错误中心查看更多错误码。