Creates a custom cluster endpoint in PolarDB for MySQL.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String No CreateDBClusterEndpoint

The operation that you want to perform. Set the value to CreateDBClusterEndpoint.

DBClusterId String Yes pc-xxxxxxxxxxxxx

The ID of the cluster.

EndpointType String Yes Custom

The type of the cluster endpoint. Set the value to Custom.

Nodes String No pi-bpxxxxxxxx,pi-bpxxxxxxxx

The nodes to be associated with the cluster endpoint to process read requests. Separate the nodes with commas (,). By default, all the nodes in the specified cluster are associated with the cluster endpoint.

Note
  • If the ReadWriteMode parameter is set to ReadOnly, only one node can be associated with the cluster endpoint. If the only node becomes faulty, the cluster endpoint may be unavailable for up to 1 hour. We recommend that you do not associate only one node with the cluster endpoint in the production environment. We recommend that you associate at least two nodes with the cluster endpoint to improve service availability.
  • If the ReadWriteMode parameter is set to ReadWrite, you must associate at least two nodes with the cluster endpoint.
  • Write requests are sent to only the primary node.
ReadWriteMode String No ReadOnly

The read/write mode of the cluster endpoint. Valid values:

  • ReadWrite: receives and forwards read and write requests. Automatic read/write splitting is enabled.
  • ReadOnly: receives and forwards only read requests.

    Default value: ReadOnly.

AutoAddNewNodes String No Disable

Specifies whether to automatically associate new nodes with the cluster endpoint. Valid values:

  • Enable
  • Disable

Default value: Disable.

EndpointConfig String No {"ConsistLevel": "1","DistributedTransaction": "on"}

The advanced configuration of the cluster endpoint. The advanced configuration is JSON-formatted. You can specify the settings of the consistency level and the transaction splitting feature.

Specify the consistency level in the format of {"ConsistLevel": "Consistency level"}.

Valid values for the consistency level:

  • 0: eventual consistency
  • 1: session consistency. The value 1 is the default value.

Specify the transaction splitting feature in the format of {"DistributedTransaction":"Transaction splitting settings"}.

Valid values for the transaction splitting feature:

  • on: enables the transaction splitting feature. By default, the feature is enabled.
  • off: disables the transaction splitting feature.
Note
  • If the ReadWriteMode parameter is set to ReadOnly, the value for the consistency level must be 0.
  • You can use one record to specify the settings of the consistency level and the transaction splitting feature, such as {"ConsistLevel": "1","DistributedTransaction": "on"}.
  • The setting of the transaction splitting feature is affected by the specified consistency level. For example, if the consistency level parameter is set to 0, the transaction splitting feature cannot be enabled. If the consistency level parameter is set to 1, the transaction splitting feature can be enabled.
ClientToken String No 6000170000591aed949d0fxxxxxxxxxxxxxxxxxxxxxxx

The client token that is used to ensure the idempotence of the requests. If an API operation is idempotent, the API operation returns the same result for identical requests. The value of this parameter is generated by the client and must be unique among different requests. The value is case-sensitive and can be a maximum of 64 ASCII characters in length.

Response parameters

Parameter Type Example Description
RequestId String CD35F3-F3-44CA-AFFF-BAF869666D6B

The ID of the request.

Examples

Sample requests

http(s)://polardb.aliyuncs.com/? Action=CreateDBClusterEndpoint
&DBClusterId=pc-xxxxxxxxxxxxx
&EndpointType=Custom
&<Common request parameters>

Sample success responses

XML format

<CreateDBClusterEndpointResponse>  
      <RequestId>CD35F3-F3-44CA-AFFF-BAF869666D6B</RequestId>
</CreateDBClusterEndpointResponse>

JSON format

{
    "RequestId": "CD35F3-F3-44CA-AFFF-BAF869666D6B"
}

Error codes

For a list of error codes, visit the API Error Center.