Updated on 2026-04-03 GMT+08:00

Modifying a Vulnerability Scan Policy

Function

This API is used to modify 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

PUT /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

Table 4 Request body parameters

Parameter

Mandatory

Type

Description

scan_period

Yes

String

Definition

Scan period.

Constraints

N/A

Range

  • one_day: every day

  • three_day: every three days

  • one_week: every week

  • one_month: every month

Default Value

N/A

scan_range_type

Yes

String

Definition

Scope of servers to be scanned.

Constraints

N/A

Range

  • all_host: all servers

  • specific_host: specified servers

Default Value

N/A

host_ids

No

Array of strings

Definition

Server ID list.

Constraints

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

Range

The value range is 0 to 20,000.

Default Value

N/A

scan_vul_types

No

Array of strings

Definition

List of scanned vulnerability types.

Constraints

N/A

Range

The value range is 0 to 5.

Default Value

N/A

status

Yes

String

Definition

Scan policy status.

Constraints

N/A

Range

  • open: enabled

  • close: disabled

Default Value

N/A

time

No

time object

Definition

Scan time.

Table 5 time

Parameter

Mandatory

Type

Description

day_part

No

Array of integers

Definition

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

Constraints

N/A

Range

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

Default Value

N/A

hour_part

No

Integer

Definition

Hour part of the scan time.

Constraints

N/A

Range

Minimum value: 0; maximum value: 11

Default Value

N/A

minute_part

No

Integer

Definition

Minute part of the scan time.

Constraints

N/A

Range

Minimum value: 0; maximum value: 59

Default Value

N/A

next_scan_time

No

Long

Definition

Next scan time.

Constraints

N/A

Range

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

Default Value

N/A

timezone_offset

No

Integer

Definition

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

Constraints

N/A

Range

Minimum value: -840; maximum value: 720

Default Value

N/A

Response Parameters

Status code: 200

Request succeeded.

None

Example Requests

Modify a vulnerability scan policy. The scan period is daily, scan scope is specified host, host ID is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, and policy status is enabled.

PUT https://{endpoint}/v5/2b31ed520xxxxxxebedb6e57xxxxxxxx/vulnerability/scan-policy?enterprise_project_id=all_granted_eps

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

Example Responses

None

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes

See Error Codes.