Updated on 2026-08-10 GMT+08:00

Creating a Cluster (V2)

Function

This API is used to create a cluster that uses multiple different types of nodes. The cluster engine type can be Elasticsearch, OpenSearch, or Logstash.

  • An Elasticsearch cluster supports the following nodes:

  • Data node (ess): mandatory. Data nodes store the data of a cluster. If there are no client nodes in the cluster, data nodes will need to additionally handle cluster access and data analytics requests; if there are no master nodes, data nodes will need to provide cluster management.

  • Master nodes (ess-master): optional. Master nodes manage cluster-wide operations, including metadata, indexes, and shard allocation. For large-scale deployments, using dedicated master nodes enhances cluster stability, service availability, and centralized control.

  • Client nodes (ess-client): Client nodes route and coordinate search and index requests, offloading processing from data nodes for enhanced query performance and cluster scalability when there are heavy loads.

  • Cold data nodes (ess-cold): Cold data nodes are used to store and query large quantities of latency-insensitive data. They offer an effective way to manage large datasets while cutting storage costs.

  • OpenSearch clusters support the same nodes as Elasticsearch clusters.

  • Logstash clusters support the creation of Logstash nodes (lgs). Logstash nodes ingest, parse, process, and transmit data.

Constraints

  • Before creating a cluster, make sure you have planned its configuration, including the cluster size, node specifications, and storage capacity requirements.

  • You have created a VPC, subnet, and security group beforehand, or you can create them when creating the cluster.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    css:cluster:create

    Write

    cluster *

    -

    -

    • ecs:cloudServerFlavors:get
    • evs:types:get
    • vpc:vpcs:list
    • vpc:securityGroups:list
    • vpc:securityGroups:get
    • vpc:subnets:list
    • vpc:subnets:get
    • vpc:ports:create
    • vpc:ports:update
    • vpc:ports:delete
    • vpc:ports:get
    • kms:cmk:listGrants
    • kms:cmk:createGrant
    • kms:cmk:list
    • kms:cmk:get
    • css:cluster:getAgencies
    • iam:agencies:listAgencies
    • iam:permissions:listRolesForAgency
    • iam:permissions:listRolesForAgencyOnProject
    • iam:agencies:pass

    -

    • g:EnterpriseProjectId

    • g:RequestTag/<tag-key>

    • g:TagKeys

URI

POST /v2.0/{project_id}/clusters

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

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

Constraints

N/A

Range

Project ID of an account. The value contains 32 characters, consisting of lowercase letters and digits.

Default Value

N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

cluster

Yes

CreateClusterBody object

Definition:

Cluster object.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Table 3 CreateClusterBody

Parameter

Mandatory

Type

Description

name

Yes

String

Definition

Cluster name.

Constraints

N/A

Range

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

Default Value

N/A

desc

No

String

Definition

Cluster description.

Constraints

N/A

Range

The value can contain at most 128 characters. Only letters and digits are allowed.

Default Value

N/A

backupStrategy

No

CreateClusterBackupStrategyBody object

Definition:

Automatic snapshot creation.

Constraints:

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

Value range:

N/A

Default value:

N/A

roles

Yes

Array of CreateClusterRolesBody objects

Definition

Cluster node information array. Each element in the array is a CreateClusterRolesBody object, indicating the configuration information of a cluster node.

Constraints

N/A

Range

N/A

Default Value

N/A

nics

Yes

CreateClusterInstanceNicsBody object

Definition:

Network configuration information.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

enterprise_project_id

No

String

Definition

Enterprise project ID. When you create a cluster, associate the enterprise project ID with the cluster. For details about how to obtain the enterprise project ID, see Listing Enterprise Projects.

Constraints

N/A

Range

The value can contain at most 36 characters. It is string 0 or in UUID format with hyphens (-).

Default Value

0 indicates the default enterprise project.

tags

No

Array of CreateClusterTagsBody objects

Definition

Cluster tag array. Each element in the array is a CreateClusterTagsBody object, indicating a tag key-value pair.

Constraints

N/A

Range

N/A

Default Value

N/A

availability_zone

Yes

String

Definition

The availability zone (AZ) where the nodes are located. Specify the AZ name.

Constraints

When selecting multiple AZs, the zone names must not be duplicated.

When selecting two AZs, each AZ must contain at least two data nodes (ess) or cold data nodes (ess-cold).

