You need to enable JavaScript to run this app.
RDS for MySQL

RDS for MySQL

Copy page
Download PDF
Managing connections
CreateDBEndpoint
Copy page
Download PDF
CreateDBEndpoint

Call the CreateDBEndpoint API to create a connection endpoint (Endpoint).

Request type

Asynchronous request.

Precautions

Only double-node instances support creating connection endpoints.

Request parameters

Name
Type
Required
Example
Description
InstanceId
String
Yes
mysql-e26822cf****
Instance ID.
EndpointType
String
Yes
Custom
Connection terminal type. The value is Custom, a custom terminal.
ReadWriteMode
String
No
ReadOnly

Connection terminal read and write mode. Values:

  • ReadWrite: Read and write.
  • ReadOnly: Read only.

tip

When this parameter is used as a request parameter, the default value is ReadWrite.

EndpointName
String
No
EndpointName

The name of the instance connection endpoint.

  • Cannot start with a number or hyphen (-).
  • Can only contain Chinese characters, letters, numbers, underscores (_), and hyphens (-).
  • Length must be between 1 and 64 characters.
Description
String
No
This is a remark for the connection endpoint.
Remarks.
Nodes
String
No
Primary,mysql-3c25f219****-r5b3f

List of node IDs configured for the connection endpoint.
Required when EndpointType is Custom.

tip

  • To add the primary node to the endpoint, simply enter Primary without specifying the primary node ID.
  • Separate multiple node IDs with commas (,).
AutoAddNewNodes
Boolean
No
true

When the endpoint type is read-write or read-only, you can configure whether new nodes are automatically added. Valid values:

  • true: Automatically added.
  • false: Not automatically added (default).
ConnectionMode
String
No
Proxy

Connection terminal type. Values:

  • Proxy: Proxy terminal.
  • Direct: Direct connection terminal.

tip

  • You can call the DescribeDBInstanceDetail interface to query the enabled status of the instance database proxy function.
    • If the database proxy function of the instance is enabled, the value can be Proxy or Direct.
    • If the database proxy function of the instance is not enabled, the value can only be Direct.
  • Adjusting the connection terminal type of a multi-node instance is not supported.
IdleConnectionReclaim
Boolean
No
true

Whether to enable idle connection recycling for proxy endpoints. Valid values:

  • true: Yes.
  • false: No (default).
ConnectionPoolType
String
No
Transaction

The type of the connection pool. This parameter is returned only when the database proxy is enabled. Valid values:

  • Direct: Direct connection mode.
  • Transaction: Transaction-level connection pool.
ReadWriteSpliting
Boolean
No
true

Whether to enable read-write splitting. Valid values:

  • true: Yes (default).
  • false: No.
ReadOnlyNodeDistributionType
String
No
LoadSchedule

Read the weight distribution mode. This parameter is required when the read-write separation setting is set to true. When used as a request parameter in the CreateDBEndpoint and ModifyDBEndpoint interfaces, the value range is as follows:

  • LoadSchedule: Load scheduling.
  • RoundRobinCustom: Round-robin scheduling with custom weights.
  • RoundRobinAuto: Round-robin scheduling with automatically assigned weights.

When used as a return parameter in the DescribeDBInstanceDetail interface, the value range is as follows:

  • Default: Automatically assigned according to the specification weights.
  • Custom: Custom weight distribution.
  • RoundRobin: Round-robin scheduling.
  • LoadSchedule: Load scheduling.
  • RoundRobinCustom: Round-robin scheduling with custom weights.
  • RoundRobinAuto: Round-robin scheduling with automatically assigned weights.

tip

Multi-node instances only support the value RoundRobinAuto.

ReadOnlyNodeWeight
Object[]
No
Refer to the request example.
Custom read weight allocation policy.
NodeId
String
No
mysql-050b3e08****-2
The read-only node needs to pass in the NodeId, while the master node does not need to pass in.
NodeType
String
No
Primary

Node types.

  • Primary: Primary node.
  • ReadOnly: Read-only node.
Weight
Integer
No
100

The read weight of the node, increasing by 100, with a maximum value of 10000.

tip

The weights cannot all be set to 0.

ReadOnlyNodeMaxDelayTime
Integer
No
40
Read-only node delay threshold. Valid range: 1~3600, default: 30, unit: seconds.
MultiStatementsMode
String
No
Loose

Multi-Statements mode of the proxy terminal. Values:

  • Strict: Strict mode. Default value.
  • Loose: Loose mode.
OverloadProtection
Boolean
No
false

Whether to enable overload protection. Valid values:

  • true: Yes (default).
  • false: No.

tip

Only proxy endpoints support this setting.

MasterProtectorTimeout
Integer
No
60

Overload protection timeout. Valid range: 60~7200 (integer), default: 60, unit: seconds.

tip

Only proxy endpoints support this setting.

MasterNodeRouting
Boolean
No
false

Whether to enable primary node routing. Valid values:

  • true: Yes.
  • false: No (default).

tip

Only proxy endpoints support this setting.

ImplicitTransSplit
Boolean
No
false

Whether to enable transaction separation. Valid values:

  • true: Yes.
  • false: No (default).

tip

Only proxy endpoints support this setting.

EnableConnectionPersistent
Boolean
No
true

Whether to enable the connection keep-alive function for the connection to the terminal. Values:

  • true: Yes.
  • false: No.

tip

Only the proxy terminal supports this setting.

Response parameters

null

Name
Type
Example
Description
InstanceId
String
mysql-3c25f219****
Instance ID.
EndpointId
String
mysql-3c25f219****-custom-eeb5
Endpoint ID.

Sample request

POST /?Action=CreateDBEndpoint&Version=2022-01-01 HTTP/1.1
Content-Type: application/json
Host: rds-mysql.cn-beijing.volcengineapi.com
X-Date: 20211202T101010Z
Authorization: HMAC-SHA256 Credential=AKLTN2I0MmFiNzMxNWE5NDgzMzk4MmVjMTVkODlkZTZ****/20211202/cn-beijing/rds_mysql/request,SignedHeaders=x-date, Signature=71d31fc7bcf990142851c9833c5656391486cda0ae2e0b8ada733b7c6458****
{
    "InstanceId": "mysql-3c25f219****",
    "EndpointName": "自定义终端",
    "EndpointType": "Custom",
    "Nodes": "Primary",
    "ReadWriteMode": "ReadWrite",
    "AutoAddNewNodes": true
}

Sample response

{
    "ResponseMetadata": {
        "RequestId": "20230302225000051F23B8DD57341993BE",
        "Action": "CreateDBEndpoint",
        "Version": "2022-01-01",
        "Service": "rds_mysql",
        "Region": "cn-beijing"
    },
    "Result": {
        "EndpointId": "mysql-f23648f2****-custom-eeb5",
        "InstanceId": "mysql-f23648f2****"
    }
}

Error codes

For more details, refer to Error codes.

Last updated: 2025.08.20 15:48:11