Querying Rule Sets - Version 3
Function
This API is used to query the rule set list. You can filter rule sets by project ID and language. Compared with the API of version 2, the API of the current version has a limit on the size of pagination parameters. The API of version 2 will be brought offline later.
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 /v3/{project_id}/rulesets
|
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 |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
category |
No |
String |
Definition: Rule set category. Constraints: N/A Value range: Default value: N/A |
|
offset |
No |
Integer |
Definition: Offset for pagination. Constraints: N/A Value range: 0–999 |
|
limit |
No |
Integer |
Definition: Number of records displayed on each page. Constraints: N/A Value range: 0–50 |
|
need_selected_status |
No |
String |
Definition: Whether to query the usage status of a rule set. Constraints: N/A Value range: |
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 |
|---|---|---|
|
info |
Array of RulesetItem objects |
Definition: Rule set list information. Range: N/A |
|
total |
Integer |
Definition: Total number of rule sets. Value range: ≥0 |
|
Parameter |
Type |
Description |
|---|---|---|
|
template_id |
String |
Definition: Rule set ID. Value range: 32-character UUID. |
|
language |
String |
Definition: Rule set language. Value range: The following languages are supported: |
|
template_name |
String |
Definition Rule set language. Range Can contain any letters, digits, periods (.), hyphens (-), and underscores (_). |
|
creator_id |
String |
Definition: The user_id of the creator. The value is an IAM user ID. Value range: 32-character UUID. |
|
creator_name |
String |
Definition Creator name. The value is an IAM username. Range IAM username. |
|
template_create_time |
String |
Definition Creation time. Use the time zone 00:00. Range Time of time zone 00:00. |
|
is_used |
String |
Definition: Usage status. Value range: |
|
rule_ids |
String |
Definition: The ID of a rule in the rule set. Each rule has a unique ID. Value range: List of 32-character UUIDs. Separate multiple UUIDs with commas (,). |
|
is_default |
String |
Definition: Whether the rule set is the default for the language. Value range: |
|
is_devcloud_project_default |
String |
Definition: Whether the rule set is the default for the language in the project. Value range: |
|
is_default_template |
String |
Definition: Whether the rule set is preconfigured by the system. 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}/v3/{project_id}/rulesets
Example Responses
Status code: 200
Request succeeded!
{
"info" : [ {
"template_id" : "9698e0cb9d2441c3bd8cec5f8641696e",
"language" : "Java",
"template_name" : "test1111",
"creator_id" : "ae161856f2604229ae12056478a7919f",
"creator_name" : "Mr. Yang",
"template_create_time" : "2021-10-21T02:14:55Z",
"is_used" : "0",
"rule_ids" : "",
"is_default" : "0",
"is_default_template" : "1",
"is_devcloud_project_default" : "0"
}, {
"template_id" : "9698e0cb9d2441c3bd8cec5f8641696e",
"language" : "cpp",
"template_name" : "test222",
"creator_id" : "ae161856f2604229ae12056478a7919f",
"creator_name" : "Mr. Yang",
"template_create_time" : "2021-10-21T02:14:55Z",
"is_used" : "1",
"rule_ids" : "11152,11153,11154,11155",
"is_default" : "0",
"is_default_template" : "1",
"is_devcloud_project_default" : "1"
} ],
"total" : 2
}
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