Overview
You can call this API to modify the number of read-only replicas.
API details
Constraints
The caller must have an AccessKey for accessing APIs of OceanBase Cloud. For information about how to obtain the AccessKey ID and AccessKey secret, see Manage AccessKeys.
Request path
PUT /api/v2/instances/{instanceId}/readonlyInstance/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******** |
| Parameter |
Type |
Required |
Description |
Example value |
| X-Ob-Project-Id |
String |
Yes |
The project ID. |
hxq3ztx3377nby3v87ry**** |
Body
| Parameter |
Type |
Required |
Description |
Example value |
| readonlyInstanceId |
String |
Yes |
The ID of the read-only replica. |
obxxx |
| targetNodeNum |
Integer |
Yes |
The target number of nodes. |
2 |
| dryRun |
Boolean |
No |
Specifies whether to perform a precheck. |
false |
Response parameters
| Parameter |
Type |
Description |
Example value |
| data |
object |
The information about the cluster. |
|
| orderId |
string |
The order ID. |
NL25******** |
| instanceId |
string |
The instance ID. |
ob******** |
| dryRun |
Boolean |
Specifies whether to perform a precheck. |
NL25******** |
| dryRunResult |
Boolean |
The result of the precheck. |
NL25******** |
Examples
Request example
curl --digest -u '<Your ak:sk>' \
-X PUT \
-H 'X-Ob-Project-Id: {X-Ob-Project-Id}' \
'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/readonlyInstance/nodeNum?requestId={requestId}' \
--data '{
"readonlyInstanceId": "obxxx",
"targetNodeNum": 2,
"dryRun": false
}'
Response example
JSON format
{
"data":{
"instanceId":"ob********",
"orderId":"NL25********"
},
"requestId":"f257f51e-****-****-8fba-ec1b9554cc78",
"success":true
}