Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Creating an Instance

Updated on 2022-02-21 GMT+08:00

Function

This API is used to create a Kafka instance.

URI

POST /v1.0/{project_id}/instances

Table 1 describes the parameter.

Table 1 Parameters

Parameter

Type

Mandatory

Description

project_id

String

Yes

Indicates the ID of a project.

Request

Request parameters

Table 2 describes the parameters.

Table 2 Request parameters

Parameter

Type

Mandatory

Description

name

String

Yes

Indicates the instance name.

An instance name starts with a letter, consists of 4 to 64 characters, and can contain letters, digits, and hyphens (-).

description

String

No

Indicates the description of an instance.

It is a character string containing not more than 1024 characters.

NOTE:

The backslash (\) and quotation mark (") are special characters for JSON packets. When using these characters in a parameter value, add the escape character (\) before these characters, for example, \\ and \".

engine

String

Yes

Indicates the message engine. Set the value to kafka.

engine_version

String

Yes

Indicates the version of the message engine. Value: 1.1.0 or 2.3.0

specification

String

Yes

Indicates the baseline bandwidth of a Kafka instance, that is, the maximum amount of data transferred per unit time. Unit: MB

Options:

  • 100MB
  • 300MB
  • 600MB
  • 1200MB

storage_space

Integer

Yes

Indicates the message storage space.

Unit: GB. Value range:

  • Kafka instance with specification being 100MB: 600–90,000 GB
  • Kafka instance with specification being 300MB: 1200–90,000 GB
  • Kafka instance with specification being 600MB: 2400–90,000 GB
  • Kafka instance with specification being 1200MB: 4800–90,000 GB

partition_num

Integer

Yes

Indicates the maximum number of partitions in a Kafka instance.

Options:

  • When specification is 100MB: 300
  • When specification is 300MB: 900
  • When specification is 600MB: 1800
  • When specification is 1200 MB: 1800

access_user

String

No

This parameter is mandatory when ssl_enable is set to true. This parameter is invalid when ssl_enable is set to false.

Indicates a username. A username consists of 4 to 64 characters and can contain letters, digits, and hyphens (-).

password

String

No

This parameter is mandatory when ssl_enable is set to true. This parameter is invalid when ssl_enable is set to false.

Indicates an instance password.

The password must meet the following complexity requirements:

  • Must be a string consisting of 8 to 32 characters.
  • Contains at least three of the following characters:
    • Lowercase letters
    • Uppercase letters
    • Digits
    • Special characters `~!@#$%^&*()-_=+\|[{}];:',<.>/?

vpc_id

String

Yes

Indicates the VPC ID.

Obtain the value by using either of the following methods:

  • Method 1: Log in to VPC console and view the VPC ID in the VPC details.
  • Method 2: Call the API for querying VPCs. For details, see the "Querying VPCs" section in the Virtual Private Cloud API Reference.

security_group_id

String

Yes

Indicates the security group which the instance belongs to.

Obtain the value by using either of the following methods:

  • Method 1: Log in to VPC console. Choose Access Control > Security Groups in the navigation pane on the left. On the displayed page, click the target security group. You can view the security group ID on the displayed page.
  • Method 2: Call the API for querying security groups. For details, see the "Querying Security Groups" section in the Virtual Private Cloud API Reference.

subnet_id

String

Yes

Indicates the subnet ID.

Obtain the value by using either of the following methods:

  • Method 1: Log in to VPC console and click the target subnet on the Subnets tab page. You can view the network ID on the displayed page.
  • Method 2: Call the API for querying subnets. For details, see the "Querying Subnets" section in the Virtual Private Cloud API Reference.

available_zones

Array

Yes

ID of the AZ where brokers reside and which has available resources. The parameter value cannot be an empty array or an empty array. For details on how to obtain the value, see Querying AZ Information. Check whether the AZ has available resources.

When creating a Kafka instance, you can select either 1 AZ or at least 3 AZ. When specifying AZs for brokers, use commas (,) to separate multiple AZs.

product_id

String

Yes

Indicates the product ID.

For details on how to obtain the ID, see Querying Product Specifications.

kafka_manager_user

String

Yes

Indicates the username for logging in to the Kafka Manager. The username consists of 4 to 64 characters and can contain letters, digits, hyphens (-), and underscores (_).

kafka_manager_password

String

Yes

Indicates the password for logging in to the Kafka Manager.

The password must meet the following complexity requirements:

  • Must be a string consisting of 8 to 32 characters.
  • Contains at least three of the following characters:
    • Lowercase letters
    • Uppercase letters
    • Digits
    • Special characters `~!@#$%^&*()-_=+\|[{}];:',<.>/?

maintain_begin

String

No

Indicates the time at which a maintenance time window starts.

Format: HH:mm:ss

  • The start time and end time of the maintenance time window must indicate the time segment of a supported maintenance time window. For details about how to query the time segments of supported maintenance time windows, see Querying Maintenance Time Windows.
  • The start time must be set to 22:00:00, 02:00:00, 06:00:00, 10:00:00, 14:00:00, or 18:00:00.
  • Parameters maintain_begin and maintain_end must be set in pairs. If parameter maintain_begin is left blank, parameter maintain_end is also left blank. In this case, the system automatically sets the start time to 02:00:00.

maintain_end

String

No

Indicates the time at which a maintenance time window ends.

Format: HH:mm:ss

  • The start time and end time of the maintenance time window must indicate the time segment of a supported maintenance time window. For details about how to query the time segments of supported maintenance time windows, see Querying Maintenance Time Windows.
  • The end time is four hours later than the start time. For example, if the start time is 22:00:00, the end time is 02:00:00.
  • Parameters maintain_begin and maintain_end must be set in pairs. If parameter maintain_end is left blank, parameter maintain_start is also blank. In this case, the system automatically sets the end time to 06:00:00.

ssl_enable

Boolean

No

Indicates whether to enable SSL-encrypted access.

  • true: enable
  • false: disable

retention_policy

String

No

Indicates the action to be taken when the memory usage reaches the disk capacity threshold. Options:

  • time_base: Automatically delete the earliest messages.
  • produce_reject: Stop producing new messages.

enable_auto_topic

Boolean

No

Indicates whether to enable automatic topic creation.

  • true: enable
  • false: disable

If automatic topic creation is enabled, a topic will be automatically created with 3 partitions and 3 replicas when a message is produced to or consumed from a topic that does not exist.

storage_spec_code

String

Yes

Indicates storage I/O specification.

Options:

  • dms.physical.storage.high or dms.physical.storage.ultra when the parameter specification is 100MB
  • dms.physical.storage.high or dms.physical.storage.ultra when the parameter specification is 300MB
  • dms.physical.storage.ultra when the parameter specification is 600MB
  • dms.physical.storage.ultra when the parameter specification is 1200MB

enterprise_project_id

String

No

Indicates the enterprise project ID.

{
	"name": "kafka-test",
	"description": "",
	"engine": "kafka",
	"engine_version": "XXXX",
	"storage_space": 600,
	"access_user": "",
	"password": "",
	"kafka_manager_user": "******",
	"kafka_manager_password": "******",
	"vpc_id": "1e93f86e-13af-46c8-97d6-d40fa62b76c2",
	"security_group_id": "0aaa0033-bf7f-4c41-a6c2-18cd04cad2c8",
	"subnet_id": "b5fa806c-35e7-4299-b659-b39398dd4718",
	"available_zones": ["d573142f24894ef3bd3664de068b44b0"],
	"product_id": "00300-30308-0--0",
	"maintain_begin": "22:00:00",
	"maintain_end": "02:00:00",
	"ssl_enable": false,
	"enterprise_project_id": "0",
	"specification": "100MB",
	"partition_num": "300",
	"retention_policy": "produce_reject",
        "enable_auto_topic": true,
	"storage_spec_code": "dms.physical.storage.ultra"
}

Response

Response parameters

Table 3 describes the parameters.

Table 3 Response parameters

Parameter

Type

Description

instance_id

String

Indicates the instance ID.

Example response

{  
    "instance_id": "8959ab1c-7n1a-yyb1-a05t-93dfc361b32d"  
}

Status Code

Table 4 describes the status code of successful operations. For details about other status codes, see Status Code.

Table 4 Status code

Status Code

Description

200

The instance is created successfully.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback