Creates a custom cluster endpoint for a specified PolarDB cluster.
Debugging
Request parameter
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateDBClusterEndpoint | The operation that you want to perform. The operation that you want to perform. Set the value to CreateDBClusterEndpoint. |
DBClusterId | String | Yes | pc-************** | The ID of the cluster. |
EndpointType | String | Yes | Custom | The type of the cluster endpoint. Set the value to Custom. |
Nodes | String | No | pi-**********,pi-********* | The reader nodes to be associated with the endpoint. If you need to specify multiple reader nodes, separate the reader nodes with commas (,). If you do not specify this parameter, all nodes are used by default. Note
|
ReadWriteMode | String | No | ReadOnly | The read/write mode. Valid values:
|
AutoAddNewNodes | String | No | Disable | Specifies whether to automatically associate newly added nodes with the cluster endpoint. Valid values:
Default value: Disable. |
EndpointConfig | String | No | {"ConsistLevel": "1","DistributedTransaction": "on"} | The advanced configurations of the cluster endpoint. You must specify the configurations in the JSON format. You can specify the configurations of the following attributes: consistency level, transaction splitting, connection pool, and offload reads from the primary node.
Note
|
ClientToken | String | No | 6000170000591aed949d0f****************** | The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length. The token is case-sensitive. |
DBEndpointDescription | String | No | test | The name of the custom cluster endpoint. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | CD35F3-F3-44CA-AFFF-BAF869****** | The ID of the request. |
Examples
Sample requests
http(s)://polardb.aliyuncs.com/?Action=CreateDBClusterEndpoint
&DBClusterId=pc-**************
&EndpointType=Custom
&<Common request parameters>
Sample success response
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateDBClusterEndpointResponse>
<RequestId>CD35F3-F3-44CA-AFFF-BAF869******</RequestId>
</CreateDBClusterEndpointResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "CD35F3-F3-44CA-AFFF-BAF869******"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | ClusterEndpoint.StatusNotValid | Cluster endpoint status is not valid. | The error message returned because the status of the cluster endpoint is invalid. |
400 | EndpointNum.Error | Endpoint number error. | The error message returned because the endpoint number is invalid. |
404 | EndpointConfig.Invalid | Endpoint config is invalid. | The error message returned because the advanced configurations of the cluster endpoint are invalid. |
404 | InvalidDBClusterId.NotFound | The DBClusterId provided does not exist in our records. | The error message returned because the specified DBClusterId does not exist in the current record. |
404 | EndpointConfig.Conflict | Endpoint config is invalid, CausalConsistRead should be session since node SCC mode enabled. | The error message returned because the endpoint configurations are invalid. CausalConsistRead must be a session because the SCC mode is enabled on the node. |
For a list of error codes, visit the API Error Center.