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 a cluster

Updated on 2025-01-23 GMT+08:00

Function

This API is used to create a cluster.

Debugging

You can debug this API through automatic authentication in API Explorer.

URI

POST /v1.0/{project_id}/clusters

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID and name, see Obtaining the Project ID and Name.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

cluster

Yes

CreateClusterBody object

Cluster object.

Table 3 CreateClusterBody

Parameter

Mandatory

Type

Description

instance

Yes

CreateClusterInstanceBody object

Instance.

datastore

Yes

CreateClusterDatastoreBody object

Search engine.

name

Yes

String

Cluster name It can contain 4 to 32 characters. Only digits, letters, hyphens (-), and underscores (_) are allowed. The value must start with a letter.

instanceNum

Yes

Integer

Number of clusters. The value range is 1 to 32.

backupStrategy

No

CreateClusterBackupStrategyBody object

Automatic snapshot creation policy, which is disabled by default.

The automatic snapshot creation policy is enabled only if backupStrategy is not left blank.

httpsEnable

No

Boolean

Whether communication is encrypted on the cluster. The value can be true or false. By default, communication encryption is disabled. If httpsEnable is set to true, authorityEnable must be set to true.

  • true: Communication is encrypted on the cluster.

  • false: Communication is not encrypted on the cluster.

This parameter is supported in clusters 6.5.4 or later.

authorityEnable

No

Boolean

Whether to enable authentication. The value can be true or false. Authentication is disabled by default.

  • true indicates that authentication is enabled for the cluster.

  • true indicates that authentication is enabled for the cluster.

This parameter is supported in clusters 6.5.4 or later.

adminPwd

No

String

