Help Center/ CodeArts Build/ API Reference/ Task APIs/ Downloading Real-time Build Logs
Updated on 2024-04-18 GMT+08:00

Downloading Real-time Build Logs

Function

This API is used to download real-time build logs.

Calling Method

For details, see Calling APIs.

URI

GET /v3/jobs/{job_id}/{build_no}/real-time-log

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.

build_no

Yes

Integer

Build number of the task, which automatically increases from 1 by 1 each time the build task is executed.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

Yes

Integer

Response offset of the previous request.

length

No

Integer

The length of the returned content is controllable. The default value is 1,000,000.

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

has_more_data

String

Whether there are remaining logs.

offset

String

Offset used for one request.

content

String

Returned log content. Request again if it is empty.

current_offset

String

Offset of the current request.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 403

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 404

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 500

Table 10 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" : {
    "has_more_data" : true,
    "offset" : 126548,
    "content" : "[2023/12/21 15:44:18.743 GMT+08:00] [INFO] Building jar: ***//target/server-1.0.jar\\n[2023/12/21 15:44:18.744 GMT+08:00] [INFO] ------------------------------------------------------------------------\\n[2023/12/21 15:44:18.744 GMT+08:00] [INFO] BUILD SUCCESS\\n[2023/12/21 15:44:18.744 GMT+08:00] [INFO] ------------------------------------------------------------------------\\n[2023/12/21 15:44:18.744 GMT+08:00] [INFO] Total time: 5.408 s\\n[2023/12/21 15:44:18.744 GMT+08:00] [INFO] Finished at: 2023-12-21T15:44:18+08:00\\n[2023/12/21 15:44:18.744 GMT+08:00] [INFO] ------------------------------------------------------------------------\\n[2023/12/21 15:44:18.793 GMT+08:00] [INFO] [Maven build: external_post_maven]: This step starts. \\n[2023/12/21 15:44:18.796 GMT+08:00] [INFO] [Maven build: external_post_maven]: Parameters initialized. \\n[2023/12/21 15:44:18.796 GMT+08:00] [INFO] [Maven build: external_post_maven]: Plug-in context initialized. \\n[2023/12/21 15:44:18.797 GMT+08:00] [INFO] [Maven build: external_post_maven]: This step is complete. \\n[2023/12/21 15:44:18.842 GMT+08:00] $ docker stop --time=1 8db533bfed323ffeb24d4698b65af3b4d6f138c9e7c0297ee9e33442648b87ea\\n",
    "current_offset" : 121768
  },
  "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.