Overview
You can call this API to modify the number of nodes in a cluster.
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 instance. | obxxx |
Body
| Parameter | Type | Required | Description | Example value |
|---|---|---|---|---|
| nodeNum | integer | Yes | The target number of nodes. Value range: 3 to 60, and must be a multiple of 3.
NoteThe default maximum value is 60. If you need to exceed 60, please contact the OceanBase Cloud technical support team. |
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 ID of the instance. | obxxx |
| data.orderId | String | The order ID. | NL2409******** |
| data.dryRunResult | Boolean | Specifies whether the pre-check is passed. true indicates that the pre-check is passed. false indicates that the pre-check is not passed. | - |
| errorCode | String | The error code. | - |
| errorMessage | String | The error message. | - |
Examples
Request example
curl --request PUT \
--digest -u 'ak:sk' \
--url https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/nodeNum
-H 'X-Ob-Project-Id: <Project ID>'
--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
Example response when the dryRun parameter is set to true. The request is successful.
{
"success": true,
"requestId": "cb32942e-bdf2-4d85-a26f-6bf871e189a9",
"data": {
"orderId": "NL2409********",
"instanceId": "obxxx"
}
}
Example response when the dryRun parameter is set to true. The request fails.
{
"errorCode": "Privilege.OpenAPI.AuthFailed",
"errorMessage": "OpenAPI authentication failed",
"requestId": "cb32942e-bdf2-4d85-a26f-6bf871e189a9",
"success": false
}