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

Querying the Protection Policy List

Function

This API is used to query the protection policy list. It queries the protection policy information, including the protection policy name, detection rule, and number of associated servers.

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

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

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.

os_type

No

String

OS type. Its value can be:

  • Linux

  • Windows

limit

No

Integer

Number of records displayed on each page. The default value is 10.

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.

policy_name

No

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.

region

Yes

String

region id

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total_num

Integer

Total

data_list

Array of PolicyInfo objects

Policy information list

Table 5 PolicyInfo

Parameter

Type

Description

policy_id

String

Policy ID

policy_name

String

Policy name

os_type

String

OS type

host_num

Integer

Associated servers

rule_name

String

Detection feature rule name, which is separated by commas (,).

Example Requests

None

Example Responses

Status code: 200

Request succeeded.

{
  "total_num" : 20,
  "data_list" : [ {
    "policy_id" : "f3eddd3f-****-4867-88d2-********",
    "policy_name" : "test2",
    "os_type" : "Windows",
    "host_num" : 0,
    "rule_name" : "CMDI,File********8,ExpressionInject"
  } ]
}

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes

See Error Codes.