Overview
You can call this API to create an OceanBase cluster instance.
Notice
After you call the API to create a cluster instance, the system charges the corresponding account. For more information about the charges, see Billing overview.
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
Request parameters
Header
Parameter |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| X-Ob-Project-Id | string | Yes | The project ID. | hxq3ztx3377nby3v87ry**** |
Query
Parameter |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| requestId | string | Yes | The ID of the request. This parameter is used for tracing. | dc302d76-66b5-48d8-ab53-a035******** |
Body
Parameter |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| chargeType | String | No. The default value is "PostPay". | The billing method of the instance. Valid values:
NoteOnly PostPay is supported in the current version. |
PostPay |
| cloudProvider | String | Yes | The cloud service provider.
NoteOnly Alibaba Cloud is supported.
|
ALIYUN |
| diskSize | Integer | Yes
NoteIf the instance is a transactional instance with a shared storage architecture, do not specify this parameter. |
The storage space size, in GiB. The storage space limit varies based on the instance specification. Valid values:
|
100 |
| region | String | Yes | The region where the instance resides. | 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 IDs of the zones where the instance resides. Separate the IDs of multiple zones with commas. The number of zones indicates the number of data centers.
|
cn-hangzhou-h,cn-hangzhou-i,cn-hangzhou-j |
| instanceClass | String | Yes | The instance specification. Valid values:
|
16C70GB |
| replicaMode | String | Yes | The number of full-featured replicas. The value of this parameter must match the value of the zones parameter. In a three-zone (multi-data center) deployment, only three full-featured replicas are supported. In a two-zone (two-data center) deployment, only two full-featured replicas are supported. In a single-zone (single-data center) deployment, two or three full-featured replicas are supported. The default value is 2.
|
3 |
| dryRun | Boolean | No. The default value is false. | Specifies whether to perform a dry run. Valid values:
DryRunResult is set to false by default. |
false |
| saleChannel | String | No. The default value is:
|
The sales channel. The default value is the self-operated channel.
NoteOnly the normandy channel is supported.
|
normandy_domestic |
| instanceType | String | No | The instance type. 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 and can contain only Chinese characters, digits, letters, underscores, and hyphens. | xxx_test |
| storageArchitecture | String | No | The storage architecture. The default value is standardStorage, which indicates the Shared Nothing architecture. Valid values:
|
standardStorage |
| diskType | String | No | The disk type. | |
| storageDiskType | String | No | The type of the storage disk. |
Response parameters
Parameter |
Type |
Description |
Example value |
|---|---|---|---|
| success | boolean | Indicates whether the request was 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 dryRun is passed. TRUE indicates that dryRun is passed. If dryRun is not passed, the corresponding error message is returned. | TRUE |
| requestId | String | The trace ID. | dc302d76-66b5-48d8-ab53-a035******** (64-bit) |
| errorCode | String | The error code. | Params.InstanceName.Invalid |
| errorMessage | String | The error message. | The cluster name is invalid. |
Examples
Request example
curl --request POST \
--digest -u '<Your AccessKey ID:AccessKey Secret>' \
--url 'https://api-cloud.oceanbase.com/api/v2/instances?requestId={requestId}' \
-H 'X-Ob-Project-Id: {X-Ob-Project-Id}' \
-H 'Content-Type: application/json' \
--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_instance_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 set to false:
{
"data": {
"instanceId": "ob677efwh8********",
"orderId": "ND241030********"
},
"requestId": "cf97d046-5200-4870-8007-ee35********",
"success": true
}
Here is a response example when dryRun is set to 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
}
