Add existing Elastic Compute Service (ECS) instances to a cluster. For more information about the API description, see Container Service API reference.


Swarm clusters and Kubernetes clusters.

API request and response

Request format

aliyun cs POST /clusters/<cluster_id>/attach --header "Content-Type=application/json" --body "$(cat attach.json)"

Parameter description:

  • Specify Content-Type as application/json in --header.
  • --body is the body to be sent to the server, which can be read from a local file and must be in the valid JSON format. The attach.json contents are as follows:

        "password": "password used to log on to the ECS instance by using SSH",
        "instances": "the ECS instance array to be added",
        "ecs_image_id": "image ID",
        "release_eip_flag": "whether or not to release Elastic IP (EIP) after configuring the cluster"

Response results

    "list": [
            "code": "200",
            "instanceId": "i-2zee3oiwcyoz7kwdo8bt",
            "message": "successful"
            "code": "200",
            "instanceId": "i-2ze0lgm3y6iylcbtcypf",
            "message": "successful"
    "task_id": "T-5a544aff80282e39ea000039"