Querying Configuration Items by Rule Set ID List
Function
This API is used to query the configuration information associated with a rule in a rule set. This API supports multiple rule set IDs.
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::getRuleSet |
Read |
- |
- |
- |
- |
URI
POST /v1/config-items
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 |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
ids |
Yes |
Array of strings |
Definition : List of rule set IDs. Obtain the ID by calling the API used to obtain the rule set list. Constraints: N/A Value range: 32-character string list. Default value: N/A |
|
toolVersion |
No |
String |
Definition: Tool version. Constraints: N/A Range: N/A Default value: Latest version of the current environment. |
|
arch |
No |
String |
Definition: Current environment type. Constraints: N/A Value range: Default value: X86 |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
httpStatus |
String |
Definition: HTTP response status. Value range: |
|
result |
ConfigItemInfo object |
Definition: Compilation parameter list. Range: N/A |
|
status |
String |
Definition: API response status. Value range: |
|
Parameter |
Type |
Description |
|---|---|---|
|
key |
String |
Definition: Key of a configuration parameter. Range: N/A |
|
name |
String |
Definition: Configuration parameter name. Range: N/A |
|
defaulValue |
String |
Definition: Default parameter value. Range: N/A |
|
description |
String |
Definition: Parameter description. Range: N/A |
|
toolNames |
String |
Definition: Name of the associated engine. Range: N/A |
|
options |
Array of strings |
Definition: Parameter options. Range: N/A |
|
option |
String |
Definition: Parameter options. Use commas (,) to separate multiple options. Range: N/A |
|
setIds |
String |
Definition: Rule set ID. Use commas (,) to separate multiple IDs. Value range: N/A |
|
languages |
String |
Definition: Language corresponding to the compilation parameter. Range: N/A |
|
compileMap |
Map<String,String> |
Definition: Map format. Value range: N/A |
|
descriptionMap |
Map<String,String> |
Definition: Map format. Value 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
POST https://{endpoint}/v1/config-items
{
"ids" : [ "24b97exxxxxxxxfb912625b14cxxxxxx", "24b97exxxxxxxxfb91cc25b14cxxxxxx" ],
"toolVersion" : "202507",
"arch" : "X86"
}
Example Responses
Status code: 200
Request Succeeded!
{
"httpStatus" : "OK",
"result" : [ {
"configId" : "73dc3cb0bd3811ebad2ffa163efbc7ea",
"defaulValue" : "jdk8",
"description" : "The JDK version to be used for checks. The value can be **jdk8**, **jdk11**, or **jdk17**. The default value is **jdk8**.\n\n **For details, see https://his.huawei.com/doc/#/page.html?service_code=hrn:his:servicemarket::service:codecheck&group_id=c86dec7aec984218a65a9c7c4f24b572&lang=en_US**",
"id" : "d2a19e9ef62649d3bc69a0faa162fdf0",
"isRequired" : false,
"isShowInIDE" : false,
"key" : "jdkVersion",
"name" : "[spotbugs] JDK version",
"required" : false,
"showInIDE" : false,
"toolName" : "spotbugs",
"toolNames" : "spotbugs",
"type" : "0"
} ],
"status" : "success"
}
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