Updated on 2025-08-21 GMT+08:00

Obtaining All Run Logs

Function

This API is used to obtain all run logs.

Calling Method

For details, see Calling APIs.

URI

GET /v1/log/{job_id}/{build_no}/real-time-log

Table 1 Path Parameters

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

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

start_offset

Yes

Integer

Definition

Where the query begins.

Constraints

N/A.

Range

Use only numbers that are 0 or greater.

end_offset

Yes

Integer

Definition

Where the query ends.

Constraints

N/A.

Range

Use only numbers that are 0 or greater.

sort

No

String

Definition

Sorting order.

Constraints

N/A.

Range

AES or DESC.

size

Yes

String

Definition

Length of the returned content. It is fixed at 1000.

Constraints

N/A.

Range

Use only numbers that are 0 or greater.

Default Value

1000

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

result

result object

Result.

error

String

Returned error message.

status

String

Returned status information.

Table 4 result

Parameter

Type

Description

has_more

Boolean

Definition

Whether there are remaining logs.

Constraints

N/A.

Range

true or false

Default Value

N/A.

start_offset

String

Definition

The offset used to specify a starting point in the result set returned by a query.

Constraints

N/A.

Range

The value consists of numbers.

Default Value

N/A.

end_offset

String

Definition

The offset used to specify an end point in the result set returned by a query.

Constraints

N/A.

Range

The value consists of numbers.

Default Value

N/A.

log

String

Definition

Returned log content. Request again if it is empty.

Constraints

N/A.

Range

N/A.

Default Value

N/A.

location

String

Definition

Log source.

Constraints

N/A.

Range

N/A.

Default Value

N/A.

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 401

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 403

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 404

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

GET https://{endpoint}/v1/log/{job_id}/{build_no}/real-time-log

Example Responses

Status code: 200

OK

{
  "result" : {
    "start_offset" : 542993,
    "end_offset" : 657353,
    "log" : "[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]...",
    "has_more" : false,
    "location" : "jenkins"
  },
  "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.