Scaling Out a Cluster

Function

This API is used to scale out a cluster with only common nodes. Clusters with master, client, or cold data nodes cannot use this API.

URI

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

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining the Project ID and Account ID.

cluster_id

Yes

String

ID of the cluster where instances are to be added.

Request

Table 2 describes the request parameters.

Table 2 Parameter description

Parameter

Mandatory

Type

Description

grow

Yes

Object

Detailed description about the cluster capacity expansion request. For details, see Table 3.

Table 3 grow field description

Parameter

Mandatory

Type

Description

modifySize

Yes

Integer

Number of instances to be added.

NOTE:

The total number of existing instances and newly added instances in a cluster cannot exceed 32.

Response

Table 4 describes the response parameters.

Table 4 Parameter description

Parameter

Type

Description

id

String

Cluster ID.

instances

Array of instance objects

List of instances to be added.

Table 5 instances field data structure description

Parameter

Type

Description

id

String

Instance ID.

name

String

Instance name.

type

String

Instance type.

shard_id

String

Instance group name.

Examples

Example request

POST /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters/ea244205-d641-45d9-9dcb-ab2236bcd07e/extend
{
    "grow": 
        {
            "modifySize": 4
        }
}

Example response

{
  "id": "4b0fae9f-e3fb-4581-872b-330cdd09a3d5",
  "instances": [
    {
      "id": "2c47ec92-337b-4f22-8337-e342eb315063",
      "name": "Es-c1a2-ess-esn-4-1",
      "type": "ess",
      "shard_id": "esn-4"
    },
    {
      "id": "311077f8-debb-4350-97d5-9eafd2b438f2",
      "name": "Es-c1a2-ess-esn-5-1",
      "type": "ess",
      "shard_id": "esn-5"
    },
    {
      "id": "fcc3c59e-9420-4fd8-a8ad-836c45b6813e",
      "name": "Es-c1a2-ess-esn-6-1",
      "type": "ess",
      "shard_id": "esn-6"
    },
    {
      "id": "dd64e308-3799-4f2a-a57e-9b92e9f3ce45",
      "name": "Es-c1a2-ess-esn-7-1",
      "type": "ess",
      "shard_id": "esn-7"
    }
  ]
}

Status Code

Table 6 describes the status code.

Table 6 Status code

Status Code

Code

Status Code Description

400

BadRequest

Invalid request.

The client should not repeat the request without modifications.

404

NotFound

The requested resource cannot be found.

The client should not repeat the request without modifications.

200

OK

The request is processed successfully.