Creating an Instance
Function
This API is used to create a pay-per-use or yearly/monthly-billed instance.
URI
POST /v2/{engine}/{project_id}/instances
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
engine |
Yes |
String |
Message engine. Default: kafka |
project_id |
Yes |
String |
Project ID. For details about how to obtain it, see Obtaining a Project ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Instance name. An instance name can contain 4 to 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. |
description |
No |
String |
Instance description. The description can contain a maximum of 1024 characters.
NOTE:
The backslash () and quotation mark (") are special characters for JSON messages. When using these characters in a parameter value, add the escape character () before the characters, for example, \ and ". |
engine |
Yes |
String |
Message engine. Value: kafka. |
engine_version |
Yes |
String |
Version of the message engine. Options:
|
broker_num |
Yes |
Integer |
Number of brokers. |
storage_space |
Yes |
Integer |
Message storage space in GB. Value range:
|
access_user |
No |
String |
This parameter is mandatory when ssl_enable is set to true. This parameter is invalid when ssl_enable is set to false. A username consists of 4 to 64 characters and supports only letters, digits, hyphens (-), and underscores (_). |
password |
No |
String |
This parameter is mandatory when ssl_enable is set to true. This parameter is invalid when ssl_enable is set to false. Instance password. The password must meet the following complexity requirements:
|
vpc_id |
Yes |
String |
VPC ID. To obtain it, log in to the VPC console and view the VPC ID on the VPC details page. |
security_group_id |
Yes |
String |
ID of the security group to which the instance belongs. To obtain it, log in to the VPC console and view the security group ID on the security group details page. |
subnet_id |
Yes |
String |
Subnet information. To obtain it, log in to VPC console and click the target subnet on the Subnets page. You can view the network ID on the displayed page. |
available_zones |
Yes |
Array of strings |
ID of the AZ where instance brokers reside and which has available resources. Obtain the AZ ID by referring to Listing AZ Information. This parameter cannot be empty or null. A Kafka instance can be deployed in 1 AZ or at least 3 AZs. When specifying AZs for brokers, use commas (,) to separate multiple AZs. |
product_id |
Yes |
String |
Product ID. Obtain the product ID from Querying Product Specifications List. |
kafka_manager_user |
No |
String |
Username for logging in to the Kafka Manager. The username consists of 4 to 64 characters and can contain only letters, digits, and hyphens (-). |
kafka_manager_password |
No |
String |
Password for logging in to Kafka Manager. The password must meet the following complexity requirements:
|
maintain_begin |
No |
String |
Time at which the maintenance time window starts. Format: HH:mm.
|
maintain_end |
No |
String |
Time at which the maintenance time window ends. Format: HH:mm.
|
enable_publicip |
No |
Boolean |
Whether to enable public access. By default, public access is disabled.
|
publicip_id |
No |
String |
ID of the EIP bound to the instance. Use commas (,) to separate multiple EIP IDs. This parameter is mandatory if public access is enabled (that is, enable_publicip is set to true). |
ssl_enable |
No |
Boolean |
Whether to enable SSL encryption for access. This setting is fixed once the instance is created.
|
kafka_security_protocol |
No |
String |
Security protocol to use after SASL is enabled. This parameter is mandatory if SASL authentication is enabled (ssl_enable=true). If this parameter is left blank, SASL_SSL authentication is enabled by default. This setting is fixed once the instance is created.
|
sasl_enabled_mechanisms |
No |
Array of strings |
Authentication mechanism to use after SASL is enabled. This parameter is mandatory if SASL authentication is enabled (ssl_enable=true). If this parameter is left blank, PLAIN authentication is enabled by default. Select both or either of the following mechanisms for SASL authentication. Options:
|
retention_policy |
No |
String |
Action to be taken when the memory usage reaches the disk capacity threshold. The value can be:
|
disk_encrypted_enable |
No |
Boolean |
Indicates whether to enable disk encryption. |
disk_encrypted_key |
No |
String |
Disk encryption key. If disk encryption is not enabled, this parameter is left blank. |
connector_enable |
No |
Boolean |
Whether to enable message dumping. By default, message dumping is disabled. |
enable_auto_topic |
No |
Boolean |
Whether to enable automatic topic creation.
If it is enabled, a topic will be automatically created with 3 partitions and 3 replicas when a message is created in or retrieved from a topic that does not exist. The default value is false. |
storage_spec_code |
Yes |
String |
Storage I/O specification. Options:
For details about how to select a disk type, see "Disk Types and Disk Performance" in the EVS User Guide. |
enterprise_project_id |
No |
String |
Enterprise project ID. This parameter is mandatory for an enterprise project account. |
tags |
No |
Array of TagEntity objects |
Tag list. |
arch_type |
No |
String |
CPU architecture. Currently, only the x86 architecture is supported. Options:
|
vpc_client_plain |
No |
Boolean |
Intra-VPC plaintext access. |
bss_param |
No |
BssParam object |
Parameter related to the yearly/monthly billing mode. If this parameter is left blank, the billing mode is pay-per-use by default. If this parameter is not left blank, the billing mode is yearly/monthly. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
No |
String |
Key. A key can contain 1 to 128 characters. Include UTF-8 letters, digits, spaces, or the following special characters _.:=+-@ Do not use spaces to start or end the key. |
value |
No |
String |
Value. A value can contain 0 to 255 characters. Include UTF-8 letters, digits, spaces, or the following special characters _.:/=+-@ A value can be an empty string. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
is_auto_renew |
No |
Boolean |
Whether auto renewal is enabled. Options:
By default, auto renewal is disabled. |
charging_mode |
No |
String |
Billing mode. This parameter specifies a payment mode. Options:
The default value is postPaid. |
is_auto_pay |
No |
Boolean |
Specifies whether the order is automatically or manually paid. Options:
The default payment mode is manual. |
period_type |
No |
String |
Subscription period type. Options:
This parameter is valid and mandatory only when chargingMode is set to prePaid. ** |
period_num |
No |
Integer |
Subscribed periods. Options:
**This parameter is valid and mandatory only when chargingMode is set to prePaid. ** |
order_id |
No |
String |
This parameter can be used to specify an order number for creating a yearly/monthly instance. It is obtained from CBC. If this parameter is not specified, an order ID is automatically created. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
instance_id |
String |
Instance ID. |
Example Requests
-
Creating a pay-per-use Kafka instance whose version is 2.7, specifications are 2 vCPUs | 4 GB x 3, and storage space is 300 GB
POST https://{endpoint}/v2/{engine}/{project_id}/instances { "name" : "kafka-test", "description" : "", "engine" : "kafka", "engine_version" : "2.7", "storage_space" : 300, "vpc_id" : "********-9b4a-44c5-a964-************", "subnet_id" : "********-8fbf-4438-ba71-************", "security_group_id" : "********-e073-4aad-991f-************", "available_zones" : [ "********706d4c1fb0eb72f0********" ], "product_id" : "c6.2u4g.cluster", "ssl_enable" : true, "kafka_security_protocol" : "SASL_SSL", "sasl_enabled_mechanisms" : [ "SCRAM-SHA-512" ], "storage_spec_code" : "dms.physical.storage.ultra.v2", "broker_num" : 3, "arch_type" : "X86", "enterprise_project_id" : "0", "access_user" : "********", "password" : "********", "enable_publicip" : true, "tags" : [ { "key" : "aaa", "value" : "111" } ], "retention_policy" : "time_base", "disk_encrypted_enable" : true, "disk_encrypted_key" : "********-b953-4875-a743-************", "kafka_manager_user" : "********", "kafka_manager_password" : "********", "publicip_id" : "********-88fc-4a8c-86d0-************,********-16af-455d-8d54-************,********-3d69-4367-95ab-************", "vpc_client_plain" : true, "enable_auto_topic" : true }
-
Creating a yearly/monthly Kafka instance whose version is 2.7, specifications are 2 vCPUs | 4 GB x 3, and storage space is 300 GB
POST https://{endpoint}/v2/{engine}/{project_id}/instances { "name" : "kafka-test1", "description" : "", "engine" : "kafka", "engine_version" : "2.7", "storage_space" : 300, "vpc_id" : "********-9b4a-44c5-a964-************", "subnet_id" : "********-8fbf-4438-ba71-************", "security_group_id" : "********-e073-4aad-991f-************", "available_zones" : [ "********706d4c1fb0eb72f0********" ], "product_id" : "c6.2u4g.cluster", "ssl_enable" : true, "kafka_security_protocol" : "SASL_SSL", "sasl_enabled_mechanisms" : [ "SCRAM-SHA-512" ], "storage_spec_code" : "dms.physical.storage.ultra.v2", "broker_num" : 3, "arch_type" : "X86", "enterprise_project_id" : "0", "access_user" : "********", "password" : "********", "enable_publicip" : true, "tags" : [ { "key" : "aaa", "value" : "111" } ], "retention_policy" : "time_base", "kafka_manager_user" : "********", "kafka_manager_password" : "********", "publicip_id" : "********-88fc-4a8c-86d0-************,********-16af-455d-8d54-************,********-3d69-4367-95ab-************", "vpc_client_plain" : true, "enable_auto_topic" : true, "bss_param" : { "charging_mode" : "prePaid", "period_type" : "month", "period_num" : 1, "is_auto_pay" : true } }
Example Responses
Status code: 200
Instance created successfully.
{ "instance_id" : "8959ab1c-7n1a-yyb1-a05t-93dfc361b32d" }
Status Codes
Status Code |
Description |
---|---|
200 |
Instance created successfully. |
Error Codes
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