Overview
You can call this API to create a private read/write split endpoint for a tenant of an ApsaraDB for OceanBase cluster instance. By configuring a read/write split endpoint, you can distribute read and write requests to different database nodes, thereby improving the database's concurrency processing capability and overall performance.
API details
Constraints
The caller must have an AccessKey for accessing the multi-cloud API. For information about how to obtain the AccessKey ID and AccessKey secret, see Manage AccessKeys.
Request path
POST /api/v2/instances/{instanceId}/tenants/{tenantId}/privatelink/readwrite
Request parameters
Path
Name |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| instanceId | string | Yes | The ID of the ApsaraDB for OceanBase cluster instance. | obcluster-***** |
| tenantId | string | Yes | The ID of the tenant. | t4louaeei**** |
Query
Name |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| requestId | string | Yes | The ID of the request. This parameter is used for tracing. | dc302d76-66b5-48d8-ab53-a035******** |
Body
Name |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| zoneIdList | array[string] | No | The list of zone IDs.
NoteIf you specify proxy settings through ProxySetting, this parameter is already included and does not need to be specified again. |
["zone1", "zone2"] |
| userAccount | string | Yes | The user account. | "test_user" |
| trafficStrategy | string | Yes | The traffic strategy. | "strategy_round_robin" |
| replicaParams | string | Yes | The replica parameters. | "{"replicaCount": 2}" |
| disasterRecoveryReplicaParams | string | No | The disaster recovery replica parameters. | "{"drReplicaCount": 1}" |
| balancedStrategy | string | No | The balanced strategy. | "balanced" |
| disasterRecoveryStrategy | string | No | The disaster recovery strategy. | "active-passive" |
| serviceType | string | Yes | The address type. | OBPROXY_READWRITE |
| ProxySetting | Object | No | The proxy settings.
NoteThis parameter is supported only for instances created through the AWS channel. |
|
| -mode | String | No | The type of the proxy cluster specification. Valid values: k8s_shared and k8s_exclusive. | k8s_shared |
| -deploymentArchitecture | String | No | The deployment scheme of the proxy cluster.
|
DUAL_AZ_ACTIVE_ACTIVE_DEPLOYMENT |
| -zone | Array | No | The zone of the primary node. | ["us-east-1a","us-east-1b"] |
| -slaveZone | Array | No | The zone of the standby node. This parameter is required only if you choose the dual- or triple-zone active-standby deployment scheme. | [] |
| -nodeCpu | Float | No | The node specification. | Minimum value: 0.5. The increment step is 0.5. |
Response parameters
Parameter |
Type |
Description |
|---|---|---|
| code | string | The return code. |
| message | string | The return message. |
| data | object | The returned data object. |
| data.resourceId | string | The resource ID of the created private read/write split endpoint. |
| data.status | string | The status of the resource creation. |
| data.requestId | string | The ID of the request. |
Examples
Request example
Example 1: You can specify the proxy settings in the ProxySetting parameter.
curl -X POST \
'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/tenants/{tenantId}/privatelink/readwrite?requestId={requestId}' \
-H 'Content-Type: application/json' \
-u '<Your ak:sk>' \
-d '{
"userAccount": "test_user",
"trafficStrategy": "strategy_round_robin",
"replicaParams": "{\"replicaCount\": 2}",
"disasterRecoveryReplicaParams": "{\"drReplicaCount\": 1}",
"balancedStrategy": "balanced",
"disasterRecoveryStrategy": "active-passive",
"serviceType": "OBPROXY_READWRITE",
"proxySetting":{"mode":"k8s_shared","deploymentArchitecture":"DUAL_AZ_ACTIVE_ACTIVE_DEPLOYMENT","nodeCpu":0.5,"zone":["us-east-1a","us-east-1b"],"slaveZone":[]}
}'
Example 2: You can specify the list of zones in the zoneIdList parameter.
curl -X POST \
'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/tenants/{tenantId}/privatelink/readwrite?requestId={requestId}' \
-H 'Content-Type: application/json' \
-u '<Your ak:sk>' \
-d '{
"zoneIdList": ["zone1", "zone2"],
"userAccount": "test_user",
"trafficStrategy": "strategy_round_robin",
"replicaParams": "{\"replicaCount\": 2}",
"disasterRecoveryReplicaParams": "{\"drReplicaCount\": 1}",
"balancedStrategy": "balanced",
"disasterRecoveryStrategy": "active-passive",
"serviceType": "OBPROXY_READWRITE",
}'
Response example
{
"code": "200",
"message": "success",
"data": {
"resourceId": "privatelink-rw-xxxxxx",
"status": "Creating",
"requestId": "xxxxxx"
},
"server": "xxx.xxx.x.xxx:xxxx"
}
