Obtaining Specification Information
Function
This API is used to query the rule information by specification ID. Response information contains the specification information and tool rule information.
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::getRule |
Read |
- |
- |
- |
- |
URI
GET /v1/rule/criterion-rule/query/{criterion_rule_id}
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
criterion_rule_id |
Yes |
String |
Definition : Specification ID. Obtain the information by calling the API used to obtain the rule list[. Constraints: N/A Value range: 32-character UUID. 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 |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
httpStatus |
String |
Definition: HTTP response status. Value range: |
|
result |
CriterionRuleParam object |
Definition: Rule information. Range: N/A |
|
status |
String |
Definition: API response status. Value range: |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Definition: Capability rule ID. Value range: N/A |
|
name |
String |
Definition: Capability rule name in English. Range: N/A |
|
nameCn |
String |
Definition: Capability rule name in Chinese. Range: N/A |
|
comments |
String |
Definition: Description in Chinese. Range: N/A |
|
category |
String |
Definition: Rule subcategory. Range: N/A |
|
treeNodeParentId |
String |
Definition: Tree node information. Range: N/A |
|
type |
String |
Definition: Rule type. Range: N/A |
|
goodExample |
String |
Definition: Compliant example in Chinese. Range: N/A |
|
badExample |
String |
Definition: Noncompliant example in Chinese. Range: N/A |
|
recommend |
String |
Definition: Fix suggestions in Chinese. Range: N/A |
|
severity |
String |
Definition: Alarm severity. Value range: |
|
language |
String |
Definition: Rule language. Value range: |
|
userTag |
String |
Definition: User tag. Value range: |
|
systemTag |
String |
Definition: Engine name. Range: codemars, secbrella, etc. |
|
supportIDE |
String |
Definition: Whether the rule supports IDE-level check. Value range: |
|
supportVersion |
String |
Definition: Whether the rule supports version-level check. Value range: |
|
supportPersonal |
String |
Definition: Whether the rule supports gate-level check. Value range: |
|
sourceType |
String |
Definition: Rule type. Value range: |
|
criterionType |
String |
Definition: Service type. Value range: |
|
cwe |
String |
Definition: CWE IDs. Range: N/A |
|
managers |
String |
Definition: Rule set administrator. Value range: User ID. If there are multiple IDs, separate them using commas (,). |
|
options |
Array of CriterionOption objects |
Definition: Configuration parameters associated with the rule. Range: N/A |
|
relatedToolRules |
Array of RelatedToolRule objects |
Definition: Associated tool rules. Range: N/A |
|
domainId |
String |
Definition: Tenant ID. Value range: |
|
creatorId |
String |
Definition: Tenant ID. Value range: |
|
canEdit |
Boolean |
Definition: Whether the current user has the permission to edit the rule. Value range: |
|
canDelete |
Boolean |
Definition: Whether the current user has the permission to delete the rule. Value range: |
|
lastReviser |
String |
Definition: Latest operator of a rule. Range: Username. |
|
lastUpdateTime |
String |
Definition: Time when the rule was last updated. Range: Coordinated universal time. |
|
creator |
String |
Definition: Creator. Range: Creator of the custom rule. The creator is the same as the username. |
|
createTime |
String |
Definition: Time when a rule was created. Range: Coordinated universal time. |
|
toolVersion |
String |
Definition: Rule version. Range: N/A |
|
uniqueId |
String |
Definition: Unique ID of a capability rule. Value range: 32-character UUID. |
|
batchChangeVersion |
Array of strings |
Definition: Modify versions in batches. Range: N/A |
|
productVerification |
Array of strings |
Definition: Product verification result. Range: N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Definition: Tool rule ID. Value range: 32-character UUID. |
|
canEdit |
Boolean |
Definition: Whether the current user has the permission to edit the rule set. Value range: |
|
canDelete |
Boolean |
Definition: Whether the current user has the permission to delete the rule set. Value range: |
|
lastReviser |
String |
Definition: Latest operator of a rule set. Range: Username. |
|
lastUpdateTime |
String |
Definition: Time when the rule set was last updated. Range: Coordinated universal time. |
|
creator |
String |
Definition: Creator. Range: Creator of the custom rule. The creator is the same as the username. |
|
createTime |
String |
Definition: Time when a rule set is created. Range: Coordinated universal time. |
|
refNum |
Integer |
Definition: This field has been discarded. Range: N/A |
|
refObjName |
String |
Definition: This field has been discarded. Range: N/A |
|
refs |
Array of strings |
Definition: This field has been discarded. Range: N/A |
|
toolVersion |
String |
Definition: Rule version. Range: N/A |
|
uniqueId |
String |
Definition: Unique ID of a tool rule. Value range: 32-character UUID. |
|
name |
String |
Definition: Tool rule name in English. Range: N/A |
|
nameCn |
String |
Definition: Tool rule name in Chinese. Range: N/A |
|
comments |
String |
Definition: Description. Range: N/A |
|
checkerId |
String |
Definition: Engine ID. Value range: 32-character UUID. |
|
source |
String |
Definition: Tool source. Range: N/A |
|
type |
String |
Definition: Rule type. Value range: |
|
checkerScenario |
String |
Definition: Rule application scenario. Range: N/A |
|
version |
String |
Definition: Tool rule version. Range: N/A |
|
online |
String |
Definition: Tool rule online status. Value range: |
|
fixStatus |
String |
Definition: Whether to automatically repair a rule. Value range: |
|
isPersonalDefault |
String |
Definition: Whether gate-level rules are used by default. Value range: |
|
isVersionDefault |
String |
Definition: Whether version-level rules are used by default. Value range: |
|
contextLines |
Integer |
Definition: Displayed lines in context. Range: An integer greater than 0 |
|
checkerName |
String |
Definition: Engine name. Range: N/A |
|
checkerToolVersion |
String |
Definition: Engine tool version. Range: N/A |
|
language |
String |
Definition: Rule language. Value range: |
|
checkerVersion |
String |
Definition: Engine version. Range: N/A |
|
lastReversionId |
String |
Definition: ID of the tool rule of the latest version. Value range: N/A |
|
fileId |
String |
Definition: File ID. This ID is not empty only when the rule is a custom rule. Value range: N/A |
|
options |
Array of CriterionOption objects |
Rule options. |
|
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}/v1/rule/criterion-rule/query/d084f2c46c1911f0aa9bfa163eed4919
Example Responses
Status code: 200
Request Succeeded!
{
"httpStatus" : "OK",
"status" : "success",
"result" : {
"badExample" : "",
"batchChangeVersion" : [ ],
"canDelete" : true,
"canEdit" : true,
"comments" : "",
"creator" : "",
"criterionType" : "common",
"cwe" : "",
"demo" : "",
"goodExample" : "",
"id" : "0f52c885be1f4d1cb134d32324c1797d",
"language" : "C++",
"lastReviser" : "",
"lastUpdateTime" : "2020-10-14 15:50:23",
"managers" : "",
"name" : "#define of macro with same name as previously declared symbol symbol",
"nameCn" : "#define of macro with same name as previously declared symbol symbol",
"recommend" : "",
"relatedToolRules" : [ ],
"severity" : "1",
"source" : "Software analysis lab",
"sourceType" : "1",
"supportIDE" : "1",
"supportPersonal" : "1",
"supportVersion" : "1",
"systemTag" : "clangTidy",
"toolVersion" : "202306",
"type" : "",
"uniqueId" : "ea3329680df111ebb169fa163ee969af",
"userTag" : "Hilint, to be taken offline"
}
}
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 |
Request Succeeded! |
|
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