Obtaining the Project-Level Policy List
Function
Obtaining the Project-Level Policy List
URI
GET /v2/{project_id}/rule-sets/query
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
offset |
Yes |
Integer |
Offset, which is the position where the query starts. The value must be greater than or equal to 0. |
limit |
Yes |
Integer |
Number of records displayed on each page |
include_tenant_rule_set |
Yes |
Boolean |
Whether tenant-level rules are included |
name |
No |
String |
Policy name, which is used for fuzzy query. |
is_valid |
No |
Boolean |
Whether the alarm is valid. |
type |
No |
String |
Rule Set Type |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. Can be obtained by calling the IAM API for obtaining the user token (the value of X-Subject-Token in the response header). |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
data |
Array of RuleSet objects |
List of rule instances |
total |
Long |
Total number. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Rule Template Instance ID |
name |
String |
Rule Template Instance Name |
type |
String |
Type |
version |
String |
Version |
operator |
String |
Latest Operator |
operate_time |
Long |
Last Operation Time |
is_valid |
Boolean |
Effective |
level |
String |
Tenant-level and project-level |
is_public |
Boolean |
System Level |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_msg |
String |
Error Message |
error_code |
String |
Error code. |
Example Requests
GET https://{endpoint}/v2/d80a8a6530324b7bac972cbb8a9f28ec/rule-sets/query?name=&limit=10&offset=0&include_tenant_rule_set=false
Example Responses
Status code: 200
OK
{ "data" : [ { "id" : "98183e0e70634f4d99da7dc549496652", "name" : "Creating a Policy - 20230915203425", "level" : "project", "is_valid" : true, "version" : "82ed35e3ecd041ebace8d62347042368", "operator" : "devcloud_xxx", "is_public" : false, "operate_time" : 1694781278000 }, { "id" : "becbd00aa13147c6a226283a4bad57e0", "name" : "Creating a Policy - 20230817183223", "level" : "project", "is_valid" : true, "version" : "e3cc0a3df511486ea36bdcb46df724f8", "operator" : "devcloud_xxx", "is_public" : false, "operate_time" : 1693900336000 }, { "id" : "52b24f9add844832a2af11f2e760c730", "name" : "codecheck-copy", "level" : "project", "is_valid" : true, "version" : "a2e50e1972f348e0838679eabe0b4467", "operator" : "devcloud_xxx", "is_public" : false, "operate_time" : 1693900325000 }, { "id" : "d899845c2eff4fa18860fa4b31c5ee31", "name" : "codecheck", "level" : "project", "is_valid" : true, "version" : "20f79c6ff8844f5391882d7b3497761b", "operator" : "devcloud_xxx", "is_public" : false, "operate_time" : 1693300726000 } ], "total" : 4 }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad request |
401 |
Unauthorized |
403 |
Forbidden |
404 |
Not Found |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.