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

Querying the Server Policy List

Function

This API is used to query the server policy list.

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}/host-management/policies

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.

offset

Yes

Integer

Definition

Offset, which specifies the start position of the record to be returned.

Constraints

N/A

Range

The value range is 0 to 2,000,000.

Default Value

N/A

limit

Yes

Integer

Definition

Number of records displayed on each page.

Constraints

Mandatory.

Range

Value range: 10 to 200

Default Value

10

agent_id

Yes

String

agent ID

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

data_list

Array of AgentPolicyInfo objects

Policy information list

total_num

Integer

Total number of policies

Table 4 AgentPolicyInfo

Parameter

Type

Description

policy_id

String

Policy ID

group_id

String

Policy group ID

policy_name

String

Policy name

feature_name

String

Feature name

policy_category

String

Policy type

policy_status

String

Definition

Policy application status.

Constraints

N/A

Range

The agent statuses are divided into two types:

  • not_applied: not applied

  • protection_degradation_not_applied: Protection degradation is not applied.

  • processing: being applied

  • applied: applied

Default Value

N/A

Example Requests

None

Example Responses

Status code: 200

Request succeeded.

{
  "data_list" : [ {
    "policy_id" : "34b4f91f-8480-4c17-a06e-cf5dac7c82dd",
    "group_id" : "fcf8097f-2b6e-3eab-89cb-62d125ad6417",
    "policy_name" : "Asset discovery",
    "feature_name" : "assetmanage_collect",
    "policy_category" : "Asset",
    "policy_status" : "applied"
  } ],
  "total_num" : 1
}

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes

See Error Codes.