Querying Rule Filters
Function
This API is used to query the number of rules corresponding to each tag after the rules are filtered by criteria.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
|
Action |
Access Level |
Resource Type (*: required) |
Condition Key |
Alias |
Dependencies |
|---|---|---|---|---|---|
|
codeartscheck::listRules |
List |
- |
- |
- |
- |
URI
GET /v1/criterion-filters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
system_tag |
No |
String |
Definition: Engine name. Constraints: N/A Range: sonarqube, wordstool, clangtidy, codemars, secbrella, cppcheck, apiengine, eslint, fixbotengine-java, fixbotengine-cxx, oat, pylint, SQLGuardian, cmetrics, codecheckrevive, clippy, detektout, cjlint, flake8, LuaGuardian, thirdpartycheck, FossScan, Infer_Java, and testengine. Default value: N/A |
|
severitys |
No |
String |
Definition: Issue severity. Constraints: N/A Value range: Default value: 0,1,2,3. By default, issues of all severity levels are queried. |
|
languages |
No |
String |
Definition: Rule languages. Use commas (,) to separate multiple languages. Constraints: N/A Value range: Default value: N/A |
|
search |
No |
String |
Definition: Keyword for search. Constraints: N/A Value range: N/A Default value: N/A |
|
set_id |
No |
String |
Definition : Rule set ID. Obtain the ID by calling the API used to obtain the rule set list. Constraints: N/A Value range: 1 to 32 characters. Default value: N/A |
|
status |
No |
String |
Definition: Whether the rules in a rule set are enabled. Constraints: N/A Value range: Default value: enable. |
|
inherit |
No |
String |
Definition: Inheritance type. Constraints: N/A Value range: Default value: The default value is null, indicating that all inherited rules are queried. |
|
onlines |
No |
String |
Definition: Online status. Constraints: N/A Value range: Default value: 1 |
|
show_tool_version |
No |
String |
Definition: Display version. Constraints: N/A Value range: N/A Default value: N/A |
|
tool_version |
No |
String |
Definition: Tool version. Constraints: N/A Value range: N/A Default value: N/A |
|
cwe_search |
No |
String |
Definition: CWE search. Constraints: N/A Value range: N/A Default value: N/A |
|
compile |
No |
String |
Definition: Compilation rule or not. Constraints: N/A Value range: Default value: N/A |
|
security |
No |
String |
Definition: Security and quality classification. Constraints: N/A Value range: Default value: N/A |
|
industry_standards |
No |
String |
Definition: Industry standards. Constraints: N/A Value range: N/A Default value: N/A |
|
source_type |
No |
String |
Definition: Rule creation type. Constraints: N/A Value range: Default value: N/A |
|
project_id |
No |
String |
Definition : You can obtain the 32-character UUID by calling the API used to query the project list. Constraints: N/A Value range: 32-character project ID. Default value: N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition : User token. Obtain one by calling the IAM API Obtaining a User Token. The value of X-Subject-Token in the response header is a token. Constraints: N/A Value range: 1–100,000 characters. Default value: N/A |
|
operator |
Yes |
String |
Definition: Operator username. Constraints: N/A Value range: 1 to 128 characters. Default value: N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
httpStatus |
String |
Definition: HTTP response status. Value range: |
|
result |
CriterionFilterInfo object |
Definition: Rule filter. Range: N/A |
|
status |
String |
Definition: API response status. Value range: |
|
Parameter |
Type |
Description |
|---|---|---|
|
languageInfoList |
Array of FilterUnit objects |
Definition: Language filter list. Range: N/A |
|
severityInfoList |
Array of FilterUnit objects |
Definition: List of alarm severity filters. Range: N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
filterKey |
String |
Definition: Filter metric name. Value range: |
|
filterValue |
Integer |
Definition: Value of the filter metric. Range: N/A |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition: Error code. Value range: N/A |
|
error_msg |
String |
Definition: Error message. Value range: N/A |
Status code: 401
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition: Error code. Value range: N/A |
|
error_msg |
String |
Definition: Error message. Value range: N/A |
Example Requests
Query filter.
GET https://{endpoint}/v1/criterion-filters?system_tag=secbrella&languages=JAVA&tool_version=202507&onlines=1
Example Responses
Status code: 200
query filters and counts by filter
{
"httpStatus" : "OK",
"result" : {
"languageInfoList" : [ {
"filterKey" : "java",
"filterValue" : 4709
} ],
"severityInfoList" : [ {
"filterKey" : "1",
"filterValue" : 209
} ]
},
"status" : "success"
}
Status code: 400
Bad Request
{
"error_code" : "CC.xxxxxxxx.400",
"error_msg" : "Verify request parameter failed. Check whether the request parameters are correct."
}
Status code: 401
Unauthorized
{
"error_code" : "CC.00000003",
"error_msg" : "Authentication information expired."
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
query filters and counts by filter |
|
400 |
Bad Request |
|
401 |
Unauthorized |
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot