Help Center/ CodeArts Check/ API Reference/ APIs/ Rule Management/ Obtaining Specification Information
Updated on 2026-02-03 GMT+08:00

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}

Table 1 Path Parameters

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

Table 2 Request header 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

Table 3 Response body parameters

Parameter

Type

Description

httpStatus

String

Definition:

HTTP response status.

Value range:

  • OK: The request has been successfully processed, and the server returns the requested resource or operation result.

  • ACCEPTED: The request has been accepted by the server, but the processing is not complete (usually used for asynchronous operations).

  • INTERNAL_SERVER_ERROR: internal API exception.

  • BAD_REQUEST: abnormal parameter verification.

result

CriterionRuleParam object

Definition:

Rule information.

Range:

N/A

status

String

Definition:

API response status.

Value range:

  • success: successful response.

  • error: response failed.

Table 4 CriterionRuleParam

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:

  • 0: critical

  • 1: major

  • 2: minor

  • 3: suggestion

language

String

Definition:

Rule language.

Value range:

  • ArkTS

  • C#

  • Cangjie

  • C++

  • CSS

  • Go

  • HTML

  • Java

  • JavaScript

  • Kotlin

  • Lua

  • PHP

  • Python

  • Rust

  • Scala

  • Shell

  • SQL

  • Terraform

  • TypeScript

userTag

String

Definition:

User tag.

Value range:

  • huawei

  • iso5055

  • cert

  • cwe

  • top10

  • top25

  • misra

  • GJB

  • autosar

  • PCI DSS

systemTag

String

Definition:

Engine name.

Range:

codemars, secbrella, etc.

supportIDE

String

Definition:

Whether the rule supports IDE-level check.

Value range:

  • 1: supported.

  • 0: not supported.

supportVersion

String

Definition:

Whether the rule supports version-level check.

Value range:

  • 1: supported.

  • 0: not supported.

supportPersonal

String

Definition:

Whether the rule supports gate-level check.

Value range:

  • 1: supported.

  • 0: not supported.

sourceType

String

Definition:

Rule type.

Value range:

  • 0: custom rule.

  • 1: system rule.

criterionType

String

Definition:

Service type.

Value range:

  • common: general.

  • common_standard_recommend: general recommendation.

  • common_standard_rule: general rule.

  • security: security.

  • security_standard_recommend: security recommendation.

  • security_standard_rule: security rule.

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:

  • system: system rule.

  • 32-character UUID: ID of the tenant who creates the custom rule.

creatorId

String

Definition:

Tenant ID.

Value range:

  • system: system rule.

  • 32-character UUID: ID of the user who creates the custom rule.

canEdit

Boolean

Definition:

Whether the current user has the permission to edit the rule.

Value range:

  • true: The edit permission is granted.

  • false: The edit permission is not granted.

canDelete

Boolean

Definition:

Whether the current user has the permission to delete the rule.

Value range:

  • true: The delete permission is granted.

  • false: The delete permission is not granted.

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

Table 5 RelatedToolRule

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:

  • true: The edit permission is granted.

  • false: The edit permission is not granted.

canDelete

Boolean

Definition:

Whether the current user has the permission to delete the rule set.

Value range:

  • true: The delete permission is granted.

  • false: The delete permission is not granted.

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:

  • 0: custom rule.

  • 1: system rule.

  • 3: third-party rules imported by the user.

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:

  • 0: offline.

  • 1: online.

fixStatus

String

Definition:

Whether to automatically repair a rule.

Value range:

  • 0: no.

  • 1: yes.

isPersonalDefault

String

Definition:

Whether gate-level rules are used by default.

Value range:

  • 0: no.

  • 1: yes.

isVersionDefault

String

Definition:

Whether version-level rules are used by default.

Value range:

  • 0: no.

  • 1: yes.

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:

  • ArkTS

  • C#

  • Cangjie

  • C++

  • CSS

  • Go

  • HTML

  • Java

  • JavaScript

  • Kotlin

  • Lua

  • PHP

  • Python

  • Rust

  • Scala

  • Shell

  • SQL

  • Terraform

  • TypeScript

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.

Table 6 CriterionOption

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:

  • BOOLEAN: boolean

  • FLOAT: floating point number

  • INTEGER: integer

  • STRING: string

  • If not specified, STRING is used by default.

valueRange

String

Definition:

Parameter value range.

Range:

N/A

Status code: 400

Table 7 Response body parameters

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

Table 8 Response body parameters

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.