Updated on 2025-11-14 GMT+08:00

Batch Removing ECSs from an ECS Group

Function

This API is used to remove ECSs from an ECS group. The anti-affinity policy will not be applied to the ECSs after they are removed from the group.

URI

POST /v1/{project_id}/cloudservers/os-server-groups/{server_group_id}/remove_members

Table 1 describes the parameters in the URI.

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

For details about how to obtain the ID, see Obtaining a Project ID.

server_group_id

Yes

Specifies the ECS group ID.

Request

Table 2 describes the request parameters.

Table 2 Request parameters

Parameter

Mandatory

Type

Description

server_ids

Yes

Array of String

Specifies the VM ID list.

Response

Table 3 Response parameters

Parameter

Type

Description

status

String

Specifies the status.

servers

Array of object

Specifies the response to the batch operation request. For details, see Table 4.

Table 4 servers field description

Parameter

Type

Description

status

String

Specifies the status.

server_id

String

Specifies the VM ID.

fail_reason

String

Specifies the failure cause.

Example Request

Remove the ECS whose UUID is 34dac9a0-c4a7-457b-bab2-e2c696e0e401 from the specified ECS group.

POST https://{endpoint}/v1/{project_id}/cloudservers/os-server-groups/{server_group_id}/remove_members

{
    "server_ids": [
        "34dac9a0-c4a7-457b-bab2-e2c696e0e401"
    ]
}

Example Response

{
    "status": success,
    "servers": [{
        "status": success,
        "serverId": "34dac9a0-c4a7-457b-bab2-e2c696e0e401",
        "failReason": ""
    }]
}

Error Codes

See Error Codes.