All Products
Search
Document Center

PolarDB:CreateDBClusterEndpoint

Last Updated:Nov 11, 2025

Creates a custom cluster endpoint for a PolarDB cluster.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

polardb:CreateDBClusterEndpoint

create

*DBCluster

acs:polardb:{#regionId}:{#accountId}:dbcluster/{#DbClusterId}

None None

Request parameters

Parameter

Type

Required

Description

Example

DBClusterId

string

Yes

The ID of the cluster.

pc-**************

EndpointType

string

Yes

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

Custom

Nodes

string

No

The nodes to add to the endpoint. Separate multiple node IDs with commas (,). By default, all nodes are added.

Note
  • For PolarDB for MySQL, specify the node IDs.

  • For PolarDB for PostgreSQL and PolarDB for PostgreSQL (compatible with Oracle), specify the role names of the nodes, such as Writer,Reader1,Reader2.

  • If you set ReadWriteMode to ReadOnly, you can add only one node. However, if this node fails, the endpoint may be unavailable for up to 1 hour. Do not use this configuration in a production environment. Add at least two nodes to improve availability.

  • If you set ReadWriteMode to ReadWrite, you must add at least two nodes. * For PolarDB for MySQL, you can select any two nodes. If both nodes are read-only nodes, write requests are sent to the primary node. * For PolarDB for PostgreSQL and PolarDB for PostgreSQL (compatible with Oracle), you must include the primary node.

pi-**********,pi-*********

ReadWriteMode

string

No

The read/write mode. Valid values:

  • ReadWrite: read and write (automatic read/write splitting).

  • ReadOnly (default): read-only.

ReadOnly

AutoAddNewNodes

string

No

Specifies whether to automatically add new nodes to the endpoint. Valid values:

  • Enable: New nodes are automatically added to the endpoint.

  • Disable (default): New nodes are not automatically added to the endpoint.

Disable

EndpointConfig

string

No

The advanced configurations of the cluster endpoint. The value is a JSON string. You can configure the consistency level, transaction splitting, connection pool, and whether to offload reads from the primary node.

  • Configure the load balancing policy. The format is {"LoadBalancePolicy":"policy"}. Valid values:
    • 0: Connections-based load balancing (default).

    • 1: Active requests-based load balancing.

  • Configure the consistency level. The format is {"ConsistLevel":"level"}. Valid values:
    • 0: Eventual consistency.

    • 1: Session consistency (default).

    • 2: Global consistency.

  • Configure transaction splitting. The format is {"DistributedTransaction":"status"}. Valid values:
    • on: Enable transaction splitting (default).

    • off: Disable transaction splitting.

  • Configure whether to offload reads from the primary node. The format is {"MasterAcceptReads":"status"}. Valid values:
    • on: The primary node accepts read requests.

    • off: The primary node does not accept read requests (default).

  • Configure the connection pool. The format is {"ConnectionPersist":"pool"}. Valid values:
    • off: Disable the connection pool (default).

    • Session: Enable the session-level connection pool.

    • Transaction: Enable the transaction-level connection pool.

  • Configure parallel query. The format is {"MaxParallelDegree":"degree"}. Valid values:
    • A specific degree of parallelism. Example: "MaxParallelDegree":"2".

    • off: Disable parallel query (default).

  • Configure automatic routing between row store and column store. The format is {"EnableHtapImci":"status"}. Valid values:
    • on: Enable automatic routing between row store and column store.

    • off: Disable automatic routing between row store and column store (default).

  • Configure whether to enable overload protection. The format is {"EnableOverloadThrottle":"status"}. Valid values:
    • on: Enable overload protection.

    • off: Disable overload protection (default).

Note
  • You can configure transaction splitting, whether to offload reads from the primary node, the connection pool, and overload protection only when the read/write mode of the cluster endpoint for PolarDB for MySQL is set to ReadWrite (automatic read/write splitting).

  • When the read/write mode of a cluster endpoint for PolarDB for MySQL is read-only, both connections-based load balancing and active requests-based load balancing are supported. When the read/write mode is ReadWrite (automatic read/write splitting), only active requests-based load balancing is supported.

  • You can configure automatic routing between row store and column store when the read/write mode of the cluster endpoint for PolarDB for MySQL is ReadWrite (automatic read/write splitting), or when the read/write mode is read-only and the load balancing policy is active requests-based load balancing.

  • Only PolarDB for MySQL supports global consistency.

  • If you set ReadWriteMode to ReadOnly, you can only set the consistency level to 0.

  • You can configure the consistency level, transaction splitting, whether to offload reads from the primary node, and the connection pool at the same time. For example: {"ConsistLevel":"1","DistributedTransaction":"on","ConnectionPersist":"Session","MasterAcceptReads":"on"}.

  • The transaction splitting setting is constrained by the consistency level setting. For example, if the consistency level is 0, you cannot enable transaction splitting. If the consistency level is 1 or 2, you can enable transaction splitting.

{"ConsistLevel": "1","DistributedTransaction": "on"}

ClientToken

string

No

A 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 is case-sensitive and cannot exceed 64 ASCII characters.

6000170000591aed949d0f******************

DBEndpointDescription

string

No

The name of the custom cluster endpoint.

test

SccMode

string

No

Specifies whether to enable the global consistency (high-performance mode) feature for the node. Valid values:

  • ON: Enable

  • OFF: Disable

on

PolarSccWaitTimeout

string

No

The timeout period for global consistency.

100

PolarSccTimeoutAction

string

No

The policy for handling global consistency read timeouts. Valid values:

  • 0: Send the request to the primary node.

  • 2: Degrade to regular requests. If a global consistency read times out, the query is automatically degraded to a regular request, and the client does not receive an error message.

0

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

CD35F3-F3-44CA-AFFF-BAF869******

Examples

Success response

JSON format

{
  "RequestId": "CD35F3-F3-44CA-AFFF-BAF869******"
}

Error response

JSON format

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

Error codes

HTTP status code

Error code

Error message

Description

400 ClusterEndpoint.StatusNotValid Cluster endpoint status is not valid. The state of the cluster endpoint is invalid.
400 EndpointNum.Error Endpoint number error. The maximum number of endpoints is exceeded.
400 LockTimeout The request processing has failed due to lock timeout. Failed to process the request due to a lock timeout.
403 OperationDenied.InstanceType The operation is not permitted due to instance type. The operation is not allowed due to the instance type
404 EndpointConfig.Invalid Endpoint config is invalid. The advanced parameter of the cluster endpoint is invalid.
404 InvalidDBClusterId.NotFound The DBClusterId provided does not exist in our records. The specified DBClusterId parameter does not exist in the current record.
404 EndpointConfig.Conflict Endpoint config is invalid, CausalConsistRead should be session since node SCC mode enabled. Endpoint the configuration is invalid, the CausalConsistRead should be a session because global consistency (high performance mode) for the node is enabled.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.