Overview
You can call this API to create a read-only replica instance for the specified OceanBase 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
POST /api/v2/instances/{instanceId}/readonlyInstance
Request parameters
Path
| Name |
Type |
Required |
Description |
Example value |
| instanceId |
String |
Yes |
The ID of the OceanBase cluster. |
obcluster-***** |
Query
| Name |
Type |
Required |
Description |
Example value |
| requestId |
String |
Yes |
The request ID, which is used for tracing. |
dc302d76-66b5-48d8-ab53-a035******** |
| Name |
Type |
Required |
Description |
Example value |
| X-Ob-Project-Id |
String |
Yes |
The project ID. |
hxq3ztx3377nby3v87ry**** |
Body
| Name |
Type |
Required |
Description |
Example value |
| readOnlyReplicaType |
String |
Yes |
The type of the read-only replica. Valid values:
- ROW_STORE: a read-only rowstore replica
- COLUMN_STORE: a read-only columnstore replica
Note
A read-only columnstore replica is supported only for OceanBase Database V4.3.3 and later.
|
ROW_STORE |
| zone |
String |
Yes |
The zone. |
ap-beijing-3 |
| instanceClass |
String |
Yes |
The instance specification. |
4C16G |
| diskSize |
Integer |
No |
The disk size. |
70 |
| nodeNum |
Integer |
No |
The number of nodes. |
1 |
| dryRun |
Boolean |
No |
Specifies whether to perform a precheck. |
false |
Response parameters
| Name |
Type |
Description |
Example value |
| data |
object |
The cluster information. |
|
| orderId |
string |
The order ID. |
NL25******** |
| instanceId |
string |
The instance ID. |
ob******** |
| dryRun |
Boolean |
Specifies whether to perform a precheck. |
NL25******** |
| dryRunResult |
Boolean |
The precheck result |
NL25******** |
Examples
Request example
curl --digest -u '<Your ak:sk>' \
-X POST \
-H 'X-Ob-Project-Id: {X-Ob-Project-Id}' \
'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/readonlyInstance?requestId={requestId}' \
--data '{
"readOnlyReplicaType": "ROW_STORE",
"zone": "ap-beijing-3",
"instanceClass": "4C16G",
"diskSize": 100,
"nodeNum": 4,
"dryRun": true
}'
Response example
JSON format
{
"data": {
"instanceId": "ob********",
"orderId": "NL25********"
},
"requestId": "f257f51e-****-****-8fba-ec1b9554cc78",
"success": true
}