Obtaining Build Task Details (Outdated)
Function
This API is used to obtain build task details.
Calling Method
For details, see Calling APIs.
URI
GET /v3/jobs/{job_id}/query
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
job_id |
Yes |
String |
Definition Enter the ID of the build task whose history you want to query. To obtain this ID, open the build task details page in your browser, and copy the 32-character string, which includes both digits and letters, at the end of the URL. Constraints N/A. Range The value is 32 characters long. Only letters and digits are allowed. Default Value N/A. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
get_all_params |
No |
String |
Definition Enter true or false to determine if all parameters should be returned. Constraints N/A. Range true or false Default Value false |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Definition User token. (The value of the X-Subject-Token response header is the user token.) It is obtained by calling the IAM API. Constraints Global tenant tokens are not supported. Use a region-level token whose scope is project. Range N/A. Default Value N/A. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
result |
CreateBuildJobResponseVo object |
Definition Template query result. Range N/A. |
error |
String |
Definition Returned error message. Range N/A. |
status |
String |
Definition Returned status information. Range ● success: The API call is successful. ● fail: The API call failed. |
Parameter |
Type |
Description |
---|---|---|
arch |
String |
Definition CPU architecture of the server. Range x86-64 or arm. |
project_id |
String |
Definition CodeArts project ID. ID of the project to which the build task belongs. Range A UUID. Use a 32-character string containing a mix of digits and letters. |
job_name |
String |
Definition Build task name. Range Letters, digits, underscores (_), and hyphens (-) are allowed. The value can contain 1 to 115 characters. |
auto_update_sub_module |
String |
Definition Whether submodules are automatically updated. Range false: Submodules are not updated. true: Submodules are updated. |
flavor |
String |
Definition Executor specification. Range N/A. |
host_type |
String |
Definition Host type. Range N/A. |
build_config_type |
String |
Definition Build configuration type. It can be YAML or ACTION. Range YAML or ACTION. |
build_if_code_updated |
Boolean |
Definition The switch that controls whether code commits trigger builds. Range true: Every code commit will trigger the build task. false: Code commits will not trigger the build task. |
parameters |
Array of CreateBuildJobParameterResponse objects |
Definition A list of build task execution parameters. Range N/A. |
group_id |
String |
Definition Task group ID. Range N/A. |
timeout |
CreateBuildTimeoutResponse object |
Definition Timeout duration of a build task. Range N/A. |
scms |
Array of CreateBuildJobScmResponse objects |
Definition Information about the code repository used during a build. Range N/A. |
steps |
Array of CreateBuildJobStepsResponse objects |
Definition Build actions being executed. Range N/A. |
triggers |
Array of TriggerResponse objects |
Definition A collection of scheduled task triggers. Range N/A. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Definition Parameter definition name. The default value is hudson.model.StringParameterDefinition. Range N/A. |
params |
Array of CreateBuildJobParameterParamResponse objects |
Definition Subparameters of build execution parameters. Range N/A. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Definition Parameter field name. Range N/A. |
value |
String |
Definition Parameter field value. Range N/A. |
limits |
Array of LimitsParamResponse objects |
Definition Restrictions on enumeration parameters. Range N/A. |
Parameter |
Type |
Description |
---|---|---|
disable |
String |
Definition Whether enabled or not. The default value is 0, indicating "enabled". Range N/A. |
display_name |
String |
Definition Parameter display name. Range N/A. |
name |
String |
Definition Parameter name. Range N/A. |
Parameter |
Type |
Description |
---|---|---|
limit |
String |
Definition Build task execution timeout. Range 0–4. |
unit |
String |
Definition Time unit for timeout. Range seconds, minute, or hour. |
Parameter |
Type |
Description |
---|---|---|
branch |
String |
Definition Name of the code branch. Range N/A. |
url |
String |
Definition Code repository address. Range N/A. |
repo_id |
String |
Definition Repo ID. Range N/A. |
web_url |
String |
Definition HTTPS address of the code repository. Range N/A. |
scm_type |
String |
Definition Repository type. Range repo, github, gitee, gerrit, gitcode, or codehub |
is_auto_build |
Boolean |
Definition Whether to trigger a build upon any code commit. Range ● true: Auto-build allowed. ● false: Auto-build disallowed. |
enable_git_lfs |
Boolean |
Definition Whether to enable Git LFS. Range ● true: Git LFS enabled. ● false: Git LFS disabled. |
build_type |
String |
Definition Build type. Options include build from a branch, tag, or commit. Range N/A. |
depth |
String |
Definition Clone depth. The clone depth is the number of recent commits that will be cloned. A larger value indicates more commits will be fetched. Range 1–25. |
end_point_id |
String |
Definition Endpoint ID used for pulling code from services such as Git. Range N/A. |
source |
String |
Definition Source of the code repository. Range N/A. |
group_name |
String |
Definition Repository group name. Range N/A. |
repo_name |
String |
Definition Repository name. Range N/A. |
Parameter |
Type |
Description |
---|---|---|
properties |
Map<String,Object> |
Definition Build action parameters. Range N/A. |
module_id |
String |
Definition Build action ID. Range N/A. |
name |
String |
Definition Build action name. Range N/A. |
version |
String |
Definition Build action version. Range N/A. |
enable |
Boolean |
Definition Whether to enable automatic build task. Range ● true: Enabled. ● false: Disabled. |
Parameter |
Type |
Description |
---|---|---|
parameters |
Array of ParameterItemResponse objects |
Definition Custom parameter. Range N/A. |
name |
String |
Definition Trigger type. Range N/A. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Definition Custom parameter name. Range Custom parameter name. The length cannot exceed 128 characters. Only letters, digits, and underscores (_) are supported. |
value |
String |
Definition Parameter value. Range Default value of the custom parameter. Max. 8,192 characters. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 403
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 404
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Example Requests
GET https://{endpoint}/v3/jobs/48c66c6002964721be537cdc6ce0297b/query
Example Responses
Status code: 200
OK
{ "result" : { "steps" : null, "arch" : "x86-64", "project_id" : "a287e712be6c404ca26e5f69040fa12b", "job_name" : "oychap213i2", "auto_update_sub_module" : "false", "flavor" : "2u8g", "parameters" : [ { "name" : "hudson.model.StringParameterDefinition", "params" : [ { "name" : "name", "value" : "codeBranch", "limits" : null }, { "name" : "type", "value" : "normalparam", "limits" : null }, { "name" : "defaultValue", "value" : "master", "limits" : null }, { "name" : "description", "value" : "Code branch, predefined parameters", "limits" : null }, { "name" : "deletion", "value" : "false", "limits" : null }, { "name" : "defaults", "value" : "true", "limits" : null }, { "name" : "staticVar", "value" : "false", "limits" : null }, { "name" : "sensitiveVar", "value" : "false", "limits" : null } ] } ], "scms" : [ { "branch" : "master", "url" : "git@codehub.devcloud.{region}.example.com:soso-test00001/an.git", "is_auto_build" : false, "scm_type" : "codehub", "end_point_id" : null, "web_url" : "https://devcloud.{region}.example.com/codehub/2111746211/home", "source" : null, "build_type" : "branch", "depth" : "1", "repo_id" : "2111746211" } ], "host_type" : "devcloud" }, "error" : null, "status" : "success" }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad Request |
401 |
Unauthorized |
403 |
Forbidden |
404 |
Not Found |
500 |
Internal Server Error |
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.