Overview
You can call this API to create an OceanBase cluster instance.
Notice
After you call the CreateCluster API, the system charges the corresponding account. For more information about the charges, see Instance billing.
API details
Constraints
You must have an AccessKey for accessing APIs of multiple clouds. For information about how to obtain the AccessKey ID and AccessKey secret, see Manage AccessKeys.
Request path
POST /api/v2/instances
Request parameters
Query
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| None |
Body
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| chargeType | String | No. The default value is "PostPay". | The billing method of the instance. Valid values:
NoteCurrently, only PostPay is supported. |
PostPay |
| cloudProvider | String | Yes | The cloud service provider:
NoteCurrently, only Alibaba Cloud is supported.
|
ALIYUN |
| diskSize | Integer | Yes
NoteIf your instance is a transactional instance and uses shared storage, do not specify this parameter. |
The storage space size, in GiB. The storage space limit varies based on the instance specifications, as shown in the following table:
|
100 |
| region | String | Yes | The region where the instance is located. | cn-shanghai |
| obVersion | String | Yes | The version number of OceanBase Server. Only three-digit version numbers are supported. | 4.2.1 |
| zones | String | Yes | The ID of the zone where the instance is located. Separate multiple zone IDs with commas. The number of zone IDs indicates the number of zones (or IDCs) where the instance is deployed.
|
cn-hangzhou-h,cn-hangzhou-i,cn-hangzhou-j |
| instanceClass | String | Yes | The specifications of the instance. The following instance specifications are supported:
|
16C70GB |
| replicaMode | String | Yes | The number of full-featured replicas. The value must match the value of the zones parameter. If three zones are specified, only three full-featured replicas are supported. If two zones are specified, only two full-featured replicas are supported. If one zone is specified, two or three full-featured replicas are supported. The default value is two full-featured replicas.
|
3 |
| dryRun | Boolean | No. The default value is false. | Specifies whether to perform a dry run. Valid values:
DryRunResult defaults to false. |
false |
| saleChannel | String | No. Default value:
|
The sales channel. The default value is the self-operated channel:
NoteCurrently, only the normandy channel is supported.
|
normandy_domestic |
| instanceType | String | No | The type of the instance. Default value: CLUSTER. Valid values:
|
CLUSTER |
| instanceName | String | No | The length is 2 to 64 characters. It can contain only Chinese characters, digits, letters, underscores, and hyphens. | xxx_test |
| storageArchitecture | String | No | The storage architecture. Default value: standardStorage. Valid values:
|
standardStorage |
Response parameters
| Parameter | Type | Description | Example value |
|---|---|---|---|
| success | boolean | Indicates whether the request is successful. | true/false |
| data | Object | The information about the order. | |
| data.orderId | String | The ID of the order. | NL240919******** |
| data.instanceId | String | The ID of the instance. | ob677efwh8******** |
| data.dryRunResult | boolean | Indicates whether the dryRun operation is successful. TRUE indicates success. If the dryRun operation fails, an error message is returned. | TRUE |
| requestId | String | trace | dc302d76-66b5-48d8-ab53-a035******** (64-bit) |
| errorCode | String | The error code. | Params.InstanceName.Invalid |
| errorMessage | String | The error message. | The cluster name check 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.
- Make sure that the project ID corresponding to the specified instanceId is consistent with the specified project ID.
Response example
Here is a response example when dryRun is false:
{
"data": {
"instanceId": "ob677efwh8********",
"orderId": "ND241030********"
},
"requestId": "cf97d046-5200-4870-8007-ee35********",
"success": true
}
Here is a response example when dryRun is true:
{
"data": {
"dryRunResult": true
},
"requestId": "dc302d76-66b5-48d8-ab53-a035********",
"success": true
}
Here is a response example when the request fails:
{
"errorCode": "Params.InstanceName.Invalid",
"errorMessage": "The cluster name is invalid.",
"requestId": "cb32942e-bdf2-4d85-a26f-6bf8********",
"success": false
}