Overview
Call ModifyOdpClusterSpec to change the specifications of a database proxy cluster.
API details
Constraints
The caller must have an AccessKey for accessing APIs of Alibaba Cloud. For information about how to obtain the AccessKey ID and AccessKey secret, see Manage AccessKeys.
Request path
POST /api/v2/instances/{instanceId}/proxies
Request parameters
Path
Name |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| instanceId | string | Yes | The ID of the ApsaraDB for OceanBase instance. | obcluster-***** |
Query
Name |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| requestId | String | Yes | The ID of the request. This ID is used for troubleshooting. | dc302d76-66b5-48d8-ab53-a035******** |
Body
Parameter |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| instanceId | String | Yes | The ID of the instance. | obcluster-***** |
| proxyClusterId | String | Yes | The ID of the proxy cluster. | proxy-6tvgz6z2**** |
| unitNum | Integer | No | Number of units for the proxy. Specify a positive integer. Omit this parameter when specifying ProxySetting. | 2 |
| mode | String | No | When sizing by number of units, specify the proxy mode in mode. When sizing by CPU cores per node, use ProxySetting.mode. | k8s_exclusive |
| zone | String | No | When sizing by number of units, specify the availability zone ID in zone. When sizing by CPU cores per node, use ProxySetting.zone for primary zones and ProxySetting.slaveZone for standby zones. | ap-southeast-1a |
| odpClusterNodeType | String | Yes | The type of the ODP cluster node. This parameter is required for one-click POC scenarios. | normal |
| ProxySetting | Object | No | Target configuration for the database proxy cluster. Specify the configuration according to how the cluster is sized:
NoteFor Alibaba Cloud instances, the available proxy specification types depend on the account. To connect to the database through Private Link, see Connect using Alibaba Cloud Private Link. |
See the ProxySetting request example. |
| UID | String | No | The ID of the user. | 200006001999 |
| User_ID | String | No | The ID of the user. | 200006001999 |
| requestId | String | No | The ID of the request. | dc302d76-66b5-48d8-ab53-a035******** |
| callerType | String | No | The type of the caller. | sub |
| accessKeyId | String | No | The ID of the AccessKey. | ak-xxxxxxxxxxxxxxxx |
| securityToken | String | No | The security token. | sts-token-xxxxxxxx |
| callerUid | String | No | The UID of the caller. | 200006001999 |
| callerBid | String | No | The BID of the caller. | 26842 |
| stsTokenCallerUid | String | No | The UID of the caller for the STS token. | 200006001999 |
| stsTokenCallerBid | String | No | The BID of the caller for the STS token. | 26842 |
| acceptLanguage | String | No | The language used for the request or response. | en-US |
| pageNumber | Integer | No | The page number. | 1 |
| pageSize | Integer | No | The number of entries on each page. | 10 |
| mergedCallerBid | String | No | The merged BID of the caller. | 26842 |
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
Name |
Type |
Description |
Example value |
|---|---|---|---|
| success | boolean | Indicates whether the operation succeeded. | true/false |
| errorCode | string | The error code. | "E001" |
| errorMessage | string | The error message. | "Operation succeeded" |
| data | object | The business data. | {...} |
| cost | integer[int64] | The time consumed (in milliseconds) | 150 |
| server | string | The IP address of the server. | "xx.xxx.xx.xxx" |
| requestId | string | The ID of the request. | "req_20250811_001" |
| totalCount | integer[int64] | The total number of entries. | 100 |
| extra | object | The additional information. | {"key1": "value1"} |
Examples
Request example
Note
- A project ID uniquely identifies a project. For information about how to obtain the project ID of an instance, see Manage projects.
- Make sure that the project ID corresponding to the specified instanceId is consistent with the specified project ID.
Example 1: Resize the proxy by specifying the number of CPU cores per node.
curl --digest -u '<AccessKey ID>:<AccessKey Secret>' \ --request POST \ --url 'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/proxies?requestId={requestId}' \ -H 'Content-Type: application/json' \ -H 'X-Ob-Project-Id: <Project ID>' \ --data '{ "instanceId": "<instance ID>", "proxyClusterId": "<proxy cluster ID>", "odpClusterNodeType": "normal", "ProxySetting": { "mode": "k8s_shared", "deploymentArchitecture": "single_az_deployment", "zone": [ "ap-southeast-1a" ], "slaveZone": [], "nodeCpu": 1 } }'Example 2: Resize the proxy by specifying the number of units.
curl --digest -u '<AccessKey ID>:<AccessKey Secret>' \ --request POST \ --url 'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/proxies?requestId={requestId}' \ -H 'Content-Type: application/json' \ -H 'X-Ob-Project-Id: <Project ID>' \ --data '{ "instanceId": "<instance ID>", "proxyClusterId": "<proxy cluster ID>", "odpClusterNodeType": "normal", "unitNum": 2, "mode": "k8s_exclusive", "zone": "ap-southeast-1a" }'
Response example
{
"success": true,
"errorCode": "E001",
"errorMessage": "The operation was successful.",
"data": {},
"cost": 150,
"server": "xxx.xxx.x.xxx:xxxx",
"requestId": "req_20250811_001",
"totalCount": 100,
"extra": {}
}