Add existing ECS instances

更新时间:
复制 MD 格式

Add existing ECS instances to an ACK cluster.

API request and response

Request format

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

Parameters:

  • For --header, set Content-Type to application/json.

  • The --body parameter specifies the request body. The content is read from a local file and must be in a valid JSON format. The following code shows an example of the attach.json file.

{
    "password": "The logon password for the ECS instance",
    "instances": "An array of instances to add",
    "format_disk": "Specifies whether to format the data disk",
    "key_pair": "The key pair",
    "tags": "Tags to add to the node. This is an array of objects."
}

Response

{
    "list": [
        {
            "code": "200",
            "instanceId": "i-2zee3oiwcyoz7kwd****",
            "message": "successful"
        },
        {
            "code": "200",
            "instanceId": "i-2ze0lgm3y6iylcbt****",
            "message": "successful"
        }
    ],
    "task_id": "T-5a544aff80282e39ea000039"
}