Help Center/ CodeArts Build/ API Reference/ Task APIs/ Obtaining Build Records of a Task
Updated on 2024-04-18 GMT+08:00

Obtaining Build Records of a Task

Function

This API is used to obtain build records of a task.

Calling Method

For details, see Calling APIs.

URI

GET /v3/jobs/{job_id}/build-info-records

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

job_id

Yes

String

Build task ID. The task ID contains the 32 digits and letters at the end of the browser URL when the build task is edited.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

start_time

Yes

String

Start time. The value format is yyyy-MM-dd HH:mm:ss.

end_time

Yes

String

End time. The value format is yyyy-MM-dd HH:mm:ss.

page_index

No

Integer

Page number, indicating that the query starts from this page. The value of page_index is greater than or equal to 0.

page_size

No

Integer

Number of items displayed on each page. The value of page_size is less than or equal to 100.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling the IAM API. (Value of X-Subject-Token in the response header.) Global tenant tokens are not supported. Use a region-level token whose scope is project.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

result

result object

Result.

error

String

Returned error message.

status

String

Returned status information.

Table 5 result

Parameter

Type

Description

health_score

String

Health status.

page_index

String

Page number.

total_page

String

Total number of records.

total_record

String

Total number of records.

job_build_states

Array of BuildInfoRecord objects

Build record list.

Table 6 BuildInfoRecord

Parameter

Type

Description

number

String

Build ID.

build_time

Integer

Execution time.

start_time

Integer

Start time (timestamp).

job_running_status

String

Running status.

state

String

Task status.

user_id

String

IAM user ID.

executor

String

User who triggered the build.

nickname

String

Username.

daily_build_number

String

Build ID, which starts from 1 every day.

trigger_type

String

Trigger type.

cost_time

Integer

Execution time.

commit_id

String

Code commit ID.

commit_info

commit_info object

Code commit message.

build_type

String

Build ID, which starts from 1 every day.

code_branch

String

Code repository branch.

scm_type

String

Code source type.

scm_web_url

String

Code source address.

commit_detail_url

String

Address of code commit record (Code source: Repo).

Table 7 commit_info

Parameter

Type

Description

commit_id

String

Code commit ID.

created_at

String

Commit time.

Status code: 400

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 401

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 403

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 404

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 500

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Example Requests

POST https://{endpoint}/v3/jobs/48c66c6002964721be537cdc6ce0297b/33/real-time-log

Example Responses

Status code: 200

OK

{
  "result" : {
    "health_score" : "0",
    "page_index" : "0",
    "total_page" : "44",
    "total_record" : "44",
    "job_build_states" : [ {
      "number" : 44,
      "build_time" : 3525000,
      "start_time" : 1703554641000,
      "job_running_status" : "Finished",
      "state" : "SUCCESS",
      "user_id" : "ae22fd035f354cfa8d82a3f1c8940446",
      "executor" : "test",
      "nickname" : "021",
      "daily_build_number" : "20231226.1",
      "trigger_type" : "Scheduled",
      "commit_id" : "ffe2ee8b44a0b2683df86b44f8ec27d71baeae86",
      "cost_time" : 3525000,
      "commit_info" : {
        "commit_id" : "ffe2ee8b44a0b2683df86b44f8ec27d71baeae86",
        "created_at" : "2023-11-21T01:48:21.000+00:00"
      },
      "build_type" : "branch",
      "code_branch" : "master",
      "scm_type" : "codehub",
      "scm_web_url" : "https://test.huawei.com/codehub/2111750206/home",
      "commit_detail_url" : "https://test.huawei.com/codehub/2111750206/ffe2ee8b44a0b2683df86b44f8ec27d71baeae86/commitdetail"
    } ]
  },
  "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.