Updated on 2026-01-05 GMT+08:00

Deleting a Host Group

Function

Delete a host group.

URI

DELETE /v3/{project_id}/lts/host-group

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain a project ID, see Obtaining the Project ID, Account ID, Log Group ID, and Log Stream ID.

Minimum: 1

Maximum: 64

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token obtained from IAM. For details about how to obtain a user token, see Obtaining a User Token.

Minimum: 1

Maximum: 10000

Content-Type

Yes

String

Set this parameter to application/json;charset=UTF-8.

Minimum: 30

Maximum: 30

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

host_group_id_list

Yes

Array of strings

List of host group IDs.

Minimum: 36

Maximum: 36

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

result

Array of GetHostGroupInfo objects

Host group details.

total

Long

Number of deleted host groups.

Minimum: 0

Maximum: 1000

Table 5 GetHostGroupInfo

Parameter

Type

Description

host_group_id

String

Host group ID.

host_group_name

String

Host group name.

host_group_type

String

Host group type.

  • linux

  • windows

host_id_list

Array of strings

Host ID list.

host_group_tag

Array of HostGroupTagResBody objects

Tag information.

create_time

Long

Creation time.

update_time

Long

Update time.

labels

Array of strings

Host group identifier.

agent_access_type

String

Host access type.

Table 6 HostGroupTagResBody

Parameter

Type

Description

key

String

Tag key.

value

String

Tag value.

tags_to_streams_enable

Boolean

Whether to apply the tag to the log stream. Only a tag of a log group can be directly applied to its log stream.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error description

Status code: 500

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error description

Example Requests

Delete one or multiple host groups at a time.

DELETE https://{endpoint}/v3/{project_id}/lts/host-group

{
  "host_group_id_list" : [ "xxxx", "xxxx" ]
}

Example Responses

Status code: 200

Host groups are deleted.

{
  "result" : [ {
    "agent_access_type" : "IP",
    "create_time" : 1749782275419,
    "host_group_id" : "35ff8bca-6e9f-4297-9263-9cb1c0890574",
    "host_group_name" : "test-api3",
    "host_group_tag" : [ {
      "key" : "3",
      "tags_to_streams_enable" : true,
      "value" : "1"
    } ],
    "host_group_type" : "linux",
    "host_id_list" : [ "2b0d2d32-3db6-470b-8559-df24e1f659a1", "8a2a1b3e-8739-4d77-aecc-6b54e32209c1" ],
    "labels" : [ ],
    "update_time" : 1749782275419
  } ],
  "total" : 1
}

Status code: 400

Invalid request. Modify the request based on the description in error_msg before a retry.

{
  "error_code" : "LTS.1812",
  "error_msg" : "Invalid host group id"
}

Status code: 500

The server has received the request but encountered an internal error.

{
  "error_code" : "LTS.0010",
  "error_msg" : "Internal Server Error"
}

Status Codes

Status Code

Description

200

Host groups are deleted.

400

Invalid request. Modify the request based on the description in error_msg before a retry.

500

The server has received the request but encountered an internal error.

Error Codes

See Error Codes.