If the number of nodes is a multiple of the number of AZs, the nodes are evenly distributed across the AZs.

If the number of nodes is not a multiple of the number of AZs, the absolute difference in the number of nodes among AZs must not exceed 1.

For details about AZs, see the basic concepts in Before You Start of CSS.

Range

When specifying the AZs of nodes, separate zone names with commas (,). For example, for general AZs, if multiple AZs are selected, availability_zone should be set to region-1a,region-1b,region-1c.

Default Value

N/A

datastore

Yes

CreateClusterDatastoreBody object

Definition:

Engine type of the cluster to be created.

Constraints:

N/A

Value range:

The value can be elasticsearch, opensearch, or logstash.

Default value:

N/A

authorityEnable

No

Boolean

Definition:

Whether to enable security authentication for a cluster.

Constraints:

This parameter is available only for Elasticsearch and OpenSearch clusters.

  • Elasticsearch: Only Elasticsearch 6.5.4 and later versions support security-mode clusters.

  • OpenSearch: No constraints.

  • true: Authentication is enabled for the cluster.

  • false: Authentication is disabled for the cluster.

Value range:

Default value:

false

httpsEnable

No

Boolean

Definition:

Whether communication is encrypted on the cluster.

Constraints:

When httpsEnable is set to true, authorityEnable must be set to true.

Only Elasticsearch 6.5.4 security-mode clusters and later support this parameter.

HTTPS access can be disabled only for OpenSearch 1.3.6 and 2.19.0 security-mode clusters. For other versions, HTTPS access is forcibly enabled and cannot be disabled.

Value range:

  • true: Communication is encrypted on the cluster.

  • false: Communication is not encrypted for the cluster.

Default value:

false

adminPwd

No

String

Definition:

Password of the administrator admin for a security-mode cluster.

Constraints:

This parameter is mandatory only when authorityEnable is set to true during cluster creation.

Value range:

A string of 8 to 32 characters. Must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters ~!@#$%&*()-_=|[{}];:,<.>/?

Default value:

N/A

publicIPReq

No

CreateClusterPublicIpReq object

Definition:

Public network access information.

Constraints:

This parameter is valid only when httpsEnable is set to true.

Value range:

N/A

Default value:

N/A

loadBalance

No

CreateClusterLoadBalance object

Definition:

VPC endpoint service information.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

publicKibanaReq

No

CreateClusterPublicKibanaReq object

Definition:

Public network access whitelist for Kibana/Dashboards.

Constraints:

This parameter is valid only when authorityEnable is set to true.

Value range:

N/A

Default value:

N/A

payInfo

No

PayInfoBody object

Definition:

Parameters used for purchasing a yearly/monthly cluster.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

ipv6_enable

No

Boolean

Definition:

Whether to enable automatic IPv6 address assignment for the cluster.

Constraints:

N/A

Value range:

  • true: Automatic IPv6 address assignment is enabled for the cluster.

  • false: Automatic IPv6 address assignment is disabled for the cluster.

Default value:

false

diskEncryption

No

diskEncryptionInfo object

Definition:

Disk encryption information.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Table 4 CreateClusterBackupStrategyBody

Parameter

Mandatory

Type

Description

period

Yes

String

Definition:

Time when a snapshot is created every day.

Constraints:

Snapshots can only be created on the hour. The time format is the time followed by the time zone, specifically, HH:mm z. In the format, 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.

Value range:

N/A

Default value:

00:00 GMT+08:00.

NOTE:
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.

frequency

No

String

Definition:

Frequency of automatically creating snapshots.

Constraints:

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.

Value range:

  • HOUR: Execute once every hour on the hour.

  • DAY: Execute once every day.

  • SUN, MON, TUE, WED, THU, FRI, and SAT: Execute once on the specified day of a week. For example, SUN indicates that the task is executed once every Sunday.

Default value:

DAY

prefix

Yes

String

Definition

Prefix of a snapshot that is automatically created, which is manually entered.

Constraints

N/A

Range

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

Default Value

N/A

keepday

Yes

Integer

Definition

Number of snapshots to be retained.

Constraints

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.

Range

1 to 90

Default Value

N/A

bucket

Yes

String

Definition

Name of the OBS bucket used for backup.

Constraints

