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

Modifying a Protection Policy

Function

This API is used to modify a protection policy, including the policy name, rule status, protection action, and detection rule configuration; and to update the policy on servers where policy has been applied.

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}/rasp/policy

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

The project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

No

String

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

policy_id

Yes

String

Policy ID

policy_name

Yes

String

Policy name

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

x-auth-token

Yes

String

User token.

It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Table 4 Request body parameters

Parameter

Mandatory

Type

Description

feature_list

Yes

Array of ChkFeatureInfo objects

Detection feature rules

Table 5 ChkFeatureInfo

Parameter

Mandatory

Type

Description

chk_feature_id

Yes

Integer

Detection feature rule ID

protective_action

Yes

Integer

Protection action: 1 (detect) or 2 (detect and block, or block)

enabled

Yes

Integer

Enabled status. 0: disabled; 1: enabled.

feature_configure

Yes

String

Checking feature rule configurations

Response Parameters

Status code: 200

Request succeeded.

None

Example Requests

None

Example Responses

None

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes

See Error Codes.