• Cloud Search Service

css
  1. Help Center
  2. Cloud Search Service
  3. API Reference
  4. APIs Related to Cluster Management
  5. Creating a Cluster

Creating a Cluster

Function

This API is used to create a cluster.

URI

POST /v1.0/{project_id}/clusters
Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Request

Table 2 describes the request parameters.

Table 2 Parameter description

Parameter

Mandatory

Type

Description

cluster

Yes

Object

Cluster object.

Table 3 cluster field description

Parameter

Mandatory

Type

Description

instance

Yes

Object

Instance object.

datastore

No (optional)

Object

Type of the data search engine.

name

Yes

String

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

instanceNum

Yes

Integer

Number of cluster instances. The value range is 1 to 32.

diskEncryption

Yes

Object

Whether disks are encrypted. For details about related parameters, see Table 8.

httpsEnable

No

String

Whether communication encryption is performed on the cluster. Available values include true and false. By default, communication encryption is enabled.

Value true indicates that communication encryption is performed on the cluster.

Value false indicates that communication encryption is not performed on the cluster.

Table 4 instances field description

Parameter

Mandatory

Type

Description

flavorRef

Yes

String

Instance flavor name.

  • Value range of flavor css.medium.8: 40 GB to 640 GB
  • Value range of flavor css.large.8: 40 GB to 1280 GB
  • Value range of flavor css.xlarge.8: 40 GB to 2560 GB
  • Value range of flavor css.2xlarge.8: 80 GB to 5120 GB
  • Value range of flavor css.4xlarge.8: 160 GB to 10240 GB

volume

Yes

Object

Information about the volume.

nics

Yes

Object

Subnet information.

availability_zone

No (optional)

String

Availability zone (AZ).

Table 5 volume field description

Parameter

Mandatory

Type

Description

volume_type

Yes

String

COMMON: Common I/O. The SATA disk is used.

HIGH: High I/O. The SAS disk is used.

ULTRAHIGH: Ultra-high I/O. The solid-state drive (SSD) is used.

size

Yes

Integer

Volume size, which must be a multiple of 4 and 10.

Table 6 nics field description

Parameter

Mandatory

Type

Description

vpcId

Yes

String

VPC ID, which is used for configuring cluster network.

netId

Yes

String

Subnet ID. All instances in a cluster must have the same subnets and security groups.

securityGroupId

Yes

String

Security group ID. All instances in a cluster must have the same subnets and security groups.

Table 7 datastore field description

Parameter

Mandatory

Type

Description

version

Yes

String

Engine version. The default version is 6.2.3.

type

No

String

Engine type. The default value is elasticsearch. Currently, the value can only be elasticsearch.

Table 8 diskEncryption field description

Parameter

Mandatory

Type

Description

systemEncrypted

Yes

String

Value 1 indicates encryption is performed, and value 0 indicates encryption is not performed.

systemCmkid

Yes

String

Key ID.

  • The Default Master Keys cannot be used to create grants. Specifically, you cannot use Default Master Keys whose aliases end with /default in KMS to create clusters.
  • After a cluster is created, do not delete the key used by the cluster. Otherwise, the cluster will become unavailable.

Response

Table 9 describes the response parameters.

Table 9 Parameter description

Parameter

Type

Description

cluster

Object

Cluster object.

Table 10 cluster field description

Parameter

Type

Description

id

String

Cluster ID.

name

String

Cluster name.

Examples

Example request

POST /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters
{ 
    "cluster": { 
        "name": "ES-Test",
        "instanceNum": 4,
           "instance": { 
               "flavorRef": "css.large.8", 
                  "volume": { 
                         "volume_type": "COMMON", 
                         "size": 100
                  }, 
                  "nics": { 
                         "vpcId": "fccd753c-91c3-40e2-852f-5ddf76d1a1b2",
                         "netId": "af1c65ae-c494-4e24-acd8-81d6b355c9f1", 
                         "securityGroupId": "7e3fed21-1a44-4101-ab29-34e57124f614" 
                  }
           },
           "httpsEnable": "false",
           "diskEncryption" : {
		"systemEncrypted" : "1",
		"systemCmkid" : "42546bb1-8025-4ad1-868f-600729c341ae"
	    }
    } 
}
Example response
{
  "cluster": {
    "id": "ef683016-871e-48bc-bf93-74a29d60d214",
    "name": "ES-Test"
  }
}

Status Code

Table 11 describes the status code.

Table 11 Status code

Status Code

Code

Status Code Description

400

BadRequest

Invalid request.

The client should not repeat the request without modifications.

409

Conflict

The request could not be processed due to a conflict.

This status code indicates that the resource that the client attempts to create already exits, or the request fails to be processed because of the update of the conflict request.

412

Precondition Failed

The server does not meet one of the preconditions that the requester puts on the request.

200

OK

The request is processed successfully.