Updated on 2025-09-08 GMT+08:00

Querying Policy Usage

Function

This API is used to query policy usage.

Calling Method

For details, see Calling APIs.

URI

GET /v2/{cloudProjectId}/rule-sets/{ruleSetId}/related/query

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

cloudProjectId

Yes

String

Definition:

Project ID. For details, see Obtaining a Project ID.

Constraints:

N/A

Value range:

The value consists of 32 characters, including digits and letters.

Default value:

N/A

ruleSetId

Yes

String

Definition:

Policy ID, which is the unique identifier of a policy. Obtain the policy ID by calling the API for querying policies. data.id indicates the policy ID.

Constraints:

N/A

Value range:

The value consists of 32 characters, including digits and letters.

Default value:

N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

project_count

Long

Definition:

Number of projects.

Value range:

N/A

pipeline_count

Long

Definition:

Number of pipelines.

Value range:

N/A

Example Requests

GET https://{endpoint}/v2/83575118c90d4875be6ff167cd25424a/rule-sets/63963e542f0945a3b6243c01aa2fc0c0/related/query

Example Responses

Status code: 200

Response body for querying policy usage.

{
  "project_count" : 0,
  "pipeline_count" : 0
}

Status Codes

Status Code

Description

200

Response body for querying policy usage.

Error Codes

See Error Codes.