Creating a Kafka Instance
Function
This API is used to create an instance.
Pay-per-use and yearly/monthly billing modes are available.
Calling Method
For details, see Calling APIs.
URI
POST /v2/{project_id}/kafka/instances
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition: Project ID. For details, see Obtaining a Project ID. Constraints: N/A Range: N/A Default Value: N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
Yes |
String |
Definition: Instance name. Constraints: A username must start with a letter. It can contain 4 to 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. Range: N/A Default Value: N/A |
|
description |
No |
String |
Definition: Description of an instance. Constraints: 0–1,024 characters 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 \". Range: N/A Default Value: N/A |
|
engine |
Yes |
String |
Definition: Message engine. Constraints: N/A Range: kafka Default Value: N/A |
|
engine_version |
Yes |
String |
Definition Message engine version. Constraints N/A Range
Default Value N/A |
|
broker_num |
Yes |
Integer |
Definition: Number of brokers. Constraints: N/A Range:
Default Value: N/A |
|
storage_space |
Yes |
Integer |
Definition Message storage space, in GB. Constraints The disk capacity can only be set to an integer multiple of 100. Range
Default Value N/A |
|
access_user |
No |
String |
Definition: Authentication username. Constraints: Starts with a letter, consists of 4 to 64 characters, and contains only letters, digits, hyphens (-), and underscores (_). This parameter is mandatory when ssl_enable is set to true. This parameter is invalid when ssl_enable is set to false. Range: N/A Default Value: N/A |
|
password |
No |
String |
Definition: Instance password. Constraints:
Range: N/A Default Value: N/A |
|
vpc_id |
Yes |
String |
Definition VPC ID. To obtain the VPC ID, call the API for querying the VPC list by referring to Virtual Private Cloud API Reference. Constraints N/A Range N/A Default Value N/A |
|
security_group_id |
Yes |
String |
Definition Security group to which the instance belongs. To obtain the security group ID, call the API for querying the security group list by referring to Virtual Private Cloud API Reference. Constraints N/A Range N/A Default Value N/A |
|
subnet_id |
Yes |
String |
Definition Subnet information. To obtain the subnet ID, call the API for querying the subnet list by referring to Virtual Private Cloud API Reference. Constraints N/A Range N/A Default Value N/A |
|
available_zones |
Yes |
Array of strings |
Definition: ID of the AZ where instance brokers reside and which has available resources. Obtain the AZ ID by referring to Listing AZ Information. Constraints: This parameter cannot be empty or null. A Kafka instance should be deployed in 1 AZ or at least 3 AZs. If the instance is deployed in multiple AZs, separate the AZ IDs with commas (,). |
|
product_id |
Yes |
String |
Definition: Product ID. Obtain the product ID from Querying Product Specifications List. Constraints: N/A Range: N/A Default Value: N/A |
|
maintain_begin |
No |
String |
Definition: Start time of the maintenance time window. Constraints: The value is in HH:mm format. Range: N/A Default Value: N/A |
|
maintain_end |
No |
String |
Definition: End time of the maintenance time window. Constraints: The value is in HH:mm format. Range: N/A Default Value: N/A |
|
enable_publicip |
No |
Boolean |
Definition: Whether to enable public access. Constraints: N/A Range:
Default Value: false |
|
tenant_ips |
No |
Array of strings |
Definition: You can manually specify IPv4 private IP addresses when creating an instance. Constraints: The number of specified private IP addresses must be equal to or less than the number of created brokers. If the number of specified private IP addresses is less than the number of created brokers, the system automatically assigns private IP addresses to the remaining brokers. |
|
publicip_id |
No |
String |
Definition ID of the EIP bound to the instance. To obtain the EIP ID, call the API for querying the EIP list by referring to Elastic IP API Reference. Constraints Use commas (,) to separate multiple EIP IDs. This parameter is mandatory if public access is enabled (that is, enable_publicip is set to true). Range N/A Default Value N/A |
|
ssl_enable |
No |
Boolean |
Definition: Whether SASL is enabled. Constraints: N/A Range:
Default Value: N/A |
|
kafka_security_protocol |
No |
String |
Definition Security protocol to use after SASL is enabled. Constraints If this parameter is left blank, SASL_SSL authentication is enabled by default. This parameter cannot be manually modified once the instance is created. If the port_protocol parameter was used in instance creation, its value is used for the private and public network access security protocols and this parameter becomes invalid. Range
Default Value N/A |
|
sasl_enabled_mechanisms |
No |
Array of strings |
Definition: Authentication mechanism used after SASL is enabled. Constraints: This parameter is mandatory if SASL authentication is enabled (that is, ssl_enable is set to true). If this parameter is left blank, PLAIN authentication is enabled by default. |
|
port_protocol |
No |
PortProtocol object |
Definition Kafka instance access mode. PLAINTEXT indicates plaintext access. SASL_SSL or SASL_PLAINTEXT indicates ciphertext access. Constraints Once enabled, this parameter cannot be disabled. Enable plaintext or ciphertext access, or both. The security protocol for cross-VPC access is the same as that for intranet access. If both ciphertext access and plaintext access are enabled for intranet access, the security protocol for ciphertext access is preferentially used for cross-VPC access. |
|
retention_policy |
No |
String |
Definition: Action to be taken when the memory usage reaches the disk capacity threshold. Constraints: N/A Range:
Default Value: N/A |
|
ipv6_enable |
No |
Boolean |
Definition Whether IPv6 is enabled. Constraints This parameter is valid only when the VPC supports IPv6. Range
Default Value false |
|
disk_encrypted_enable |
No |
Boolean |
Definition: Whether disk encryption is enabled. Constraints: N/A Range:
Default Value: false |
|
disk_encrypted_key |
No |
String |
Definition: Disk encryption key. If disk encryption is not enabled, this parameter is left blank. Constraints: N/A Range: N/A Default Value: N/A |
|
connector_enable |
No |
Boolean |
Definition Whether to enable Smart Connect. Smart Connect synchronizes data between Kafka and other cloud services or between two Kafka instances for backup or migration. Constraints N/A Range
Default Value false |
|
enable_auto_topic |
No |
Boolean |
Definition Whether to enable automatic Kafka topic creation. Enabling this function automatically creates a topic when a message is produced in or consumed from a topic that does not exist. Constraints N/A Range
Default Value false |
|
storage_spec_code |
Yes |
String |
Definition EVS disk type. For details about how to select a disk type, see "Disk Types and Performance" in Elastic Volume Service Service Overview. Constraints N/A Range
Default Value N/A |
|
enterprise_project_id |
No |
String |
Definition: Enterprise project ID. Constraints: This parameter is mandatory for an enterprise project account. Range: N/A Default Value: N/A |
|
tags |
No |
Array of TagEntity objects |
Definition: Tags of a Kafka instance. Constraints: N/A |
|
arch_type |
No |
String |
Definition CPU architecture. Constraints N/A Range
Default Value N/A |
|
vpc_client_plain |
No |
Boolean |
Definition: Private plaintext access in a VPC. Constraints: N/A Range: N/A Default Value: N/A |
|
bss_param |
No |
BssParam object |
Definition: Parameter related to the yearly/monthly billing mode. Constraints: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
private_plain_enable |
No |
Boolean |
Definition: Whether to enable the private plaintext access mode. Constraints: N/A Range:
Default Value: false |
|
private_sasl_ssl_enable |
No |
Boolean |
Definition Whether to enable the private ciphertext access mode using the security protocol SASL_SSL. Constraints private_sasl_ssl_enable and private_sasl_plaintext_enable cannot be set to true at the same time. Range
Default Value false |
|
private_sasl_plaintext_enable |
No |
Boolean |
Definition Whether to enable the private ciphertext access mode using the security protocol SASL_PLAINTEXT. Constraints private_sasl_plaintext_enable and private_sasl_ssl_enable cannot be both true. Range
Default Value false |
|
public_plain_enable |
No |
Boolean |
Definition: Whether to enable the public plaintext access mode. Constraints: Enable public access before enabling public plaintext access. Range:
Default Value: false |
|
public_sasl_ssl_enable |
No |
Boolean |
Definition Whether to enable the public ciphertext access using the security protocol SASL_SSL. Constraints public_sasl_ssl_enable and public_sasl_plaintext_enable cannot be set to true at the same time. If this parameter is set to true, public access needs to be enabled for the instance. Range
Default Value false |
|
public_sasl_plaintext_enable |
No |
Boolean |
Definition Whether to enable the public ciphertext access mode using the security protocol SASL_PLAINTEXT. Constraints public_sasl_plaintext_enable and public_sasl_ssl_enable cannot be set to true at the same time. If this parameter is set to true, public access needs to be enabled for the instance. Range
Default Value false |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
key |
No |
String |
Definition: Tag key. Constraints:
Range: N/A Default Value: N/A |
|
value |
No |
String |
Definition: Tag value. Constraints:
Range: N/A Default Value: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
is_auto_renew |
No |
Boolean |
Definition: Indicates whether auto-renewal is enabled. Constraints: N/A Range:
Default Value: false |
|
charging_mode |
No |
String |
Definition: Billing mode. Constraints: N/A Range:
Default Value: postPaid |
|
is_auto_pay |
No |
Boolean |
Definition: Whether the order is automatically or manually paid. Constraints: N/A Range:
Default Value: false |
|
period_type |
No |
String |
Definition: Subscription period type. Constraints: This parameter is valid and mandatory only when chargingMode is set to prePaid. Range:
Default Value: N/A |
|
period_num |
No |
Integer |
Definition: Number of subscription periods. Constraints: This parameter is valid and mandatory only when chargingMode is set to prePaid. Range:
Default Value: N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
instance_id |
String |
Definition: Instance ID. Range: N/A |
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/{project_id}/kafka/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-************",
"publicip_id" : "********-88fc-4a8c-86d0-************,********-16af-455d-8d54-************,********-3d69-4367-95ab-************",
"enable_auto_topic" : true,
"tenant_ips" : [ "127.xx.xx.x", "127.xx.xx.x", "127.xx.xx.x" ]
}
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.