Querying Rules - Version 2
Function
This API is used to query the rule list and return the rule details.
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 /v2/criterions
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
page_size |
No |
Integer |
Definition: Page size. Constraints: N/A Value range: 1–200 |
|
page |
No |
Integer |
Definition: Page number. Constraints: N/A Value range: 1–999 |
|
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 or offline. 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 |
No |
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 |
CriterionQueryInfo object |
Definition: Rule list. Range: N/A |
|
status |
String |
Definition: API response status. Value range: |
|
Parameter |
Type |
Description |
|---|---|---|
|
criterionList |
Array of CriterionInfoBody objects |
Definition: Rule list. Range: N/A |
|
setLanguage |
String |
Definition: Rule set language. Range: N/A |
|
setName |
String |
Definition: Rule set name. Range: N/A |
|
total |
Integer |
Definition: Total number of rules. Value range: ≥0 |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Definition: Capability rule ID. Value range: N/A |
|
name |
String |
Definition: Capability rule name in Chinese. Range: N/A |
|
nameCn |
String |
Definition: Capability rule name in English. Range: N/A |
|
isSupportVersion |
String |
Definition: Whether version-level check is supported for the rule in the rule set. Value range: |
|
isSupportPersonal |
String |
Definition: Whether gate-level check is supported for the rule in the rule set. Value range: |
|
isSupportIDE |
String |
Definition: Whether IDE-level check is supported for the rule in the rule set. Value range: |
|
supportVersion |
String |
Definition: Whether the rule supports version-level check. Value range: |
|
supportPersonal |
String |
Definition: Whether the rule supports IDE-level check. Value range: |
|
supportIDE |
String |
Definition: Whether the rule supports IDE-level check. Value range: |
|
comments |
String |
Definition: Description. Range: N/A |
|
goodExample |
String |
Definition: Compliant example. Range: N/A |
|
badExample |
String |
Definition: Noncompliant example. Range: N/A |
|
recommend |
String |
Definition: Fix suggestions. Range: N/A |
|
severity |
String |
Definition: Alarm severity. Value range: |
|
language |
String |
Definition: Rule language. Value range: |
|
systemTag |
String |
Definition: Engine name. Range: codemars, secbrella, etc. |
|
criterionSetId |
String |
Definition: Rule set ID. Value range: 32-character UUID. This field has a value when rules in a rule set are queried. This field is empty when rules are queried. |
|
options |
Array of CriterionOption objects |
Definition: Configuration parameters associated with the rule. Range: N/A |
|
criterionType |
String |
Definition: Service type. Value range: |
|
userTag |
String |
Definition: User tag. Range: N/A |
|
cwe |
String |
Definition: CWE IDs. Range: N/A |
|
delayStartTime |
String |
Definition: Delay alarm start time (UTC). Format: yyyy-MM-ddTHH:mm:ssZ. For example, 2020-09-25T12:05:00Z. Value range: N/A |
|
delayEndTime |
String |
Definition: Delay alarm end time (UTC). Format: yyyy-MM-ddTHH:mm:ssZ. Range: N/A |
|
creator |
String |
Definition: Creator. Range: Creator of the custom rule. The creator is the same as the username. |
|
sourceType |
String |
Definition: Rule type. Value range: |
|
toolVersion |
String |
Definition: Rule version. Range: N/A |
|
uniqueId |
String |
Definition: Unique ID of a capability rule. Value range: 32-character UUID. |
|
domainId |
String |
Definition: Tenant ID. Value range: |
|
creatorId |
String |
Definition: Tenant ID. Value range: |
|
Parameter |
Type |
Description |
|---|---|---|
|
ruleId |
String |
Definition: Tool rule ID. Value range: 32-character UUID. |
|
ruleName |
String |
Definition: Tool rule name. Range: N/A |
|
criterionId |
String |
Definition: Capability rule ID. Value range: 32-character UUID. |
|
criterionSetId |
String |
Definition: Rule set ID. Value range: 32-character UUID. |
|
optionKey |
String |
Definition: Key of a configuration parameter. Range: N/A |
|
name |
String |
Definition: Option name. Range: N/A |
|
optionValue |
String |
Definition: Value of the configuration parameter. The value is set by the user. If left blank, the default value will be used. Range: N/A |
|
description |
String |
Definition: Description of the configuration parameter. Range: N/A |
|
defaultValue |
String |
Definition: Default value. Range: N/A |
|
valueType |
String |
Definition: Parameter value type. Value range: |
|
valueRange |
String |
Definition: Parameter value range. 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
GET https://{endpoint}/v2/criterions?system_tag=secbrella&languages=JAVA&onlines=1&tool_version=202507&severitys=0
Example Responses
Status code: 200
query criterions
{
"httpStatus" : "OK",
"result" : {
"applicationScopeInfoList" : [ ],
"categoryInfoList" : [ ],
"criterionTypeList" : [ ],
"dirTrees" : [ ],
"fromRedis" : false,
"inheritInfoList" : [ ],
"issueTypeInfoList" : [ ],
"onlineInfoList" : [ ],
"severityInfoList" : [ ],
"sourceList" : [ ]
},
"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 criterions |
|
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