Password of the cluster user admin in security mode. This parameter is mandatory only if authorityEnable is set to true.

  • The administrator password must meet the following requirements:

    • The password can contain 8 to 32 characters.

    • Passwords must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters (~!@#$%^&*()-_=+\|[{}];:,<.>/?).

  • Weak password verification is required for a security cluster. You are advised to set a strong password.

enterprise_project_id

No

String

Enterprise project ID. When creating a cluster, associate the enterprise project ID with the cluster. The value can contain a maximum of 36 characters. It is string 0 or in UUID format with hyphens (-). Value 0 indicates the default enterprise project.

tags

No

Array of CreateClusterTagsBody objects

Cluster tag.

payInfo

No

payInfoBody object

Parameters used for purchasing a yearly/monthly cluster.

ipv6_enable

No

Boolean

Whether to enable automatic IPv6 address assignment for the cluster. The default value is false.

Table 4 CreateClusterInstanceBody

Parameter

Mandatory

Type

Description

flavorRef

Yes

String

Instance flavor. For details about the current instance flavor, see the name attribute in Obtaining the Instance Specifications List.

volume

Yes

CreateClusterInstanceVolumeBody object

Volume information. You do not need to set this parameter when flavorRef is set to a local disk flavor. Currently, the following local disk flavors are supported:

  • ess.spec-i3small

  • ess.spec-i3medium

  • ess.spec-i3.8xlarge.8

  • ess.spec-ds.xlarge.8

  • ess.spec-ds.2xlarge.8

  • ess.spec-ds.4xlarge.8

nics

Yes

CreateClusterInstanceNicsBody object

Subnet ID.

availability_zone

Yes

String

Availability zone (AZ). You need to specify the AZ name.

By default, a single AZ is specified. If multiple AZs are specified, use commas (,) to separate AZ names. Take CN North-Beijing4 as an example. If three AZs are selected, the value of availability_zone is cn-north-4a,cn-north-4b,cn-north-4c. If a single AZ is used, the value of availability_zone is empty by default.

NOTE:

NOTE

- If multiple AZs are selected, the name of each AZ must be unique, and the number of nodes must be greater than or equal to the number of AZs.

- If the number of nodes is a multiple of the number of AZs, the nodes are evenly distributed to each AZ.

- If the number of nodes is not a multiple of the number of AZs, the absolute difference between node quantity in any two AZs is 1 at most.

- Obtain AZ names fromRegions and Endpoints.

Table 5 CreateClusterInstanceVolumeBody

Parameter

Mandatory

Type

Description

volume_type

Yes

String

Volume type

  • COMMON: common I/O

  • HIGH: high I/O

  • ULTRAHIGH: ultra-high I/O

  • ESSD: ultra-fast SSD

size

Yes

Integer

Volume size. The value must be greater than 0 and a multiple of 4 and 10. For details about the local disk size, see the diskrange attribute in Obtaining the Instance Specifications List. Unit: GB

Table 6 CreateClusterInstanceNicsBody

Parameter

Mandatory

Type

Description

vpcId

Yes

String

VPC ID, which is used for configuring cluster network.

netId

Yes

String

Subnet ID (network ID).

securityGroupId

Yes

String

Security group ID.

Table 7 CreateClusterDatastoreBody

Parameter

Mandatory

Type

Description

version

Yes

String

Elasticsearch/Logstash engine version. For details, see the supported versions in Before You Start.

type

Yes

String

Engine type. The value can be elasticsearch, logstash, or opensearch.

Table 8 CreateClusterBackupStrategyBody

Parameter

Mandatory

Type

Description

period

Yes

String

Time when a snapshot is generated every day. Snapshots can only be generated on the hour. The format is HH:mm z: HH:mm refers to the hour time and z refers to the time zone. For example, 00:00 GMT+08:00 and 01:00 GMT+08:00.

NOTE:

The default value is 00:00 GMT+08:00. When frequency is set to HOUR, you do not need to specify period. By default, snapshot creation starts from the next hour after the settings are successful.

prefix

Yes

String

Prefix of a snapshot that is automatically created, which is manually entered. Enter up to 32 characters and start with a lowercase letter. Lowercase letters, digits, hyphens (-), and underscores (_) are allowed.

keepday

Yes

Integer

Set the number of retained snapshots. The value ranges from 1 to 90. Expired snapshots will be automatically deleted on the half hour. The deletion policy applies only to automated snapshots that are executed at the same frequency as the current automatic snapshot creation policy.

bucket

No

String

Name of the OBS bucket used for backup.

basePath

No

String

Storage path of the snapshot in the OBS bucket.

agency

No

String

IAM agency used to access OBS.

If none of the bucket, basePath, and agency parameters are specified, the system will automatically create an OBS bucket and an IAM agency. If the creation fails, you need to manually configure correct parameters.

frequency

No

String

Frequency of automatically creating snapshots.

NOTE:

The default value is DAY. If this parameter is set to HOUR, the scheduled task is executed every hour. If this parameter is set to DAY, the scheduled task is executed every day. If this parameter is set to SUN, MON, TUE, WED, THU, FRI or SAT, the scheduled task is executed at the specified day of every week. For example, SUN indicates that the task is executed once every Sunday. The number of retained snapshots depends on the execution frequency and indexes set in the automatic snapshot creation policy. If the execution interval is short or the index data volume is large, the number of retained automatic snapshots may not reach the preset value. Set this value based on actual conditions.

Table 9 CreateClusterTagsBody

Parameter

Mandatory

Type

Description

key

Yes

String

Separate multiple AZs with commas (,). For example, to specify three AZs in CN North-Beijing4, you can set availability_zone to cn-north-4a,cn-north-4b,cn-north-4c. By default, a single AZ is created when this parameter is not specified.

value

Yes

String

Tag value. The value can contain 0 to 43 characters. It can only contain digits, letters, hyphens (-), and underscores (_).

Table 10 payInfoBody

Parameter

Mandatory

Type

Description

payModel

Yes

Integer

Subscription period type.

  • 2: Monthly

  • 3: Yearly

period

Yes

Integer

Subscribed periods.

  • If payModel is 2, the value range is 1 to 9.

  • If payModel is 3, the value range is 1 to 3.

isAutoRenew

No

Integer

Whether to automatically renew the subscription. If this parameter is not specified, the subscription is not automatically renewed.

  • 1: Yes

  • 2: No (default value)

isAutoPay

No

Integer

Indicates whether to enable automatic payment from your Huawei Cloud account. This parameter takes effect only for yearly/monthly clusters.

  • 1: Yes. (Discounts and coupons are automatically selected. The fee will be automatically deducted from your Huawei Cloud account.) If the automatic payment fails, an unpaid order will be generated, and you need to manually complete the payment. (During manual payment, you can still modify the discounts and coupons that were automatically selected.)

  • 0: No. (The customer needs to manually pay for the bill. Discounts and coupons can be used.) The default value is 0.

Response Parameters

Status code: 200

Table 11 Response body parameters

Parameter

Type

Description

cluster

CreateClusterClusterResponse object

Cluster object.

orderId

String

Order ID. This parameter is returned only when a yearly/monthly cluster is created.

Table 12 CreateClusterClusterResponse

Parameter

Type

Description

id

String

Cluster ID.

name

String

Cluster name

Example Requests

Example request for creating a pay-per-use cluster.

POST /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters

{
  "cluster" : {
    "instance" : {
      "flavorRef" : "ess.spec-4u16g",
      "volume" : {
        "volume_type" : "COMMON",
        "size" : 120
      },
      "nics" : {
        "vpcId" : "{VPC ID}",
        "netId" : "{NET ID}",
        "securityGroupId" : "{Security group ID}"
      },
      "availability_zone" : "{AZ CODE}"
    },
    "datastore" : {
      "version" : "{cluster-version}",
      "type" : "elasticsearch"
    },
    "name" : "cluster-name",
    "instanceNum" : 3,
    "backupStrategy" : {
      "period" : "16:00 GMT+08:00",
      "prefix" : "snapshot",
      "keepday" : 7,
      "frequency" : "DAY",
      "bucket" : "css-obs-backup",
      "basePath" : "css_repository/obs-path",
      "agency" : "css_obs_agency"
    },
    "httpsEnable" : true,
    "authorityEnable" : true,
    "adminPwd" : "{password}",
    "enterprise_project_id" : "0",
    "tags" : [ {
      "key" : "k1",
      "value" : "v1"
    }, {
      "key" : "k2",
      "value" : "v2"
    } ]
  }
}

Example Responses

Status code: 200

Request succeeded.

Example response for creating a pay-per-use cluster.

{
  "cluster" : {
    "id" : "ef683016-871e-48bc-bf93-74a29d60d214",
    "name" : "ES-Test"
  }
}

Status Codes

Status Code

Description

200

Request succeeded.

400

Invalid request.

Modify the request before retry.

409

The request could not be completed due to a conflict with the current state of the resource.

The resource that the client attempts to create already exists, or the update request fails to be processed because of a conflict.

412

The server did not meet one of the preconditions contained in the request.

Error Codes

See Error Codes.

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