Obtaining Information About Build Outputs
Function
This API is used to obtain information about build outputs.
Calling Method
For details, see Calling APIs.
URI
GET /v1/job/{job_id}/{build_no}/output
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. |
build_no |
Yes |
Integer |
Definition The build number tracks each run of the build task. This parameter starts at 1, indicating the first build. It increments by 1 for every subsequent run. Constraints The value is a positive integer. Range Use only numbers that are 1 or greater. Default Value 1 |
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. For details, see Obtaining an IAM User Token. 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 |
---|---|---|
status |
String |
Definition API response status. Range ● success: The API call is successful. ● fail: The API call failed. |
error |
Object |
Definition Error message. Range N/A. |
result |
result object |
Definition Data returned after the API is successfully called. Range N/A. |
Parameter |
Type |
Description |
---|---|---|
package_info |
OutPutResult object |
Definition Artifact information. Range N/A. |
package_infos |
Map<String,OutPutResult> |
Definition Second-party package information. Range N/A. |
image_infos |
Map<String,OutPutResult> |
Definition Image package information. Range N/A. |
Parameter |
Type |
Description |
---|---|---|
project_id |
String |
Definition CodeArts project ID. ID of the project to which the build task belongs. Range N/A. |
name |
String |
Definition Artifact name. Range N/A. |
version |
String |
Definition Artifact version. Range N/A. |
package_type |
String |
Definition Artifact type. Range N/A. |
uri |
String |
Definition Artifact path. Range N/A. |
type |
String |
Definition Type. Range N/A. |
daily_build_number |
String |
Definition Build number. It starts from 1 every day. Range N/A. |
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
POST https://{endpoint}/v1/job/copy { "copy_job_id" : "db8467d972cc47f7a1bd2a3a3e77596a", "arch" : "x86-64", "project_id" : "a287e712be6c404ca26e5f69040fa12b", "job_name" : "examplejob", "auto_update_sub_module" : "false", "flavor" : "2u8g", "parameters" : [ { "name" : "hudson.model.StringParameterDefinition", "params" : [ { "name" : "name", "value" : "codeBranch" }, { "name" : "type", "value" : "normalparam" }, { "name" : "defaultValue", "value" : "master" }, { "name" : "description", "value" : "description" }, { "name" : "deletion", "value" : "false" }, { "name" : "defaults", "value" : "true" }, { "name" : "staticVar", "value" : "false" }, { "name" : "sensitiveVar", "value" : "false" } ] } ], "scms" : [ { "branch" : "master", "url" : "git@codehub.devcloud.{region}-7.huawei.com:soso-test00001/an.git", "repo_id" : "2111746211", "web_url" : "https://codehub.devcloud.{region}-7.huawei.com/codehub/2111746211/home", "scm_type" : "codehub", "is_auto_build" : false, "build_type" : "branch", "depth" : "1" } ], "steps" : [ { "properties" : null, "module_id" : "devcloud2018.codeci_action_20043.action", "name" : "Build with Maven", "version" : "20231001.6", "enable" : true } ], "host_type" : "devcloud", "triggers" : [ { "name" : "hudson.triggers.TimerTrigger", "parameters" : [ { "name" : "spec", "value" : "18 15 * * 1,2,3,4,5" }, { "name" : "timeZoneId", "value" : "Asia/Shanghai" }, { "name" : "timeZone", "value" : "China_Standard_Time" }, { "name" : "isDST", "value" : "false" } ] } ] }
Example Responses
Status code: 200
OK
{ "result" : { "package_info" : null, "package_infos" : { "additionalProp1" : { "project_id" : "a287e712be6c404ca26e5f69040fa12b", "name" : "a287e712be6c404ca26e5f69040fa12b", "version" : "a287e712be6c404ca26e5f69040fa12b", "package_type" : "a287e712be6c404ca26e5f69040fa12b", "uri" : "a287e712be6c404ca26e5f69040fa12b", "type" : "a287e712be6c404ca26e5f69040fa12b", "daily_build_number" : "a287e712be6c404ca26e5f69040fa12b" } }, "image_infos" : null }, "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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot