Querying Rule Sets by Language
Function
This API is used to query the rule set list of a language in a project.
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::listRuleSets | List | - | - | - | - |
URI
GET /v1/criterionsets/language
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| language | Yes | String | Definition Rule set language. Constraints N/A Range The following languages are supported: Default Value N/A |
| search | No | String | Definition: Search keyword. Constraints: N/A Value range: N/A Default value: N/A |
| page_size | No | Integer | Definition: Number of rule sets on each page. ** Constraints: ** N/A Range 1~1000 Default value: 1000 |
| page | No | Integer | Definition: Total number of pages. Constraints: N/A Value range: 0–999 Default value: 1 |
| project_id | Yes | 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 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 Range The length is the value of [1-100000]. Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| httpStatus | String | Definition: HTTP response status. Value range: |
| result | CriterionSetsInfo object | Definition: Rule list. Range: N/A |
| status | String | Definition: API response status. Value range: |
| Parameter | Type | Description |
|---|---|---|
| criterionSetList | Array of CriterionSetListV2Body objects | Definition: Rule list. Range: N/A |
| total | Integer | Definition: Total number of rules. Value range: ≥0 |
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition: Rule set ID. Value range: N/A |
| name | String | Definition: Rule set name in Chinese. Value range: 1 to 128 characters, including letters, digits, periods (.), hyphens (-), and underscores (_). |
| comments | String | Definition: Rule set description in Chinese. Range: N/A |
| type | String | Definition: Rule set type. Value range: |
| creator | String | Definition: Rule set creator. Range: Username. |
| createTime | String | Definition: Time when a rule set is created. Range: Coordinated universal time. |
| 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. |
| language | String | Definition Rule set language. Range |
| parentId | String | Definition: Parent rule set ID. Value range: 32-character UUID string. Use commas (,) to separate multiple IDs. |
| numCriterion | Integer | Definition: Number of enabled rules in a rule set. Value range: ≥0 |
| 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: |
| managers | String | Definition: Rule set administrator. Value range: User ID. Use commas (,) to separate multiple IDs. |
| parentSetNames | String | Definition: Name of a parent rule set. Range: Use commas (,) to separate multiple rule set names. |
| domainId | String | Definition Tenant ID, which is obtained from the IAM tenant ID. Range 32-character UUID. |
| inheritMode | String | Definition Inheritance type when a rule set is created. Range |
| creatorId | String | Definition: Creator ID. Value range: 32-character UUID. |
| isSystemDefault | String | Definition: Whether the rule set is the default rule set of the system. Value range: |
| isProjectDefault | String | Definition: Whether the rule set is the default rule set of the project. Value range: |
| isSystemSet | String | Definition: Whether the rule set is a system rule set. Value range: |
| ruleIds | String | Definition: Unique ID of an enabled capability rule in the rule set. Value range: 32-character UUID. Use commas (,) to separate multiple IDs. |
| region | String | Definition: Region where the rule set is located. Range: N/A |
| canSetDefault | Boolean | Definition: Whether the user has the permission to set the default rule set. Value range: |
| isUsed | Boolean | Definition Whether the rule set is in use. Range |
| childSets | Array of strings | Definition: Sub-rule set. Range: N/A |
| isReliable | Boolean | Definition: Whether the rule set is trusted. This field has been deprecated. Value range: |
| isRecommand | String | Definition: Whether the rule set is recommended. This field has been deprecated. Value range: |
| isDefault | Boolean | Definition: Whether the rule set is the default rule set. This field has been deprecated. Value range: |
| defaultSet | String | Definition: Whether the rule set is the default rule set. This field has been deprecated. Value range: |
| deptId | String | Definition: This field has been discarded. Range: N/A |
| deptName | String | Definition: This field has been discarded. Range: N/A |
| reliableTag | String | Definition: This field has been discarded. Range: N/A |
| recommandType | String | Definition: This field has been discarded. 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/criterionsets/language?project_id=8c7c74775f4f496596e4a39d34b209c3&language=JAVA Example Responses
Status code: 200
Request succeeded.
{
"httpStatus" : "OK",
"result" : {
"criterionSetList" : [ {
"canDelete" : false,
"canEdit" : false,
"childSets" : [ ],
"comments" : "",
"createTime" : "2020-11-13 15:36:01.0",
"creator" : "SYSTEM",
"creatorId" : "",
"deptId" : "",
"deptName" : "",
"folder" : "3 layer operations rule set/Java native tool rule set/",
"id" : "8dd7fcc36f4b497f874984644deea64a",
"isProjectDefault" : "0",
"isRecommand" : "0",
"isReliable" : true,
"isSystemDefault" : "0",
"isSystemSet" : "0",
"language" : "JAVA",
"lastReviser" : "SYSTEM",
"lastUpdateTime" : "2020-11-13 15:36:01",
"managers" : "",
"name" : "Checkstyle",
"numCriterion" : 0,
"order" : 37,
"parentFolderId" : "891db33c55e944b7b418bb2423af5491",
"parentId" : "891db33c55e944b7b418bb2423af5491",
"parentSetNames" : "",
"recommandType" : "0",
"reliableTag" : "",
"type" : "tool"
} ],
"total" : 1
},
"status" : "success"
} Status code: 400
A request error occurred.
{
"error_code" : "CC.xxxxxxxx.400",
"error_msg" : "Verify request parameter failed. Check whether the request parameters are correct."
} Status code: 401
The permission is insufficient.
{
"error_code" : "CC.00000003",
"error_msg" : "Authentication information expired."
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Request succeeded. |
| 400 | A request error occurred. |
| 401 | The permission is insufficient. |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank 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