Description
Creates a singleTunnelSLB address for a tenant.
Note
This API applies only to tenants in Alibaba Cloud instances. After PrivateLink is enabled, creating a SingleTunnel address through the proxy address flow returns COMMON_FUNC_NOT_SUPPORT. Existing addresses can still be queried or deleted.
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}/tenantSingleTunnelSLBAddress
Request parameters
Path
Parameter |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| instanceId | string | Yes | The ID of the OceanBase Cloud instance. | ob317v4uif**** |
| tenantId | string | Yes | The ID of the tenant. | ob2mr3oae0**** |
Query
Parameter |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| requestId | String | Yes | The ID of the request. | 6e87d618-854e-4ca1-ae1f-babc******** |
Body
The request body is required and must use application/json.
Parameter |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| userVpcId | String | Yes | The ID of the user VPC. | your-vpc-id |
| userVpcOwnerId | String | Yes | UID of the target VPC owner. Specify the actual UID; there is no default UID. | your-vpc-owner-id |
| userVswitchId | String | Yes | Target vSwitch ID. Specify the actual ID; there is no fallback to a default vSwitch. | your-vswitch-id |
| vipServiceType | String | Yes | Address type: OBPROXY_INTRANET for the primary private proxy address, OBPROXY_READONLY for a read-only address, or OBPROXY_READWRITE for a read/write splitting address. DIRECT uses a separate direct connection flow. | OBPROXY_INTRANET |
| zoneIdList | List<String> |
Conditional | A nonempty list is required when the commercial proxy offering is disabled and a traffic policy is used. When the commercial proxy offering is enabled and a target proxy configuration is provided, specify the zones through proxySetting.zone. | ["<actual-zone-id>"] |
| trafficStrategy | String | No | Traffic policy: REPLICA_TYPE or REPLICA. Supported policy combinations depend on the address type and ODP version. | REPLICA_TYPE |
| replicaParams | String | No | Replica configuration, specified as a serialized JSON array. | [{"Value":"FULL"}] |
| disasterRecoveryReplicaParams | String | No | Selected disaster recovery replicas. | Same as above |
| balancedStrategy | String | No | Balancing policy. | AVAILABLE_ZONE_PRIORITY: prioritize the same zone; AUTO_BALANCE: automatic balancing; CUSTOM_WEIGHT: custom weights. |
| disasterRecoveryStrategy | String | No | Whether to enable the disaster recovery policy, which automatically queries the primary replica when a replica is unavailable. YES enables the policy; NO disables it. | NO |
| proxySetting | Object | No | ODP proxy configuration. If omitted, the behavior depends on the existing proxy and whether the commercial proxy offering is enabled. See the following details. | N/A |
proxySetting is handled as follows:
- When the commercial proxy offering is disabled, omitting this field or passing
{}does not configure a new proxy. - When the commercial proxy offering is enabled and the primary private address reuses an existing public ODP, the existing configuration is used.
- In other scenarios where the commercial proxy offering is enabled and a new ODP is required, omitting this field retains the existing specifications. Passing
{}returns an error because mode is empty. To specify a target configuration, provide all the fields listed below. - The DIRECT connection flow does not depend on this proxy configuration.
proxySetting object fields
When proxySetting specifies the target configuration for a new proxy, all the following fields are required. Do not substitute an empty object {} for the complete configuration.
Field |
Type |
Description |
Example value |
|---|---|---|---|
| mode | String | Proxy mode: k8s_shared, k8s_exclusive, or k8s_serverless. |
k8s_shared |
| deploymentArchitecture | String | Deployment architecture. Supported values and primary/standby zone configurations are listed below. | single_az_deployment |
| zone | Array[String] | List of primary zones. Must not be empty. Specify the actual physical zones of the tenant. | ["<tenant-physical-zone>"] |
| slaveZone | Array[String] | List of standby zones. Must not be null. Use an empty array [] for deployments without a standby zone; otherwise, provide a nonempty list. |
[] |
| nodeCpu | Number | Number of CPU cores per proxy node. Must be greater than 0. Shared and Serverless modes require at least 1 core. | 1 |
deploymentArchitecture |
Deployment and mode restrictions |
zone / slaveZone |
|---|---|---|
| single_az_deployment | Single zone. Supports all three modes listed above. | [A] / [] |
| dual_az_active_active_deployment | Active-active deployment across two zones. Supports all three modes listed above. | [A, B] / [] |
| dual_az_active_standby_deployment | Primary-standby deployment across two zones. Supports only k8s_exclusive. | [A] / [B] |
A and B represent different physical zones. The legacy architecture values dual_az_deployment and multi_az_deployment are retained only for compatibility with existing configurations. For new deployments, use the architecture values in the table above.
A single-zone deployment creates two logical proxy nodes; nodeCpu specifies the CPU cores per node. Serverless mode must also meet the configuration requirements above, but the initial specifications are recalculated and subsequently adjusted automatically. Available specifications, zones, and quotas depend on the target environment.
Response parameters
Field |
Type |
Description |
Example value |
|---|---|---|---|
| success | boolean | Whether the request succeeded. | true/false |
| errorCode | string | Error code. | "E001" |
| errorMessage | string | Error message. | "Operation succeeded" |
| data | object | Response data. | {...} |
| data.addressId | string | vip service group name | "12345" |
| cost | integer[int64] | Request duration in milliseconds. | 150 |
| server | string | The server address. | "xx.xxx.xx.xxx" |
| requestId | string | The ID of the request. | "req_20250811_001" |
| totalCount | integer[int64] | The total number. | 100 |
| extra | object | Additional information. | {"key1": "value1"} |
Examples
Request example
The following template applies to Alibaba Cloud instances that allow new SingleTunnel addresses, for a primary private address with the commercial proxy offering disabled. Replace the VPC ID, owner UID, vSwitch ID, and path parameters with actual values.
curl --digest -u '<AccessKey ID>:<AccessKey Secret>' \
--request POST \
--url 'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/tenants/{tenantId}/tenantSingleTunnelSLBAddress?requestId={requestId}' \
-H 'X-Ob-Project-Id: <Project ID>' \
-H 'Content-Type: application/json' \
--data '{"userVpcId":"<target-vpc-id>", "userVpcOwnerId":"<target-vpc-owner-uid>", "userVswitchId":"<target-vswitch-id>", "vipServiceType":"OBPROXY_INTRANET"}'
Note
- X-Ob-Project-Id is an optional request header. A project ID uniquely identifies a project. For information about how to obtain the project ID of a cluster, see Manage projects.
- If you specify this header, make sure that the project ID of the instance identified by instanceId matches the specified project ID.
To specify a target configuration for a new proxy, add the following proxySetting field to the request body. Replace the zone placeholders with supported physical zones:
{
"proxySetting": {
"mode": "k8s_shared",
"deploymentArchitecture": "single_az_deployment",
"zone": [
"<tenant-physical-zone>"
],
"slaveZone": [],
"nodeCpu": 1
}
}
The following examples show optional policy fields for scenarios where the commercial proxy offering is disabled. Choose fields based on the actual address type, available replicas, and ODP version, then add them to the base request body. A traffic policy requires a nonempty zoneIdList with actual zones. When the commercial proxy offering is enabled and a target proxy configuration is provided, specify the zones through proxySetting.zone and meet all the configuration requirements above.
{
"zoneIdList": ["<actual-zone-id>"],
"trafficStrategy": "REPLICA_TYPE",
"replicaParams": "[{\"Value\":\"FULL\"}]",
"balancedStrategy": "AUTO_BALANCE",
"disasterRecoveryStrategy": "NO"
}
Response example
JSON format
{
"data": {
"addressId": "rs-private-internet-751bc080-d862-4917-972e-48ae3d22****-OBPROXY-INTERNET-t6zffysc2bg2o-****"
},
"requestId": "6e87d618-854e-4ca1-ae1f-babcffd70000",
"success": true
}