Select an OBS bucket that meets the following requirements:

  • Storage class: Standard.

  • Region: The same as that of the cluster.

Range

The bucket name can contain 3 to 63 characters. Only lowercase letters, digits, hyphens (-), and periods (.) are allowed.

Default Value

N/A

basePath

Yes

String

Definition

Snapshot storage path in the OBS bucket.

Constraints

N/A

Range

The backup path cannot:

  • Contain the following characters: :*?"<>|'{}

  • Start with a slash (/).

  • Start or end with a period (.).

  • Contain more than two consecutive slashes (/) or periods (.).

  • Exceed 512 characters.

Default Value

N/A

agency

No

String

Definition

Select an IAM agency to grant the current account the permission to access and use OBS.

Constraints

N/A

Range

The agency name can contain at most 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed.

Default Value

N/A

NOTE:
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.

maxSnapshotBytesPerSeconds

No

String

Parameter description:

This parameter sets the maximum backup speed per node (bytes per second). When it is exceeded, flow control is triggered to prevent excessive resource usage and ensure system stability. The actual backup speed may not reach the configured value, as it depends on many factors, such as OBS performance and disk I/O.

Constraints

N/A

Value range:

The following values and formats are allowed:

  • Number + Unit

The number ranges from 0 to 9999.

The unit can be k, kb, m, mb, g, gb, t, tb, p, pb, or b (case-insensitive).

0mb means there is no speed limit. An overly high backup speed may lead to excessive resource usage, which may impact system stability. Therefore, set this parameter carefully.

  • 0

There is no speed limit. An overly high backup speed may lead to excessive resource usage, which may impact system stability. Therefore, set this parameter carefully.

  • -1

There is no speed limit. An overly high backup speed may lead to excessive resource usage, which may impact system stability. Therefore, set this parameter carefully.

Default value:

40mb

maxRestoreBytesPerSeconds

No

String

Parameter description:

This parameter sets the maximum recovery speed per node (bytes per second). When it is exceeded, flow control is triggered to prevent excessive resource usage and ensure system stability. The actual recovery speed may not reach the configured value, as it depends on many factors, such as OBS performance and disk I/O.

Constraints

For OpenSearch clusters and Elasticsearch clusters later than 7.6.2, the recovery speed is also limited by the indices.recovery.max_bytes_per_sec parameter. If Maximum recovery speed (per second) is lower than indices.recovery.max_bytes_per_sec, flow control is triggered when the former is reached. If Maximum recovery speed (per second) is higher than indices.recovery.max_bytes_per_sec, flow control is triggered when the latter is reached.

Value range:

The following values and formats are allowed:

  • Number + Unit

The number ranges from 0 to 9999.

The unit can be k, kb, m, mb, g, gb, t, tb, p, pb, or b (case-insensitive).

0mb means there is no speed limit. (However, for OpenSearch clusters and Elasticsearch clusters later than 7.6.2, the recovery speed is also limited by the indices.recovery.max_bytes_per_sec parameter.) An overly high recovery speed may lead to excessive resource usage, which may impact system stability. Therefore, set this parameter carefully.

  • 0

There is no speed limit. (However, for OpenSearch clusters and Elasticsearch clusters later than 7.6.2, the recovery speed is also limited by the indices.recovery.max_bytes_per_sec parameter.) An overly high recovery speed may lead to excessive resource usage, which may impact system stability. Therefore, set this parameter carefully.

  • -1

There is no speed limit. (However, for OpenSearch clusters and Elasticsearch clusters later than 7.6.2, the recovery speed is also limited by the indices.recovery.max_bytes_per_sec parameter.) An overly high recovery speed may lead to excessive resource usage, which may impact system stability. Therefore, set this parameter carefully.

Default value:

For Elasticsearch clusters of 7.6.2 or earlier, the default setting is 40mb.

For OpenSearch clusters and Elasticsearch clusters later than 7.6.2, the default setting is no limit, but the recovery speed is still limited by the indices.recovery.max_bytes_per_sec parameter.

Table 5 CreateClusterRolesBody

Parameter

Mandatory

Type

Description

flavorRef

Yes

String

Definition

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

Constraints

N/A

Range

N/A

Default Value

N/A

volume

Yes

CreateClusterInstanceVolumeBody object

Definition

Disk configuration information, including the disk type and size.

Constraints

