Help Center> CodeArts Deploy> API Reference> APIs> Managing Hosts> Deleting Hosts from a Host Cluster in Batches
Updated on 2024-07-05 GMT+08:00

Deleting Hosts from a Host Cluster in Batches

Function

This API is used to delete hosts from a host cluster in batches.

Calling Method

For details, see Calling APIs.

URI

POST /v1/resources/host-groups/{group_id}/hosts/batch-delete

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

group_id

Yes

String

Host cluster ID

Minimum: 32

Maximum: 32

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Message body type (format). Possible values: application/json;charset=utf-8 application/json

Default: application/json;charset=utf-8

Enumeration values:

  • application/json;charset=utf-8

  • application/json

X-Auth-Token

Yes

String

User token. It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token.

Minimum: 0

Maximum: 20000

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

host_id_list

No

Array of strings

Host ID list

Minimum: 32

Maximum: 32

Array Length: 0 - 200

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

status

String

Request success or failure status

result

Array of strings

Returned result

Example Requests

https://{endpoint}/v1/resources/host-groups/2a8c2da888c04a5eaff10d0787c90ea4/hosts/batch-delete

{
  "host_id_list" : [ "5fd1c0334d7343338054af811fef8e4b" ]
}

Example Responses

Status code: 200

OK: The request is successful.

{
  "status" : "success",
  "result" : [ "450c2301c9ea4d82a6d9a06ce59ba6b4" ]
}

Status Codes

Status Code

Description

200

OK: The request is successful.

Error Codes

See Error Codes.