You can call the ScaleOutCluster operation to add worker nodes to a multi-zone cluster.

Request information

Request line

POST /api/v2/clusters/{cluster_id} HTTP/1.1
Table 1. Request parameters
Parameter Type Required Description
cluster_id string Yes The ID of the cluster that you want to add nodes to.

Custom request headers

None. For more information, see Public request headers.

Request body

{ "key_pair":"key pair name. Select between SSH authentication and key pair authentication", "worker_vswitch_ids": "VSwitch IDs. Specify one to three VSwitches", "worker_instance_types": "instance type of worker nodes", "worker_system_disk_category": "system disk type of worker nodes", "worker_system_disk_size": "system disk size of worker nodes", "worker_data_disk": "whether to mount data disks to worker nodes. Valid values: true and false", "tags": "tags in an array", "count": "number of worker nodes to be added" "worker_data_disks":"data disk configurations of worker nodes", }
Table 2. Request body parameters
Parameter Type Required Description
count int Yes The number of nodes that you want to add.
vswitch_ids list No The VSwitch IDs of worker nodes.
worker_data_disk bool Yes Whether to mount data disk to worker nodes.
  • A value of true indicates yes.
  • A value of true indicates no.
worker_instance_types list Yes The instance types of worker nodes. For more information, see Instance families.
key_pair string Yes The name of the key pair. Select between login_password and key_pair.
login_password string Yes The passwords of the worker nodes to be added. The password must be 8 to 30 characters in length and contain three of the following four character types: uppercase letters, lowercase letters, digits, and special characters. Select between login_password and key_pair.
worker_data_disks list No The data disk configurations of worker nodes, such as the disk type and disk size. This parameter takes effect only when parameter worker_data_disk is set to true.
  • category: The type of the data disk. Valid values:
    • cloud: basic disk
    • cloud_efficiency: ultra disk
    • cloud_ssd: standard SSD
  • size: The size of the data disk. Unit: GiB.
worker_system_disk_category string No The system disk type of worker nodes.
worker_system_disk_size int No The system disk size of worker nodes. Unit: GiB.

Response information

Response line

HTTP/1.1 202 Accepted

Custom response headers

None. For more information, see Public response headers.

Response body

{    "cluster_id":"string",
    "request_id":"string",
    "task_id":"string",
    "instanceId":"string"
}

Examples

Sample requests

POST /api/v2/clusters/Cccfd68c474454665ace07efce924**** HTTP/1.1
<Common request headers> {    "key_pair":"common", // KeyPair 
    "vswitch_ids":["vsw-uf684tfrpwup8gcsw****"],
    "worker_instance_types":["ecs.c5.xlarge"],
    "worker_system_disk_category":"cloud_efficiency",
    "worker_system_disk_size":120,
    "worker_data_disk":false,
    "worker_data_disks": [{"category": "cloud_ssd", "size": 500}],
    "tags":[],
    "count":1
}

Sample responses

HTTP/1.1 202 Accepted
<Common response headers> {    "cluster_id": "Cccfd68c474454665ace07efce924****",
    "request_id": "687C5BAA-D103-4993-884B-C35E4314A1E1",
    "task_id": "T-5a54309c80282e39ea00002f",
    "instanceId":"Cccfd68c474454665ace07efce924****"
}