Updated on 2025-08-15 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.

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

Value range:

Project ID of the account.

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

Value range:

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

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.

Constraints:

N/A

Value 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.

Constraints:

N/A

Value range:

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

Default value:

0 indicates an enterprise project.

tags

No

Array of CreateClusterTagsBody objects

Definition:

Cluster tags.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

availability_zone

Yes

String

Definition:

AZ of the node. The AZ name needs to be specified.

Constraints:

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 evenly divisible by the number of AZs, the nodes will be evenly distributed among all AZs.

If the number of nodes is not evenly divisible by the number of AZs, the absolute difference between node quantity in any two AZs is 1 at most.

To learn more about AZs, see Basic Concepts in CSS Before You Start.

Value range:

When specifying the AZs of nodes, use commas (,) to separate different AZ names. For example, if multiple AZs are selected for general AZs, the value of availability_zone is 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:

Kibana public network access information.

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:

Enter up to 32 characters and start with a lowercase letter. Lowercase letters, digits, hyphens (-), and underscores (_) are allowed.

Value range:

N/A

Default value:

N/A

keepday

Yes

Integer

Definition:

Customize the 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.

Value range:

1–90

Default value:

N/A

bucket

No

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.

Value range:

N/A

Default value:

N/A

basePath

No

String

Definition:

Storage path of the snapshot in the OBS bucket.

Constraints:

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.

Value range:

N/A

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

Value range:

The agency name can contain only letters (case-sensitive), digits, underscores (_), and hyphens (-).

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:

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

Constraints:

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

Value range:

N/A

Default value:

N/A

volume

Yes

CreateClusterInstanceVolumeBody object

Definition:

Volume information.

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.

Value range:

N/A

Default value:

N/A

type

Yes

String

Definition:

Node type.

Constraints:

N/A

Value range:

  • ess-master indicates a master node.

  • ess-client indicates a client node.

  • ess-cold indicates a cold data node.

  • ess indicates a data node.

  • lgs indicates a 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:white)

[- 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 10.

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

  • 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.

Constraints:

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

Value range:

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

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:
You are advised to set this value to be greater than 100 GB.
Table 7 CreateClusterInstanceNicsBody

Parameter

Mandatory

Type

Description

vpcId

Yes

String

Definition:

VPC ID, which is used for configuring cluster network.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

netId

Yes

String

Definition:

Subnet ID (network ID).

Constraints:

N/A

Value range:

N/A

Default value:

N/A

securityGroupId

Yes

String

Definition:

Security group ID.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

ips

No

Array of strings

Definition:

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

Constraints:

N/A

Value range:

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.

Default value:

N/A

Table 8 CreateClusterTagsBody

Parameter

Mandatory

Type

Description

key

Yes

String

Definition:

Tag key.

Constraints:

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

Value range:

N/A

Default value:

N/A

value

Yes

String

Definition:

Tag value.

Constraints:

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

Value range:

N/A

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/A[For a serverless cluster, logs, search, and vector are supported.] (tag:white)

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.

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

Yes

CreateClusterElbWhiteList object

Definition:

EIP whitelist.

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: No whitelist is set. All public IP addresses can access the cluster.

Click +Add. In the displayed text box, enter IP addresses or CIDR blocks that are allowed to access the cluster from the public network. 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. After cluster creation, you can check this private domain name on the VPC Endpoint tab of the cluster details page.

  • 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: Yes. Create professional VPC endpoints that support the IPv4/IPv6 dual-stack network.

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

Default value:

fasle

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: Yes The system automatically assigns an IPv6 address to the VPC endpoint.

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

Default value:

fasle

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

Yes

CreateClusterPublicKibanaElbWhiteList object

Definition:

Kibana whitelist information.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Table 16 CreateClusterPublicKibanaElbWhiteList

Parameter

Mandatory

Type

Description

whiteList

Yes

String

Definition:

Whitelists

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

enableWhiteList

Yes

Boolean

Definition:

Whether to enable Kibana 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's Kibana console from the public network.

  • false: No whitelist is set. All public IP addresses can access the cluster through Kibana.

Click +Add. In the displayed text box, enter IP addresses or CIDR blocks that are allowed to access the cluster's Kibana console from the public network. 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.

Constraints:

N/A

Value range:

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

  • If payModel is 3, the value range is 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.

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:

  • Cryptographic 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.

Value range:

N/A

Default value:

N/A

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. This parameter is returned only when a yearly/monthly cluster is created.

Value 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",
        "backupStrategy" : {
          "period" : "16:00 GMT+08:00",
          "prefix" : "snapshot",
          "keepday" : 7,
          "frequency" : "DAY",
          "bucket" : "OBS-obsName",
          "basePath" : "css_repository/obs-path",
          "agency" : "css_obs_agency",
          "maxSnapshotBytesPerSeconds" : 40,
          "maxRestoreBytesPerSeconds" : 40
        },
        "roles" : [ {
          "flavorRef" : "ess.spec-4u8g",
          "volume" : {
            "volume_type" : "COMMON",
            "size" : 100
          },
          "type" : "ess",
          "instanceNum" : 1
        } ],
        "nics" : {
          "vpcId" : "{VPC ID}",
          "netId" : "{NET ID}",
          "securityGroupId" : "{Security group ID}"
        },
        "enterprise_project_id" : 0,
        "tags" : [ {
          "key" : "k1",
          "value" : "v1"
        }, {
          "key" : "k2",
          "value" : "v2"
        } ],
        "availability_zone" : "{Az code}",
        "datastore" : {
          "version" : "{cluster-version}",
          "type" : "elasticsearch"
        },
        "authorityEnable" : true,
        "httpsEnable" : true,
        "adminPwd" : "{password}",
        "publicIPReq" : {
          "eip" : {
            "bandWidth" : {
              "size" : 5
            }
          },
          "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",
        "backupStrategy" : {
          "period" : "16:00 GMT+08:00",
          "prefix" : "snapshot",
          "keepday" : 7,
          "frequency" : "DAY",
          "bucket" : "OBS-obsName",
          "basePath" : "css_repository/obs-path",
          "agency" : "css_obs_agency",
          "maxSnapshotBytesPerSeconds" : 40,
          "maxRestoreBytesPerSeconds" : 40
        },
        "roles" : [ {
          "flavorRef" : "ess.spec-4u8g",
          "volume" : {
            "volume_type" : "COMMON",
            "size" : 100
          },
          "type" : "ess",
          "instanceNum" : 1
        } ],
        "nics" : {
          "vpcId" : "{VPC ID}",
          "netId" : "{NET ID}",
          "securityGroupId" : "{Security group ID}"
        },
        "enterprise_project_id" : 0,
        "tags" : [ {
          "key" : "k1",
          "value" : "v1"
        }, {
          "key" : "k2",
          "value" : "v2"
        } ],
        "availability_zone" : "{Az code}",
        "datastore" : {
          "version" : "{cluster-version}",
          "type" : "elasticsearch"
        },
        "authorityEnable" : true,
        "httpsEnable" : true,
        "adminPwd" : "{password}",
        "publicIPReq" : {
          "eip" : {
            "bandWidth" : {
              "size" : 5
            }
          },
          "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.