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

Querying a Vulnerability Scan Policy

Function

This API is used to query a vulnerability scan policy.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.

URI

GET /v5/{project_id}/vulnerability/scan-policy

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID, which is used to specify the project that an asset belongs to. After the project ID is configured, you can query assets in the project using the project ID. For details about how to obtain it, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain 1 to 256 characters.

Default Value

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

No

String

Definition

Enterprise project ID, which is used to filter assets in different enterprise projects. For details, see Obtaining an Enterprise Project ID.

To query assets in all enterprise projects, set this parameter to all_granted_eps.

Constraints

You need to set this parameter only after the enterprise project function is enabled.

Range

The value can contain 1 to 256 characters.

Default Value

0: default enterprise project.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token, which contains user identity and permissions. The token can be used for identity authentication when an API is called. For details about how to obtain the token, see Obtaining a User Token.

Constraints

N/A

Range

The value can contain 1 to 32,768 characters.

Default Value

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

scan_period

String

Definition

Scan period.

Range

  • one_day: every day

  • three_day: every three days

  • one_week: every week

  • one_month: every month

scan_vul_types

Array of strings

Definition

List of scanned vulnerability types.

Range

The value range is 0 to 5.

scan_range_type

String

Definition

Scope of servers to be scanned.

Range

  • all_host: all servers

  • specific_host: specified servers

host_ids

Array of strings

Definition

Server ID list. If scan_range_type is set to specific_host, the server list must be specified.

Range

The value range is 0 to 20,000.

total_host_num

Long

Definition

Total number of servers that can be scanned for vulnerabilities.

Range

The value range is 0 to 20,000.

status

String

Definition

Scan policy status.

Range

  • open: enabled

  • close: disabled

time

time object

Definition

Scan time.

Table 5 time

Parameter

Type

Description

day_part

Array of integers

Definition

List of dates or days in a week when scans are performed.

Range

The minimum value is 0 and the maximum value is 31.

hour_part

Integer

Definition

Hour part of the scan time.

Range

Minimum value: 0; maximum value: 11

minute_part

Integer

Definition

Minute part of the scan time.

Range

Minimum value: 0; maximum value: 59

next_scan_time

Long

Definition

Next scan time.

Range

Minimum value: 0; maximum value: 2^63-1

timezone_offset

Integer

Definition

Difference from the standard time zone. For example, the value is -480 for GMT+8.

Range

Minimum value: -840; maximum value: 720

Example Requests

Query the vulnerability scan policy whose project_id is 2b31ed520xxxxxxebedb6e57xxxxxxxx.

GET https://{endpoint}/v5/2b31ed520xxxxxxebedb6e57xxxxxxxx/vulnerability/scan-policy

Example Responses

Status code: 200

Request succeeded.

{
  "scan_period" : "one_day",
  "scan_vul_types" : [ "linux_vul" ],
  "scan_range_type" : "specific_host",
  "host_ids" : [ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" ],
  "total_host_num" : 5,
  "status" : "open"
}

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes

See Error Codes.