If flavorRef is set to a local disk flavor, leave this parameter blank. Obtain the local disk flavor by referring to the diskrange attribute in Obtaining the Instance Specifications List.

Range

N/A

Default Value

N/A

type

Yes

String

Definition:

Node type.

Constraints:

N/A

Value range:

  • ess: data node

  • ess-cold: cold data node

  • ess-client: client node

  • ess-master: master node

  • lgs: Logstash node

  • english indicates an English language model.

  • arabic indicates an Arabic model.

  • thai indicates a Thai model.

  • turkish indicates a Turkish language model.

  • tools indicates a tools model.

  • portuguese indicates a Portuguese model.

  • spanish indicates a Spanish model.

  • chinese-english: general model for Chinese and English.

  • spanish-portuguese: general model for Spanish and Portuguese.] (tag:non_helpcenter)

[- chinese indicates a Chinese language model.

Default value:

N/A

instanceNum

Yes

Integer

Definition:

Number of instances.

Constraints:

See the value range.

Value range:

  • If ess is selected, you can set the value to 1 to 32.

    • If both ess and ess-master are selected, you can set the value to 1 to 200.

    • If both ess and ess-client are selected, you can set the value to 1 to 32.

    • If both ess and ess-cold are selected, you can set the value to 32.

  • If ess-master is selected, you can set the value to 3 to 9.

  • If ess-client is selected, you can set the value to 1 to 64.

  • If ess-cold is selected, you can set the value to 1 to 32.

  • For Logstash nodes, the value ranges from 1 to 100.

Default value:

N/A

Table 6 CreateClusterInstanceVolumeBody

Parameter

Mandatory

Type

Description

volume_type

Yes

String

Definition:

Disk type.

Constraints:

N/A

Value range:

  • COMMON: common I/O

  • HIGH: high I/O

  • ULTRAHIGH: ultra-high I/O

  • ESSD: ultra-fast SSD

Default value:

N/A

size

Yes

Integer

Definition

Disk size, in GB.

Constraints

N/A

Range

You can obtain the disk size from the diskrange attribute in Obtaining the Instance Specifications List.

The value must be greater than 0 and a common multiple of 4 and 10, in GB.

Default Value

  • ess and ess-cold nodes: 100 GB or the minimum disk capacity supported by the selected node flavor, whichever is larger.

  • ess-master and ess-client nodes: The default volume size is 40 GB and cannot be changed.

NOTE:
For ess and ess-cold nodes, 100 GB or a larger value is recommended.
Table 7 CreateClusterInstanceNicsBody

Parameter

Mandatory

Type

Description

vpcId

Yes

String

Definition

VPC ID, which is used for configuring cluster network. For details about how to obtain the ID, see Querying VPCs.

Constraints

N/A

Range

N/A

Default Value

N/A

netId

Yes

String

Definition

Subnet ID (network ID). For details about how to obtain the ID, see Obtaining the Subnet ID.

Constraints

N/A

Range

N/A

Default Value

N/A

securityGroupId

Yes

String

Definition

Security group ID. For details about how to obtain the ID, see Querying Security Groups.

Constraints

N/A

Range

N/A

Default Value

N/A

ips

No

Array of strings

Definition

Node IP address, which is configured when a cluster is created.

Only Elasticsearch and OpenSearch support this parameter.

  • Assign automatically: Private IPv4 addresses will be automatically assigned to cluster nodes.

  • Assign manually: Manually assign private IPv4 addresses to cluster nodes. Before assigning an IP address, click View In-Use IP Address to check IP addresses that are already in use.

Constraints

N/A

Default Value

N/A

Table 8 CreateClusterTagsBody

Parameter

Mandatory

Type

Description

key

Yes

String

Definition:

Tag key.

Constraints:

N/A

Value range:

The value can contain 1 to 36 characters. Only digits, letters, hyphens (-), and underscores (_) are allowed.

Default value:

N/A

value

Yes

String

Definition:

Tag value.

Constraints:

N/A

Value range:

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

Default value:

N/A

Table 9 CreateClusterDatastoreBody

Parameter

Mandatory

Type

Description

version

Yes

String

Definition:

Version of the CSS cluster engine. For details, see the supported versions in Before You Start.

Constraints:

N/A

Value range:

N/AFor a serverless cluster, logs, search, and vector are supported.

Default value:

N/A

type

Yes

String

Definition:

Engine type of the cluster to be created.

Constraints:

N/A

Value range:

  • elasticsearch: Elasticsearch cluster.

  • opensearch: OpenSearch cluster.

  • logstash: Logstash cluster.

- serverless-opensearch: serverless cluster.

Default value:

N/A

Table 10 CreateClusterPublicIpReq

Parameter

Mandatory

Type

Description

eip

Yes

CreateClusterPublicEip object

Definition:

Public network bandwidth.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

elbWhiteListReq

No

CreateClusterElbWhiteList object

Definition:

Whitelist for public network access control.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

publicBindType

Yes

String

Definition:

Whether to automatically bind an EIP.

Constraints:

N/A

Value range:

Currently, only auto_assign is supported.

Default value:

N/A

eipId

No

String

Definition:

EIP ID.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Table 11 CreateClusterPublicEip

Parameter

Mandatory

Type

Description

bandWidth

Yes

CreateClusterPublicEipSize object

Definition:

Set the public network bandwidth.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Table 12 CreateClusterPublicEipSize

Parameter

Mandatory

Type

Description

size

Yes

Integer

Definition:

Bandwidth size, in Mbit/s.

Constraints:

N/A

Value range:

1-200

Default value:

1

Table 13 CreateClusterElbWhiteList

Parameter

Mandatory

Type

Description

enableWhiteList

Yes

Boolean

Definition:

Whether to enable public network access control.

Constraints:

N/A

Value range:

  • true: A whitelist is set. Only IP addresses or CIDR blocks on this whitelist can access the cluster from the public network.

  • false: All IP addresses can access the cluster through the public network.

Click +Add. In the displayed text box, enter IP addresses or CIDR blocks. Separate them using commas (,). Each value must be unique. An example of valid values: 192.168.1.1,10.0.0.0/24. Examples of invalid values: 0.0.0.0, x.x.x.x0, 172.16.0.0-172.16.255.255, non-standard formats (e.g., 192.168.1), and duplicate values.

Default value:

false

whiteList

No

String

Definition:

Public network access control whitelist.

Constraints:

Separate the whitelisted CIDR blocks or IP addresses with commas (,), and make sure each of them is unique.

Value range:

N/A

Default value:

N/A

Table 14 CreateClusterLoadBalance

Parameter

Mandatory

Type

Description

endpointWithDnsName

Yes

Boolean

Definition:

Specifies the private domain name for accessing the VPC endpoint.

Constraints:

N/A

Value range:

  • true: Internal domain names are supported. The system automatically assigns a private domain name to the VPC endpoint.

  • false: Internal domain names are not supported. No private domain name is assigned for the VPC endpoint. The cluster can only be accessed through an IP address assigned to the VPC endpoint.

Default value:

false

vpcPermissions

No

Array of strings

Definition:

Access control.

Constraints:

N/A

Value range:

N/A.

Default value:

N/A

professionVpcep

No

Boolean

Definition:

Create a professional VPC endpoint.

Constraints:

N/A

Value range:

  • true: enable. Create professional VPC endpoints that support the IPv4/IPv6 dual-stack network.

  • false: disable. Create basic VPC endpoints that support IPv4 only.

Default value:

false

dualstackEnable

No

Boolean

Definition:

Whether to enable IPv4/IPv6 dual-stack networking.

Constraints:

The IPv4/IPv6 dual-stack network can be enabled only when a professional VPC endpoint is created and the VPC of the cluster supports IPv6.

Value range:

  • true: enable. The system automatically assigns an IPv6 address to the VPC endpoint.

  • false: disable. The VPC endpoint does not support IPv6 addresses.

Default value:

false

Table 15 CreateClusterPublicKibanaReq

Parameter

Mandatory

Type

Description

eipSize

Yes

Integer

Definition:

Bandwidth size, in Mbit/s.

Constraints:

N/A

Value range:

1-200

Default value:

1

elbWhiteList

No

CreateClusterPublicKibanaElbWhiteList object

Definition:

Public network access whitelist for Kibana/Dashboards.

Constraints:

N/A

Table 16 CreateClusterPublicKibanaElbWhiteList

Parameter

Mandatory

Type

Description

whiteList

Yes

String

Definition

List of IP addresses or CIDR blocks that can access the cluster through the Kibana/Dashboards public network address.

Constraints

Separate the whitelisted CIDR blocks or IP addresses with commas (,), and make sure each of them is unique.

Range

N/A

Default Value

N/A

enableWhiteList

Yes

Boolean

Definition:

Whether to enable public network access control for Kibana/Dashboards.

Constraints:

N/A

Value range:

  • true: A whitelist is set. Only IP addresses or CIDR blocks on this whitelist can access Kibana/Dashboards from the public network.

  • false: All IP addresses can access the cluster's Kibana/Dashboards through the public network.

Click +Add. In the displayed text box, enter IP addresses or CIDR blocks. Separate them using commas (,). Each value must be unique. An example of valid values: 192.168.1.1,10.0.0.0/24. Examples of invalid values: 0.0.0.0, x.x.x.x0, 172.16.0.0-172.16.255.255, non-standard formats (e.g., 192.168.1), and duplicate values.

Default value:

false

Table 17 PayInfoBody

Parameter

Mandatory

Type

Description

payModel

Yes

Integer

Definition:

Cluster subscription period type.

Constraints:

N/A

Value range:

  • 2: monthly.

  • 3: yearly.

Default value:

N/A

period

Yes

Integer

Definition

Cluster subscription periods, in months or years, depending on the value of payModel.

Constraints

N/A

Range

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

  • If payModel is 3, the value ranges from 1 to 3.

Default Value

N/A

isAutoRenew

No

Integer

Definition:

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

Constraints:

N/A

Value range:

  • 1: Auto renewal is enabled.

  • 0: Auto renewal is disabled.

Default value:

0

isAutoPay

No

Integer

Definition:

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

Constraints:

N/A

Value range:

  • 1: Discounts and coupons will be automatically selected. The fee will be deducted from your Huawei Cloud account. If the automatic payment fails, an order in Pending Payment state is generated waiting for manual payment. (During manual payment, the customer 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.)

Default value:

0

Table 18 diskEncryptionInfo

Parameter

Mandatory

Type

Description

systemEncrypted

No

String

Definition:

Whether disk encryption is enabled. KMS is used to encrypt the data disks of cluster nodes to ensure the security of stored data.

Constraints:

Disk encryption and decryption do not alter cluster management or O&M processes. However, they do increase the system's processing load, potentially affecting the system's operational performance.

Value range:

  • 0: Disable disk encryption.

  • 1: Enable disk encryption.

Default value:

0

systemCmkid

No

String

Definition

Disk key ID. For details about how to obtain the key ID, see Querying the Key List.
  • Key algorithm: AES or SM4.

  • Key usage: ENCRYPT_DECRYPT.

After cluster creation, the KMS key cannot be changed. If the KMS key used by the cluster is disabled, the cluster cannot be scaled or upgraded, its node specifications or AZs cannot be changed, and its nodes cannot be replaced (by specifying the nodes that need replacement). To solve this problem, you will have to create a new cluster and migrate your data to that new cluster. Range N/A Default Value N/A

Constraints

This parameter is valid only when systemEncrypted is set to 1.

Select a KMS key from the drop-down list. KMS keys that are unavailable in this drop-down list are not supported by the cluster. Set a key that meets the following requirements:

Response Parameters

Status code: 200

Table 19 Response body parameters

Parameter

Type

Description

cluster

CreateClusterResp object

Definition:

Cluster object. For a pay-per-use cluster, only the cluster parameter is returned.

Value range:

N/A.

orderId

String

Definition

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

Range

N/A

Table 20 CreateClusterResp

Parameter

Type

Description

id

String

Definition:

Cluster ID.

Value range:

N/A.

name

String

Definition:

Cluster name.

Value range:

N/A.

Example Requests

  • Example request for creating a yearly/monthly Elasticsearch cluster.

    POST https://{Endpoint}/v2.0/{project_id}/clusters
    
    {
      "cluster" : {
        "name" : "css-cluster",
        "desc" : "test cluster",
        "backupStrategy" : {
          "period" : "16:00 GMT+08:00",
          "prefix" : "snapshot",
          "keepday" : 30,
          "frequency" : "DAY",
          "bucket" : "OBS-obsName",
          "basePath" : "css_repository/obs-path",
          "agency" : "css_obs_agency",
          "maxSnapshotBytesPerSeconds" : "40MB",
          "maxRestoreBytesPerSeconds" : "40MB"
        },
        "roles" : [ {
          "flavorRef" : "ess.spec-4u8g",
          "volume" : {
            "volume_type" : "COMMON",
            "size" : 100
          },
          "type" : "ess",
          "instanceNum" : 3
        } ],
        "nics" : {
          "vpcId" : "9323ac95-cb0a-4515-8013-5897c445e173",
          "netId" : "c24a34a1-6b5b-4f83-8461-88ef4ecf91e1",
          "securityGroupId" : "a2849f7c-c35c-497c-a617-b69be0a96157"
        },
        "enterprise_project_id" : "0",
        "tags" : [ {
          "key" : "k1",
          "value" : "v1"
        }, {
          "key" : "k2",
          "value" : "v2"
        } ],
        "availability_zone" : "az_code1",
        "datastore" : {
          "version" : "7.10.2",
          "type" : "elasticsearch"
        },
        "authorityEnable" : true,
        "httpsEnable" : true,
        "adminPwd" : "{password}",
        "publicIPReq" : {
          "eip" : {
            "bandWidth" : {
              "size" : 1
            }
          },
          "elbWhiteListReq" : {
            "enableWhiteList" : true,
            "whiteList" : "127.0.0.1"
          },
          "publicBindType" : "auto_assign",
          "eipId" : null
        },
        "loadBalance" : {
          "endpointWithDnsName" : false,
          "vpcPermissions" : [ "{Account ID}" ]
        },
        "publicKibanaReq" : {
          "eipSize" : 5,
          "elbWhiteList" : {
            "whiteList" : "127.0.0.1",
            "enableWhiteList" : true
          }
        },
        "payInfo" : {
          "payModel" : 2,
          "period" : 1,
          "isAutoRenew" : 1,
          "isAutoPay" : null
        }
      }
    }
  • Example request for creating a pay-per-use Elasticsearch cluster

    POST https://{Endpoint}/v2.0/{project_id}/clusters
    
    {
      "cluster" : {
        "name" : "css-cluster",
        "desc" : "test cluster",
        "backupStrategy" : {
          "period" : "16:00 GMT+08:00",
          "prefix" : "snapshot",
          "keepday" : 30,
          "frequency" : "DAY",
          "bucket" : "OBS-obsName",
          "basePath" : "css_repository/obs-path",
          "agency" : "css_obs_agency",
          "maxSnapshotBytesPerSeconds" : "40MB",
          "maxRestoreBytesPerSeconds" : "40MB"
        },
        "roles" : [ {
          "flavorRef" : "ess.spec-4u8g",
          "volume" : {
            "volume_type" : "COMMON",
            "size" : 100
          },
          "type" : "ess",
          "instanceNum" : 3
        } ],
        "nics" : {
          "vpcId" : "9323ac95-cb0a-4515-8013-5897c445e173",
          "netId" : "c24a34a1-6b5b-4f83-8461-88ef4ecf91e1",
          "securityGroupId" : "a2849f7c-c35c-497c-a617-b69be0a96157"
        },
        "enterprise_project_id" : "0",
        "tags" : [ {
          "key" : "k1",
          "value" : "v1"
        }, {
          "key" : "k2",
          "value" : "v2"
        } ],
        "availability_zone" : "az_code1",
        "datastore" : {
          "version" : "7.10.2",
          "type" : "elasticsearch"
        },
        "authorityEnable" : true,
        "httpsEnable" : true,
        "adminPwd" : "{password}",
        "publicIPReq" : {
          "eip" : {
            "bandWidth" : {
              "size" : 1
            }
          },
          "elbWhiteListReq" : {
            "enableWhiteList" : true,
            "whiteList" : "127.0.0.1"
          },
          "publicBindType" : "auto_assign",
          "eipId" : null
        },
        "loadBalance" : {
          "endpointWithDnsName" : false,
          "vpcPermissions" : [ "{Account ID}" ]
        },
        "publicKibanaReq" : {
          "eipSize" : 5,
          "elbWhiteList" : {
            "whiteList" : "127.0.0.1",
            "enableWhiteList" : true
          }
        }
      }
    }

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"
      }
    }
  • Example response for creating a yearly/monthly cluster.

    {
      "orderId" : "CS2208241141LY94J",
      "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.