Creating an Instance
Function
This API is used to create an instance. Before calling this API:
- Learn how to authorize and authenticate it.
- Obtain the required region and endpoint.
URI
POST /v3/{project_id}/instances/{instance_id}/clickhouse
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID of a tenant in a region. To obtain this value, see Obtaining a Project ID. |
instance_id |
Yes |
String |
GaussDB(for MySQL) instance ID, which is compliant with the UUID format. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. To obtain this value, call the IAM API for obtaining a user token. The value of X-Subject-Token in the response header is the token value. |
X-Language |
No |
String |
Request language type. The default value is en-us. Values:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
ClickHouse instance name. The value:
|
engine |
Yes |
ClickHouseEngineInfo object |
Engine information. |
ha |
Yes |
ha object |
Deployment information. |
flavor_id |
Yes |
String |
Node specification ID. To obtain this value, see Querying Specifications of an HTAP Instance. |
db_root_pwd |
Yes |
String |
Password of user root. The value:
|
az_mode |
Yes |
String |
AZ type. Values:
|
volume |
Yes |
volume object |
Storage specifications. |
az_code |
Yes |
String |
AZ code. If mode in ha is set to Ha, enter multiple AZs and separate them with commas (,), for example, cn-southwest-244b,cn-southwest-244a. |
time_zone |
No |
String |
Time zone. The default value is the time zone of the GaussDB(for MySQL) instance. |
tags_info |
Yes |
tags_info object |
Tag value. |
pay_info |
No |
pay_info object |
Payment information. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
type |
Yes |
String |
DB engine type. Only click-house is supported. |
version |
Yes |
String |
Database version with only one digit. To obtain this value, see Querying HTAP Engine Resources. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
mode |
Yes |
String |
Deployment mode. Values:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
io_type |
Yes |
String |
Disk I/O type. Values:
|
capacity_in_gb |
Yes |
Integer |
Disk capacity. Value range: 50 GB to 32,000 GB. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
sys_tags |
Yes |
Array of sys_tags objects |
System tags. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Tag key. |
value |
Yes |
String |
Tag value. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
pay_model |
No |
String |
Billing mode. The default value is 0. Values: Values:
|
order_id |
No |
String |
Yearly/monthly order ID. |
period |
No |
Integer |
Yearly/monthly subscription period. |
period_type |
No |
Integer |
Subscription period type. Values:
|
is_auto_renew |
No |
Integer |
Whether to automatically renew the yearly/monthly subscription. Values:
|
Response Parameters
Status code: 202
Parameter |
Type |
Description |
---|---|---|
instance |
CreateChInstanceInfo object |
DB instance information. |
job_id |
String |
Job ID. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Instance ID. |
az_code |
String |
AZ. |
az_mode |
String |
AZ type. Values:
|
name |
String |
Instance name. |
engine |
ClickHouseEngineInfo object |
Engine information. |
vpc_id |
String |
VPC ID. |
security_group_id |
String |
Security group ID. |
subnet_id |
String |
Subnet ID. |
db_user |
String |
Database user. |
port |
Integer |
Database port. Value range: 0–65535. |
ha_mode |
String |
Deployment mode. Values:
|
pay_info |
pay_info object |
Billing information. |
ssl_option |
Boolean |
Whether to enable SSL. |
status |
String |
Instance status. Values:
|
region |
String |
Region where the instance is deployed. |
tags_info |
tags_info object |
Instance tags. |
Parameter |
Type |
Description |
---|---|---|
type |
String |
DB engine type. Only click-house is supported. |
version |
String |
Database version with only one digit. To obtain this value, see Querying HTAP Engine Resources. |
Parameter |
Type |
Description |
---|---|---|
pay_model |
String |
Billing mode. The default value is 0. Values: Values:
|
order_id |
String |
Yearly/monthly order ID. |
period |
String |
Yearly/monthly subscription period. |
period_type |
String |
Subscription period type. Values:
|
is_auto_renew |
String |
Whether to automatically renew the yearly/monthly subscription. Values:
|
Parameter |
Type |
Description |
---|---|---|
tags |
Array of tags objects |
User tags. |
sys_tags |
Array of sys_tags objects |
System tags. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Example Request
Creating a ClickHouse instance
POST https://{endpoint}/v3/23a50154cf494ec9ad6883979a12db0a/instances/40dc4c5729f14aad893e2dcd5baf6a15in07/clickhouse { "name" : "htap-cfd5", "engine" : { "type" : "click-house", "version" : "1" }, "ha" : { "mode" : "Single" }, "flavor_id" : "b44cfde6-d250-313c-8d7a-cd216f071658", "db_root_pwd" : "Rds_1234", "az_mode" : "single", "volume" : { "io_type" : "ESSD", "capacity_in_gb" : 40 }, "az_code" : "cn-southwest-244a", "time_zone" : "UTC+08:00", "tags_info" : { "sys_tags" : [ { "key" : "_sys_enterprise_project_id", "value" : "0" } ] } }
Example Response
Status code: 202
Success.
{ "instance": { "id": "2cdec02d8c4a4c88aecae08684dd8076in16", "az_code": "cn-southwest-244a", "az_mode": "double", "name": "htap-cfd5", "engine": { "type": "click-house", "version": "1" }, "vpc_id": "467f1291-994f-4d3a-9db6-d4c563218df5", "security_group_id": "3dc780b1-9d92-4850-9b98-be248e1b5962", "subnet_id": "d99cd68c-0067-436d-869e-d32e902d0074", "db_user": "root", "port": null, "ha_mode": "Single" "pay_info": { "pay_model": "0", "order_id": null, "period": null, "period_type": null, "is_auto_renew": null, }, "ssl_option": false, "status": "creating", "region": "cn-southwest-244", "tags_info": { "tags": [], "sys_tags": [ { "key": "_sys_enterprise_project_id", "value": "0" } ] } }, "job_id": "76078f0b-5162-45c8-b95f-4c1afd37536c", }
Status Code
Status Code |
Description |
---|---|
202 |
Success. |
400 |
Client error. |
500 |
Server error. |
Error Code
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot