Querying Default Rule Sets of a Project
Function
This API is used to query the default rule set of each language in a project. Default rule set ID of each language is returned.
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::getProjectConfig | Read | - | codeartscheck:ProjectId | - | - |
URI
GET /v1/criterionset/get-default-sets
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| 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 | Map<String,String> | Definition: Default rule set ID of each language in the project. The structure is map. Value range: |
| status | String | Definition: API response status. Value range: |
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/criterionset/get-default-sets?project_id=8c7c74775f4f496596e4a39d34b209c3 Example Responses
Status code: 200
get default sets
{
"httpStatus" : "OK",
"status" : "success",
"result" : {
"arkts" : "e283302be51111ee9439909838cbb4b5",
"c#" : "b113b9bee57545738bee86ec69f337a6",
"c++" : "a9ac0292e14c44e39d6a93395cdf2629",
"css" : "8b17c76da51145bdb16ad58a5b55fad9",
"go" : "c5168e30ace948a78e3d42e5bfd2b592",
"html" : "4e988c481b4c46d0a3297fbe343a662d",
"java" : "782aade71ffb4ab780303555eb2e4825",
"javascript" : "cce1c1bce5ae4764b5b3f0b768cca6ca",
"kotlin" : "78cbb4418fed4460834b6753d32605e7",
"lua" : "8c21a21bc3d74d2386fa62ed119d0ce0",
"php" : "6ddae60e22d74ca4bdfcd91f4b1db87e",
"python" : "d2c81699269b420483e797e06e9bbf21",
"rust" : "a39df150e7e244719d00088e310d001f",
"scala" : "632b8ea9c0f24a81acdb226b2bbdffc7",
"shell" : "71e966afdb934babbb7615a4ac68f5af",
"sql" : "dae19546ebdb11ee9439909838cbb4b5",
"typescript" : "5986aecac5db453f96e1546d76bf1681"
}
} 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 | get default sets |
| 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