Overview
You can call this API to modify the number of nodes in a cluster. The modified configuration may take some time to take effect.
API details
Constraints
The caller must have an AccessKey for accessing the multi-cloud API. For information about how to obtain the AccessKey ID and AccessKey secret, see Manage AccessKeys.
Request path
PUT /api/v2/instances/{instanceId}/nodeNum
Request parameters
Path
| Parameter | Type | Required | Description | Example value |
|---|---|---|---|---|
| instanceId | String | Yes | The ID of the OceanBase cluster. | obcluster-***** |
Query
| Parameter | Type | Required | Description | Example value |
|---|---|---|---|---|
| requestId | String | Yes | The request ID for tracking. | 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 |
|---|---|---|---|---|
| nodeNum | integer | Yes | The target number of nodes. Valid values: 3 to 60, and must be a multiple of 3.
NoteThe default maximum value is 60. If you need to exceed 60, contact OceanBase Cloud Technical Support. |
6 |
| dryRun | boolean | No | Specifies whether to perform a pre-check. Default value: false.
|
true |
Response parameters
| Parameter | Type | Description | Example value |
|---|---|---|---|
| data | Object | The order information. | |
| data.instanceId | String | The instance ID. | obxxx |
| data.orderId | String | The order ID. | NL2409******** |
| data.dryRunResult | Boolean | Indicates whether the pre-check passes. true is returned if the pre-check passes. Otherwise, errorCode and errorMessage are returned. | - |
| errorCode | String | The error code. | - |
| errorMessage | String | The error message. | - |
Examples
Request example
curl --request PUT \
--digest -u '<Your ak:sk>' \
--url 'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/nodeNum?requestId={requestId}' \
-H 'X-Ob-Project-Id: {X-Ob-Project-Id}' \
-H 'Content-Type: application/json' \
--data '{"nodeNum": 6, "dryRun": false}'
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.
Response example
JSON format
The following is an example of the response when the dryRun parameter is set to true.
{
"success": true,
"requestId": "cb32942e-bdf2-4d85-a26f-6bf871e189a9",
"data": {
"orderId": "NL2409********",
"instanceId": "obxxx"
}
}
The following is an example of the response when the dryRun parameter is set to true.
{
"errorCode": "Privilege.OpenAPI.AuthFailed",
"errorMessage": "OpenAPI authentication failed",
"requestId": "cb32942e-bdf2-4d85-a26f-6bf871e189a9",
"success": false
}
