Querying a Configuration Template
Function
This API is used to query a configuration template.
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/config/simple/{config_id}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| config_id | Yes | String | Definition Configuration template ID. Each CodeArts Check task and its branch tasks have the same unique configuration template ID. You can obtain the configuration template ID by querying the configTemplateId field of the task API based on the task ID. Constraints N/A Range N/A 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 |
| Content-Type | Yes | String | Definition Encoding format. Constraints N/A Range N/A Default Value application/json: The return value is in JSON format for any input value. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| httpStatus | String | Definition: HTTP response status. Value range: |
| result | ConfigTemplateSimpleInfo object | Definition Basic configuration of a task. |
| status | String | Definition: API response status. Value range: |
| Parameter | Type | Description |
|---|---|---|
| arch | String | Definition: Executor type. Range: |
| associatedAuthName | String | Definition: Name of the associated credential. This field is typically an empty string (""). Range: N/A |
| authId | String | Definition: The ID of an existing code source endpoint for storing repository information in a project. Range: N/A |
| authType | String | Definition: Authorization type. Range: |
| branch | String | Definition: Branch name. Range: N/A |
| businessId | String | Definition: Service ID of the preset quality configuration. This field is typically an empty string (""). Range: N/A |
| businessName | String | Definition: Service name of the preset quality configuration. This field is typically an empty string (""). Range: N/A |
| canDelete | Boolean | Definition Whether granted the permission for deleting the task. Range |
| canEdit | Boolean | Definition: Whether the user has the edit permission. Value range: |
| canRead | Boolean | Definition: Whether the user has the read permission. Value range: |
| checkersVersions | Array of strings | Definition Check tool version list. Generally, an empty array [] is returned. |
| childNum | Integer | Definition: Number of sub-templates. Value range: ≥0 |
| configImageMappings | Array of ConfigTemplateImageInfo objects | Definition Rule set configuration list. |
| createTime | String | Definition: Configuration template creation time (UTC). Format: yyyy-MM-ddTHH:mm:ssZ. For example, 2025-11-28T06:55:41Z. Value range: N/A |
| creator | String | Definition: Creator of the configuration template. Range: N/A |
| currentAuthUser | String | Definition: Authorizer of the configuration template. This field is typically an empty string (""). Value range: ≥ 0 characters |
| customParameters | String | Definition: String format of the customParams parameter. Value range: 1 to 65,535 characters. |
| customParams | Array of ConfigTemplateCustomParam objects | Definition: Compilation parameter list. |
| delayTime | Array of ConfigTemplateDelayTime objects | Definition: Bug delay configuration. |
| deptId | String | Definition: Department ID. This field is typically an empty string (""). Range: N/A |
| deptName | String | Definition: Department name. This field is typically an empty string (""). Range: N/A |
| domainId | String | Definition ID of the tenant to which the configuration template belongs. The value is the same as the tenant ID in IAM. Range The value is a string of 1 to 128 characters, including uppercase letters, lowercase letters, and digits. |
| exclude | String | Definition: Excluded directories in a task. Range: N/A |
| groups | String | Definition: Group information. This field is typically an empty string (""). Range: N/A |
| hwcloudRegion | String | Definition: Huawei Cloud region. Range: N/A |
| id | String | Definition Configuration template ID. It is required for modifying the configuration information. Each CodeArts Check task and its branch tasks have the same unique configuration template ID. You can obtain the configuration template ID by querying the configTemplateId field of the task API based on the task ID. Range N/A |
| includePaths | String | Definition: Checked directory. If you do not specify any directory, all code files in the code repository are checked. If you specify one or more directories, only the files in the specified directories are checked. Range: N/A |
| language | String | Definition Language. Range The following languages are supported: |
| lastReviser | String | Definition: Last modifier name. Range: N/A |
| lastUpdateTime | String | Definition: Time (UTC) when the configuration template was last modified. Format: yyyy-MM-ddTHH:mm:ssZ. For example, 2025-11-28T06:55:41Z. Value range: N/A |
| managers | String | Definition: Manager list. Range: N/A |
| manifestFile | String | Definition: Manifest file path. Range: N/A |
| matchRepos | String | Definition: List of matched repositories. Range: N/A |
| minorToolVersion | String | Definition: Minor version. Range: N/A |
| modelSets | Array of strings | Definition Model set list. Generally, an empty array [] is returned. |
| name | String | Definition: Name of a configuration template. Range: N/A |
| newSonarVersion | String | Definition: New Sonar version. Range: N/A |
| parentId | String | Definition: Parent template ID. This field is typically an empty string (""). Range: N/A |
| parentType | String | Definition: Parent template type. This field is typically an empty string (""). Range: N/A |
| projectId | String | Definition : 32-character project UUID. Obtain it by calling the API used to query the project list. Value range: 1 to 32 characters. |
| projectName | String | Definition: Project name. Range: N/A |
| region | String | Definition: Region. Range: suzhou. |
| repoType | String | Definition: Code repository type. Range: |
| repoUrl | String | Definition: Code repository address. Range: N/A |
| resourcePoolId | String | Definition: ID of an enabled agent pool. Leave this parameter as an empty string ("") when using built-in executors. Value range: N/A |
| resourcePoolName | String | Definition: Name of an enabled agent pool. Leave this parameter blank when using built-in executors. Range: N/A |
| resource_pool_type | String | Definition: Enabled agent pool type. Range: |
| reviewData | Array of ReviewDataInfoResponse objects | Definition Task gate configurations. |
| reviewDataJson | String | Definition: JSON characters of the task gate configurations. Range: N/A |
| ruleSets | Array of ConfigTemplateRuleSetInfo objects | Definition: Rule set configurations. |
| ruleSetsJson | String | Definition: JSON characters of the ruleSets field. Range: N/A |
| sonarVersion | String | Definition: Sonar version. Range: N/A |
| toolImage | String | Definition: Tool image. Range: N/A |
| toolVersion | String | Definition: Tool version. Range: N/A |
| toolVersionId | String | Definition: Tool version ID. Range: N/A |
| type | String | Definition: Configuration template type. Range: private. |
| versionLastUpdateTime | String | Definition: Time when the version was last updated. The format is yyyy-MM-dd HH:mm:ss. Range: N/A |
| versionUpdateDelayDays | Array of VersionUpdateDelayDays objects | Definition Configurations for version update delay. |
| versionUpdateDelayDaysJson | String | Definition: versionUpdateDelayDays in JSON format. Range: N/A |
| ymlConfigType | Integer | Definition: Configuration types in YAML. Range: N/A |
| ymlPath | String | Definition: YAML file path. Range: N/A |
| zone | String | Definition: Region, which is generally green. Range: green. |
| Parameter | Type | Description |
|---|---|---|
| arch | String | Definition: Executor type. Range: x86 or Arm. |
| cfgKey | String | Definition: Tool type, which is generally buildToolVersion. It indicates the compilation tool. Range: buildToolVersion. |
| cfgValue | String | Definition: Compilation tool name. The options are Ant, CMake, Mono, Go, Gradle, Maven, and MSBuild. Range: N/A |
| imageLabel | String | Definition: Image tag of the compilation tool. The compilation tools include Ant, CMake, Mono, Go, Gradle, Maven, and MSBuild. Range: N/A |
| imageName | String | Definition: Image name of the compilation tool. The compilation tools include Ant, CMake, Mono, Go, Gradle, Maven, and MSBuild. Range: N/A |
| organization | String | Definition: Organization to which the tool belongs. Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| description | String | Definition: Compilation description. Range: N/A |
| isChecked | Boolean | Definition: Whether the compilation tool is selected. Value range: |
| isRequired | Boolean | Definition: Mandatory or not. Range: |
| isShowInIDE | Boolean | Definition: Visible or not in IDE. Range: |
| key | String | Definition: Key of the compilation parameter. Range: |
| language | String | Definition Programming language. Range The following languages are supported: |
| name | String | Definition: Compilation parameter name. Range: |
| toolNames | String | Definition: Check tool. Range: N/A |
| type | String | Definition: Check tool type. Range: N/A |
| value | String | Definition: Value of the check parameter. Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| criterionType | String | Definition: Service type. Range: |
| delayDays | Integer | Definition: Delay time for bringing a bug fix online, in days. Range: |
| delayEndTime | String | Definition: Defect delay end time (UTC). Format: yyyy-MM-ddTHH:mm:ssZ. Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| compareType | String | Definition: Calculation logic. Range: The value is ≤. |
| isCheck | Integer | Definition Gate switch. Range |
| name | String | Definition: Gate item. Range: Number of critical issues. Number of major issues. Number of minor issues. Number of suggestions. |
| value | Integer | Definition: Gate threshold. Value range: ≥0 |
| Parameter | Type | Description |
|---|---|---|
| language | String | Definition Language type. Range Custom language or system language. The following system languages are supported: |
| ruleSetId | String | Definition: Rule set ID. Value range: 1 to 32 characters. |
| Parameter | Type | Description |
|---|---|---|
| criterionType | String | Definition: Service type. Range: |
| delayDays | Integer | Definition: Version update delay, in days. 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/config/simple/31855bb60fd643ddbf30e3dc9a6fce34 Example Responses
Status code: 200
Query a configuration template.
{
"httpStatus" : "OK",
"result" : {
"arch" : "X86",
"associatedAuthName" : "",
"authId" : "",
"authType" : "sshPrivateKey",
"branch" : "dotnet9_mr",
"businessId" : "",
"businessName" : "",
"canDelete" : true,
"canEdit" : true,
"canRead" : true,
"checkersVersions" : [ ],
"childNum" : 0,
"configImageMappings" : [ {
"arch" : "ARM",
"cfgKey" : "buildToolVersion",
"cfgValue" : "ant1.10.12-jdk1.11",
"imageLabel" : "arm-ant1.10.3-jdk1.8-1.0.2",
"imageName" : "ant",
"organization" : "codeci"
}, {
"arch" : "X86",
"cfgKey" : "buildToolVersion",
"cfgValue" : "ant1.10.12-jdk1.11",
"imageLabel" : "ant1.10.3-jdk1.8-1.0.5",
"imageName" : "ant",
"organization" : "codeci"
}, {
"arch" : "ARM",
"cfgKey" : "buildToolVersion",
"cfgValue" : "ant1.10.12-jdk1.7",
"imageLabel" : "arm-ant1.10.3-jdk1.8-1.0.2",
"imageName" : "ant",
"organization" : "codeci"
}, {
"arch" : "X86",
"cfgKey" : "buildToolVersion",
"cfgValue" : "ant1.10.12-jdk1.7",
"imageLabel" : "ant1.10.3-jdk1.8-1.0.5",
"imageName" : "ant",
"organization" : "codeci"
}, {
"arch" : "ARM",
"cfgKey" : "buildToolVersion",
"cfgValue" : "ant1.10.12-jdk1.8",
"imageLabel" : "arm-ant1.10.3-jdk1.8-1.0.2",
"imageName" : "ant",
"organization" : "codeci"
}, {
"arch" : "X86",
"cfgKey" : "buildToolVersion",
"cfgValue" : "ant1.10.12-jdk1.8",
"imageLabel" : "ant1.10.3-jdk1.8-1.0.5",
"imageName" : "ant",
"organization" : "codeci"
}, {
"arch" : "ARM",
"cfgKey" : "buildToolVersion",
"cfgValue" : "ant1.10.12-jdk1.9",
"imageLabel" : "arm-ant1.10.3-jdk1.8-1.0.2",
"imageName" : "ant",
"organization" : "codeci"
}, {
"arch" : "X86",
"cfgKey" : "buildToolVersion",
"cfgValue" : "ant1.10.12-jdk1.9",
"imageLabel" : "ant1.10.3-jdk1.8-1.0.5",
"imageName" : "ant",
"organization" : "codeci"
}, {
"arch" : "ARM",
"cfgKey" : "buildToolVersion",
"cfgValue" : "cmake2.8.12-gcc4.8.5",
"imageLabel" : "arm-cmake2.8.12-gcc4.8.5-1.0.17",
"imageName" : "cmake",
"organization" : "codeci"
}, {
"arch" : "X86",
"cfgKey" : "buildToolVersion",
"cfgValue" : "cmake2.8.12-gcc4.8.5",
"imageLabel" : "cmake2.8.12-gcc4.8.5-1.0.17",
"imageName" : "cmake",
"organization" : "codeci"
}, {
"arch" : "ARM",
"cfgKey" : "buildToolVersion",
"cfgValue" : "cmake2.8.12-gcc5.5.0",
"imageLabel" : "arm-cmake2.8.12-gcc5.5.0-1.0.17",
"imageName" : "cmake",
"organization" : "codeci"
}, {
"arch" : "X86",
"cfgKey" : "buildToolVersion",
"cfgValue" : "cmake2.8.12-gcc5.5.0",
"imageLabel" : "cmake2.8.12-gcc5.5.0-1.0.17",
"imageName" : "cmake",
"organization" : "codeci"
}, {
"arch" : "ARM",
"cfgKey" : "buildToolVersion",
"cfgValue" : "cmake2.8.12-gcc6.4.0",
"imageLabel" : "arm-cmake2.8.12-gcc6.4.0-1.0.17",
"imageName" : "cmake",
"organization" : "codeci"
}, {
"arch" : "X86",
"cfgKey" : "buildToolVersion",
"cfgValue" : "cmake2.8.12-gcc6.4.0",
"imageLabel" : "cmake2.8.12-gcc6.4.0-1.0.17",
"imageName" : "cmake",
"organization" : "codeci"
}, {
"arch" : "ARM",
"cfgKey" : "buildToolVersion",
"cfgValue" : "cmake2.8.12-gcc7.3.0",
"imageLabel" : "arm-cmake2.8.12-gcc7.3.0-1.0.17",
"imageName" : "cmake",
"organization" : "codeci"
}, {
"arch" : "X86",
"cfgKey" : "buildToolVersion",
"cfgValue" : "msbuild15-dotnetframework4.7.2",
"imageLabel" : "mono-msbuild16-dotnetframework2to4.8-1.0.0",
"imageName" : "shield",
"organization" : "codecheck_fuxi"
}, {
"arch" : "ARM",
"cfgKey" : "buildToolVersion",
"cfgValue" : "msbuild16-dotnetframework4.8",
"imageLabel" : "mono-msbuild4.8-1.1-arm",
"imageName" : "shield",
"organization" : "codecheck_fuxi"
}, {
"arch" : "X86",
"cfgKey" : "buildToolVersion",
"cfgValue" : "msbuild16-dotnetframework4.8",
"imageLabel" : "mono-msbuild16-dotnetframework2to4.8-1.0.0",
"imageName" : "shield",
"organization" : "codecheck_fuxi"
} ],
"createTime" : "2025-09-22T02:05:58Z",
"creator" : "devcloud_codecheck_01",
"currentAuthUser" : "",
"customParameters" : "[{\"description\":\"dotnet compilation command\",\"isChecked\":true,\"isRequired\":false,\"isShowInIDE\":false,\"key\":\"compileScriptCmd\",\"language\":\"C#\",\"name\":\"compilation command\",\"toolNames\":\"sonarqube\",\"type\":\"0\",\"value\":\"sh build.sh\"},{\"description\":\"Match the corresponding compilation image during the task execution. \",\"isChecked\":true,\"isRequired\":false,\"key\":\"compileTool\",\"language\":\"C#\",\"name\":\"compilation tool\",\"type\":\"2\",\"value\":\"dotnet\"},{\"description\":\"\",\"isChecked\":true,\"isRequired\":false,\"isShowInIDE\":false,\"key\":\"buildToolVersion\",\"language\":\"C#\",\"name\":\"compilation tool version\",\"toolNames\":\"sonarqube\",\"type\":\"2\",\"value\":\"dotnetcore9.0\"}]",
"customParams" : [ {
"description" : "After you select a compilation tool, the default version and command are automatically filled. You can change them.",
"isChecked" : true,
"isRequired" : false,
"isShowInIDE" : false,
"key" : "compileScriptCmd",
"language" : "C#",
"name" : "Compilation command.",
"toolNames" : "sonarqube",
"type" : 0,
"value" : "sh build.sh"
}, {
"description" : "",
"isChecked" : true,
"isRequired" : false,
"isShowInIDE" : false,
"key" : "buildToolVersion",
"language" : "C#",
"name" : "Compilation tool version.",
"toolNames" : "sonarqube",
"type" : 2,
"value" : "dotnetcore9.0"
} ],
"delayTime" : [ {
"criterionType" : "common",
"delayDays" : 60,
"delayEndTime" : "2025-05-09T14:00:00Z"
}, {
"criterionType" : "common_standard_recommend",
"delayDays" : 60,
"delayEndTime" : "2025-05-09T14:00:00Z"
}, {
"criterionType" : "common_standard_rule",
"delayDays" : 60,
"delayEndTime" : "2025-05-09T14:00:00Z"
}, {
"criterionType" : "security",
"delayDays" : 30,
"delayEndTime" : "2025-04-09T14:00:00Z"
}, {
"criterionType" : "security_standard_recommend",
"delayDays" : 30,
"delayEndTime" : "2025-04-09T14:00:00Z"
}, {
"criterionType" : "security_standard_rule",
"delayDays" : 30,
"delayEndTime" : "2025-04-09T14:00:00Z"
}, {
"criterionType" : "code_smells",
"delayDays" : 60,
"delayEndTime" : "2025-05-09T14:00:00Z"
}, {
"criterionType" : "design_smells",
"delayDays" : 60,
"delayEndTime" : "2025-05-09T14:00:00Z"
}, {
"criterionType" : "build_check",
"delayDays" : 60,
"delayEndTime" : "2025-05-09T14:00:00Z"
}, {
"criterionType" : "binscope",
"delayDays" : 60,
"delayEndTime" : "2025-05-09T14:00:00Z"
} ],
"deptId" : "",
"deptName" : "",
"domainId" : "389efb76b1354e4482eabeed25c895e4",
"exclude" : "",
"groups" : "",
"hwcloudRegion" : "cn-north-7",
"id" : "ae6f5637975811f0aa9bfa163eed4919",
"includePaths" : "",
"language" : "C#",
"lastReviser" : "devcloud_codecheck_01",
"lastUpdateTime" : "2025-09-22T02:09:28Z",
"managers" : "",
"manifestFile" : "",
"matchRepos" : "",
"minorToolVersion" : 1,
"modelSets" : [ ],
"name" : "template_ae6f5637975811f0aa9bfa163eed4919",
"newSonarVersion" : 2412,
"parentId" : "",
"parentType" : "",
"projectId" : "e54b275f438244a48d73b85806e2aaa3",
"projectName" : "CodeArts Check engine test case automated.",
"region" : "suzhou",
"repoType" : "DevCloud",
"repoUrl" : "git@codehub.devcloud.example.huawei.com:e54b27xxxx85806e2aaa3/Engine_SonarQube.git",
"resourcePoolId" : "",
"resourcePoolName" : "",
"resource_pool_type" : "",
"reviewData" : [ {
"compareType" : "≤",
"isCheck" : 1,
"name" : "Number of critical issues.",
"value" : 0
}, {
"compareType" : "≤",
"isCheck" : 1,
"name" : "Member of major issues.",
"value" : 0
}, {
"compareType" : "≤",
"isCheck" : 0,
"name" : "Number of minor issues.",
"value" : 0
}, {
"compareType" : "≤",
"isCheck" : 0,
"name" : "Number of suggestions.",
"value" : 0
} ],
"reviewDataJson" : "[{\"compareType\":\"≤\",\"isCheck\":1,\"name\":\"Number of critical issues\",\"value\":0},{\"compareType\":\"≤\",\"isCheck\":1,\"name\":\"Number of major issues\",\"value\":0},{\"compareType\":\"≤\",\"isCheck\":0,\"name\":\"Number of minor issues\",\"value\":0},{\"compareType\":\"≤\",\"isCheck\":0,\"name\":\"Number of suggestion issues\",\"value\":0}]",
"ruleSetId" : "a04d3f383b7d443bbbcae68ba53dd14a",
"ruleSets" : [ {
"language" : "C#",
"ruleSetId" : "a04d3f383b7d443bbbcae68ba53dd14a"
} ],
"ruleSetsJson" : "[{\"language\":\"C#\",\"ruleSetId\":\"a04d3f383b7d443bbbcae68ba53dd14a\"}]",
"sonarVersion" : 897,
"toolImage" : "",
"toolVersion" : 202507,
"toolVersionId" : "",
"type" : "private",
"versionLastUpdateTime" : "2025-03-10 22:00:00",
"versionUpdateDelayDays" : [ {
"criterionType" : "common",
"delayDays" : 60
}, {
"criterionType" : "common_standard_recommend",
"delayDays" : 60
}, {
"criterionType" : "common_standard_rule",
"delayDays" : 60
}, {
"criterionType" : "security",
"delayDays" : 30
}, {
"criterionType" : "security_standard_recommend",
"delayDays" : 30
}, {
"criterionType" : "security_standard_rule",
"delayDays" : 30
}, {
"criterionType" : "code_smells",
"delayDays" : 60
}, {
"criterionType" : "design_smells",
"delayDays" : 60
}, {
"criterionType" : "build_check",
"delayDays" : 60
}, {
"criterionType" : "binscope",
"delayDays" : 60
} ],
"versionUpdateDelayDaysJson" : "[{\"criterionType\":\"common\",\"delayDays\":60},{\"criterionType\":\"common_standard_recommend\",\"delayDays\":60},{\"criterionType\":\"common_standard_rule\",\"delayDays\":60},{\"criterionType\":\"security\",\"delayDays\":30},{\"criterionType\":\"security_standard_recommend\",\"delayDays\":30},{\"criterionType\":\"security_standard_rule\",\"delayDays\":30},{\"criterionType\":\"code_smells\",\"delayDays\":60},{\"criterionType\":\"design_smells\",\"delayDays\":60},{\"criterionType\":\"build_check\",\"delayDays\":60},{\"criterionType\":\"binscope\",\"delayDays\":60}]",
"ymlConfigType" : 1,
"ymlPath" : "",
"zone" : "green"
},
"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 | Query a configuration template. |
| 400 | A request error occurred. |
| 401 | The permission is insufficient. |
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