Overview
You can call this API to create an OceanBase cluster instance.
Notice
After you call the CreateInstance API, the instance will start being billed. For more information, see Instance billing.
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
POST /api/v2/instances
Request parameters
Query
| Parameter | Type | Required | Description | Example value |
|---|---|---|---|---|
| None |
Body
| Parameter | Type | Required | Description | Example value |
|---|---|---|---|---|
| chargeType | String | No | The billing method of the instance. The default value is "PostPay". Valid values:
NoteThe current version supports only PostPay. |
PostPay |
| cloudProvider | String | Yes | The cloud vendor:
NoteThe current version supports only ALIYUN.
|
ALIYUN |
| diskSize | Integer | Yes
NoteIf the instance is a transactional instance and the storage architecture is Shared Storage, do not specify this parameter. |
The size of the storage space, in GB. The supported storage space varies based on the cluster specification:
|
100 |
| region | String | Yes | The region to which the instance belongs. | cn-shanghai |
| obVersion | String | Yes | The version number of OceanBase Cloud, which consists of only three digits. | 4.2.1 |
| zones | String | Yes | The ID of the zone to which the instance belongs. Separate multiple zone IDs with commas. The ID must be unique. | cn-hangzhou-h,cn-hangzhou-i,cn-hangzhou-j |
| instanceClass | String | Yes | The specification of the cluster. The following specification plans are supported:
|
16C70GB |
| replicaMode | String | Yes | The number of full-featured replicas.
|
3 |
| dryRun | Boolean | No | Specifies whether to perform only a dry run for the request. The default value is false. Valid values:
By default, the dryRunResult parameter returns false. |
false |
| saleChannel | String | No. Default value:
|
The channel by which the instance is purchased. The default channel is provided by OceanBase Cloud.
NoteThe current version supports only normandy channels.
|
normandy_domestic |
| instanceType | String | No | The type of the instance. The default value is CLUSTER. Valid values:
|
CLUSTER |
| instanceName | String | No | The name of the instance. The value must be 2 to 64 characters in length. It can contain digits, letters, underscores (_), and hyphens (-). | xxx_test |
| storageArchitecture | String | No | The storage architecture. The default architecture is Shared Nothing. Valid values:
|
standardStorage |
Response parameters
| Parameter | Type | Description | Example value |
|---|---|---|---|
| success | Boolean | Indicates whether the request is successful. | true or false |
| data | Object | The order information. | |
| data.orderId | String | The ID of the order that you have placed. | NL240919******** |
| data.instanceId | String | The ID of the instance. | ob677efwh8******** |
| data.dryRunResult | Boolean | If the dry run succeeds, true is returned for dryRunResult. If the dry run fails, an error code is returned. |
TRUE |
| requestId | String | The ID of the request. | dc302d76-66b5-48d8-ab53-a035******** (64 bits) |
| errorCode | String | The error code. | Params.InstanceName.Invalid |
| errorMessage | String | The error message. | Instance name validation failed |
Examples
Request example
curl --request POST \
--digest -u 'ak:sk' \
--url https://api-cloud.oceanbase.com/api/v2/instances
-H 'X-Ob-Project-Id: <Project ID>'
--data '{
"cloudProvider": "ALIYUN",
"diskSize": 100,
"region": "cn-shanghai",
"obVersion": "4.2.1",
"zones": "cn-shanghai-e",
"instanceClass": "4C16GB",
"replicaMode": "3",
"saleChannel": "normandy_domestic",
"instanceType": "cluster",
"chargeType":"Postpay",
"instanceName":"test_instane_name",
"dryRun":true
}'
Note
A project ID uniquely identifies a project. For information about how to obtain the project ID of an instance, see Manage projects.
Response example
Here is a response example when dryRun is set to false and the request is successful:
{
"data": {
"instanceId": "ob677efwh8********",
"orderId": "ND241030********"
},
"requestId": "cf97d046-5200-4870-8007-ee35********",
"success": true
}
Here is a response example when dryRun is set to true and the request is successful:
{
"data": {
"dryRunResult": true
},
"requestId": "dc302d76-66b5-48d8-ab53-a035********",
"success": true
}
Here is a response example when the request failed:
{
"errorCode": "Params.InstanceName.Invalid",
"errorMessage": "Instance name validation failed",
"requestId": "cb32942e-bdf2-4d85-a26f-6bf8********",
"success": false
}