Help Center/ Host Security Service/ API Reference (Kuala Lumpur Region)/ API Description/ Vulnerability Management/ Querying the List of Servers Corresponding to a Vulnerability Scan Task
Updated on 2025-09-24 GMT+08:00

Querying the List of Servers Corresponding to a Vulnerability Scan Task

Function

This API is used to query the list of servers corresponding to a vulnerability scan task.

Calling Method

For details, see Calling APIs.

URI

GET /v5/{project_id}/vulnerability/scan-task/{task_id}/hosts

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Tenant project ID

task_id

Yes

String

Task ID

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

No

String

Enterprise user ID. To query all enterprise projects, set this parameter to all_granted_eps.

limit

No

Integer

Number of records displayed on each page.

offset

No

Integer

Offset, which specifies the start position of the record to be returned. The value must be a number no less than 0. The default value is 0.

scan_status

No

String

Scan status of the server. The options are as follows:

  • scanning

  • success

  • failed

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

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.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total_num

Long

Total number

data_list

Array of VulScanTaskHostInfo objects

Indicates the list of servers corresponding to a vulnerability scan task.

Table 5 VulScanTaskHostInfo

Parameter

Type

Description

host_id

String

Server ID

host_name

String

Server name

public_ip

String

EIP

private_ip

String

Private IP address

asset_value

String

Asset importance. The options are as follows:

  • important

  • common

  • test

scan_status

String

Scan status of the server. The options are as follows:

-scanning

-success

-failed:

failed_reasons

Array of failed_reasons objects

List of scan failure causes

Table 6 failed_reasons

Parameter

Type

Description

vul_type

String

Type of the vulnerability that fails to be scanned. The options are as follows:

-linux_vul: Linux vulnerability

-windows_vul: windows vulnerability

-web_cms: Web-CMS vulnerability

-app_vul: application vulnerability

failed_reason

String

Cause of the scanning failure.

Example Requests

This API is used to query details of vulnerability scan task whose ID is 2b31ed520xxxxxxebedb6e57xxxxxxxx. The list of failed servers and failure causes are displayed. By default, 10 servers on the first page are queried.

GET https://{endpoint}/v5/{project_id}/vulnerability/scan-task/{task_id}/hosts?offset=0&limit=10&scan_status=failed&enterprise_project_id=XXX

{
  "scan_status" : "failed",
  "task_id" : "2b31ed520xxxxxxebedb6e57xxxxxxxx"
}

Example Responses

None

Status Codes

Status Code

Description

200

Indicates the list of servers corresponding to a vulnerability scan task.

Error Codes

See Error Codes.