Overview
Call CreateTenantAddress to create a public primary address or a VPC peering primary address for the specified tenant. The available address types depend on the cloud provider.
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}/address
Request parameters
Path
Parameter |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| instanceId | string | Yes | The ID of the database instance in OceanBase Cloud. | obcluster-***** |
| tenantId | string | Yes | The ID of the tenant. | t4louaeei**** |
Query
Parameter |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| requestId | string | Yes | The ID of the request, which is used for tracing. | dc302d76-66b5-48d8-ab53-a035******** |
Header
Parameter |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| X-Ob-Project-Id | string | Yes | The ID of the project. | hxq3ztx3377nby3v87ry**** |
Body
Parameter |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| vipServiceType | String | Yes | The type of tenant connection address to create.
NoteTo create a private primary address on Alibaba Cloud when Private Link is disabled for the account, call CreateTenantSingleTunnelSLBAddress and set To connect to the primary address through Private Link, call CreatePrivatelinkService to create an endpoint service. Create an endpoint in the application’s VPC, then pass the endpoint ID to ConnectPrivatelinkService. |
OBPROXY_INTERNET |
| vpcConnectionInfoId | Integer (int64) | No | ID of the VPC peering connection record in OceanBase Cloud. Required for a VPC peering address. You can omit it for a public primary address. | 10001 |
| proxySetting | Object | No | Configuration for a new database proxy.
|
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:
NoteThree-zone deployment is available in supported Alibaba Cloud and AWS regions. 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 target instance or tenant. The number of zones depends on deploymentArchitecture. |
See the zone request example. |
| slaveZone | Array[String] | Yes | Physical zone IDs for the standby nodes. Specify standby zones for an active-standby deployment. 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 or Serverless proxy requires at least 1 core per node. | 1 |
Response parameters
Parameter |
Type |
Description |
|---|---|---|
| data | object | The returned data object. |
| message | string | The message returned from the request. |
| successful | boolean | Indicates whether the request was successful. |
Examples
Request example
Create a public primary address for an Alibaba Cloud instance and specify the configuration for the new database proxy.
curl --digest -X POST \ -H "Content-Type: application/json" \ -H "X-Ob-Project-Id: <project ID>" \ -u '<AccessKey ID>:<AccessKey Secret>' \ "https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/tenants/{tenantId}/address?requestId={requestId}" \ -d '{ "vipServiceType": "OBPROXY_INTERNET", "proxySetting": { "mode": "k8s_shared", "deploymentArchitecture": "single_az_deployment", "zone": [ "ap-southeast-1a" ], "slaveZone": [], "nodeCpu": 1 } }'Create a public primary address that reuses the database proxy of the private primary address.
curl --digest -X POST \ -H "Content-Type: application/json" \ -H "X-Ob-Project-Id: <project ID>" \ -u '<AccessKey ID>:<AccessKey Secret>' \ "https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/tenants/{tenantId}/address?requestId={requestId}" \ -d '{ "vipServiceType": "OBPROXY_INTERNET" }'
Response example
{
"data": {},
"message": "Success",
"successful": true
}