Description
Call CreatePrivatelinkService to create a Private Link connection for a tenant.
Call description
Prerequisites
You need an access key to call the multi-cloud API. For information about how to obtain an AccessKey ID and AccessKey Secret, see Manage access keys.
Request path
POST /api/v2/instances/{instanceId}/tenants/{tenantId}/privatelink/service
Request parameters
Path
Parameter |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| instanceId | String | Yes | OceanBase cluster ID. | obcluster-***** |
| tenantId | String | Yes | Tenant ID. | t4louaeei**** |
Query
Parameter |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| requestId | String | Yes | Request ID used for tracing. | d04eabba**** |
Body
The request body is required and must use application/json.
Parameter |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| userAccount | String | No | Cloud account ID to add to the Private Link service allowlist. The ID is required when creating a non-shared service or creating a shared service for the first time. If omitted when reusing an existing shared service, the allowlist remains unchanged. | 200006001999 |
| plServiceId | String | No | Not required. The creation process does not use this request value. The service ID is generated by the system or the cloud platform. | — |
| serviceType | String | No | Shared service type. Defaults to OBPROXY_INTRANET_SHARED if omitted or set to an empty string. Azure shared services support only this value. This field is not used for non-shared services. | OBPROXY_INTRANET_SHARED |
| isSharedPlService | Boolean | No | Specifies whether tenants in the same OceanBase Cloud instance share a Private Link endpoint service.
|
false |
| proxySetting | Object | No | Configuration for a new database proxy for the Private Link service.
|
See the proxySetting request example. |
proxySetting object fields
Parameter |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| mode | String | Yes | Database proxy specification type. Valid values:
|
k8s_shared |
| deploymentArchitecture | String | Yes | Database proxy deployment architecture. Valid values:
dual_az_deployment and multi_az_deployment.
NoteTo use three zones for a new proxy for a non-shared Alibaba Cloud Private Link service, the account must support custom proxy configurations and the region must support three-zone deployment. Both three-zone architectures require a dedicated proxy cluster with the 2.0 architecture and an OceanBase instance deployed across three zones. |
single_az_deployment |
| zone | Array[String] | Yes | Physical zone IDs for the primary nodes. Specify at least one zone available to the tenant. The number of zones depends on deploymentArchitecture. |
See the zone request example. |
| slaveZone | Array[String] | Yes | Physical zone IDs for the standby nodes. For active-standby deployments, select standby zones from the zones available to the tenant. For other architectures, specify []. This field does not accept null. |
See the slaveZone request example. |
| nodeCpu | Number | Yes | CPU cores per proxy node. The value must be greater than 0. Creating or resizing a shared proxy requires at least 1 core per node. Available sizes and quotas depend on the target environment. | 1 |
Response parameters
Field |
Type |
Description |
Example value |
|---|---|---|---|
| success | Boolean | Whether the request succeeded. | true |
| errorCode | String | Error code. | INVALID_PARAMETER |
| errorMessage | String | Error message. | Invalid parameter |
| data | Object | Response data. | N/A |
| data.addressId | String | Connection address or service address identifier. | rs-private-internet-***** |
| cost | Number | Request duration. | 1.0 |
| server | String | Server address, typically the IP address of an OBServer node. | 10.0.0.10 |
| requestId | String | Request ID. | d04eabba**** |
| totalCount | Number | Total record count. | 100.0 |
| extra | Object | Additional information. | {} |
Examples
Request example
Create a non-shared Private Link service for an Alibaba Cloud tenant and specify the size of the new database proxy.
curl --digest -u '<AccessKey ID>:<AccessKey Secret>' \ --request POST \ -H 'X-Ob-Project-Id: <Project ID>' \ -H 'Content-Type: application/json' \ --data '{ "userAccount": "<cloud account ID>", "isSharedPlService": false, "proxySetting": { "mode": "k8s_shared", "deploymentArchitecture": "single_az_deployment", "zone": [ "ap-southeast-1a" ], "slaveZone": [], "nodeCpu": 1 } }' \ 'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/tenants/{tenantId}/privatelink/service?requestId={requestId}'For a non-shared service, reuse the database proxy of the primary address or an existing service.
curl --digest -u '<AccessKey ID>:<AccessKey Secret>' \ --request POST \ -H 'X-Ob-Project-Id: <Project ID>' \ -H 'Content-Type: application/json' \ --data '{ "userAccount": "<cloud account ID>" }' \ 'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/tenants/{tenantId}/privatelink/service?requestId={requestId}'Note
- A project ID uniquely identifies a project. For information about how to obtain the project ID of a cluster, see Manage projects.
- Make sure that the project ID of the instance identified by instanceId matches the specified project ID.
Create a shared service for the first time.
curl --digest -u '<AccessKey ID>:<AccessKey Secret>' \ --request POST \ -H 'X-Ob-Project-Id: <Project ID>' \ -H 'Content-Type: application/json' \ --data '{ "userAccount": "<cloud account ID>", "isSharedPlService": true }' \ 'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/tenants/{tenantId}/privatelink/service?requestId={requestId}'
Response example
JSON format
{
"success": true,
"errorCode": null,
"errorMessage": null,
"data": {
"addressId": "rs-private-internet-*****"
},
"cost": 1.0,
"server": "xxx.xxx.x.xxx:xxx",
"requestId": "d04eabba****",
"totalCount": 100.0,
"extra": {}
}