Files
doc-exports/docs/ecs/api-ref/en-us_topic_0133622595.html
wanghuijuan738 8f024b87ae ECS API 20251204 version. Adding an API Document.
Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com>
Co-authored-by: wanghuijuan738 <wanghuijuan738@huawei.com>
Co-committed-by: wanghuijuan738 <wanghuijuan738@huawei.com>
2025-12-17 11:05:14 +00:00

9.2 KiB

Adding an ECS to an ECS Group

Function

This API is used to add an ECS to an ECS group. ECSs in the same group are automatically deployed on different hosts if possible.

Constraints

  • The ECS to be added has been stopped.
  • Only KVM ECSs can be added.
  • Only the anti-affinity policy is supported. ECSs in the same ECS group are deployed on different hosts, improving service reliability.

URI

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

Table 1 describes the parameters in the URI.
Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the 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

add_member

Yes

Object

Specifies the information of the ECS to be added to an ECS group.

For details, see Table 3.

Table 3 add_member parameters

Parameter

Mandatory

Type

Description

instance_uuid

Yes

String

Specifies the ECS UUID.

Response

None

Example Request

Adds a specified ECS to an ECS group.

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

{
    "add_member": {
        "instance_uuid":"34dac9a0-c4a7-457b-bab2-e2c696e0e401"
    }
}

Example Response

Status code 200, indicating that the operation is successful

Error Codes

See Error Codes.