Overview
You can call this API to create a private IP address for a tenant in a specified OceanBase Cloud instance. By configuring this IP address, you can access the read-only replicas of the tenant in a private network environment. This is suitable for business scenarios where read and write traffic need to be separated. After the request is successful, the created resource information will be returned.
API details
Constraints
The caller must have an AccessKey for accessing multi-cloud APIs. 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/readonly
Request parameters
Path
Name |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| instanceId | string | Yes | The ID of the OceanBase Cloud instance. | obcluster-***** |
| tenantId | string | Yes | The ID of the tenant. | t4louaeei**** |
Query
Name |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| requestId | string | Yes | The request ID, used for tracking. | dc302d76-66b5-48d8-ab53-a035******** |
Body
Name |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| zoneIdList | array[string] | No | The list of zone IDs where the private IP address for read-only access is deployed.
NoteIf proxy settings are provided through ProxySetting, this parameter is already included and does not need to be specified again. |
["zone1", "zone2"] |
| userAccount | string | Yes | The database user account for connecting to the private IP address for read-only access. | readonly_user |
| trafficStrategy | string | Yes | The traffic strategy, which defines the rules for distributing read-only traffic. | round_robin |
| replicaParams | string | Yes | The replica parameters configuration. | {"replicaCount": 2} |
| disasterRecoveryReplicaParams | string | No | The disaster recovery replica parameters configuration. | {"drReplicaCount": 1} |
| balancedStrategy | string | No | The load balancing strategy. | weighted |
| disasterRecoveryStrategy | string | No | The disaster recovery strategy. | active-passive |
| serviceType | string | Yes | The address type. | OBPROXY_READONLY |
| ProxySetting | Object | No | The proxy settings.
NoteThis parameter is currently only supported for instances from the AWS channel. |
|
| -mode | String | No | The type of the proxy cluster specification, which can be k8s_shared or 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 set only when the deployment scheme is dual-zone active-standby deployment or triple-zone active-standby deployment. | [] |
| -nodeCpu | Float | No | The node specification. | Minimum value: 0.5. The adjustment step is 0.5. |
Response parameters
Parameter |
Type |
Description |
|---|---|---|
| requestId | string | The request ID. |
| data | object | The created result data. |
| server | string | The server address that responded to the request. |
Examples
Request example
Example 1: You can pass the proxy settings in the ProxySetting parameter.
curl -X POST \
-H "Content-Type: application/json" \
-u '<Your ak:sk>' \
"https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/tenants/{tenantId}/privatelink/readonly?requestId={requestId}" \
-d '{
"userAccount": "readonly_user",
"trafficStrategy": "round_robin",
"replicaParams": "{\"replicaCount\": 2}",
"disasterRecoveryReplicaParams": "{\"drReplicaCount\": 1}",
"balancedStrategy": "weighted",
"disasterRecoveryStrategy": "active-passive",
"serviceType": "OBPROXY_READONLY",
"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 directly pass the list of zone IDs.
curl -X POST \
-H "Content-Type: application/json" \
-u '<Your ak:sk>' \
"https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/tenants/{tenantId}/privatelink/readonly?requestId={requestId}" \
-d '{
"zoneIdList": ["zone1", "zone2"],
"userAccount": "readonly_user",
"trafficStrategy": "round_robin",
"replicaParams": "{\"replicaCount\": 2}",
"disasterRecoveryReplicaParams": "{\"drReplicaCount\": 1}",
"balancedStrategy": "weighted",
"disasterRecoveryStrategy": "active-passive",
"serviceType": "OBPROXY_READONLY",
}'
Response example
{
"requestId": "xxxxxx",
"data": {
"privatelinkId": "pl-xxxxxx",
"status": "CREATING",
"address": "xxxxxx.private.oceanbase.com"
},
"server": "xxx.xxx.x.xxx:xxxx"
}
