Querying Pipeline Job Logs
Function
This API is used to query pipeline job logs.
Calling Method
For details, see Calling APIs.
URI
POST /v5/{project_id}/api/pipelines/{pipeline_id}/pipeline-runs/{pipelineRunId}/jobs/{jobRunId}/steps/{stepRunId}/exec-log
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Parameter description: CodeArts project ID. Constraints: N/A. Value Range: The value contains 32 characters. Default value: N/A. |
pipeline_id |
Yes |
String |
Parameter description: Pipeline ID. Constraints: N/A. Value Range: The value contains 32 characters. Default value: N/A. |
pipelineRunId |
Yes |
String |
Pipeline run ID. |
jobRunId |
Yes |
String |
Pipeline job ID. |
stepRunId |
Yes |
String |
Pipeline step ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
start_offset |
No |
Long |
Parameter description: Log start offset. Constraints: None. Value range: None. Default value: None. |
end_offset |
No |
Long |
Parameter description: Log end offset. Constraints: None. Value range: None. Default value: None. |
limit |
Yes |
Long |
Parameter description: Maximum number of log lines. Constraints: None. Value range: None. Default value: None. |
sort |
Yes |
String |
Parameter description: Sorting rule. Constraints: None. Value range: asc: Ascending; desc: Descending. Default value: None. |
offset |
Yes |
Long |
Offset. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
has_more |
Boolean |
Parameter description: Whether there are more logs. Value range: TRUE: more logs; FALSE: no more logs. |
end_offset |
String |
Parameter description: End offset of the log query. Enter the end_offset field in the request body to query logs on the next page. Value range: None. |
start_offset |
String |
Parameter description: Start offset of the queried logs. Enter the start_offset field in the request body to query logs on the next page. Value range: None. |
log |
String |
Parameter description: Log content. Value range: None. |
step_run_id |
String |
Parameter description: ID of the step to which it belongs. Value range: None. |
Example Requests
POST https://{endpoint}/v5/e2e18230a85d4d6ab0b56cb6d2246c18/api/pipelines/dc73b5ed58a64ab7a469b9480e5f6632/pipeline-runs/80e0fbc621014b2d85d960e0a3a935ef/jobs/806b3a5f0d504030af0bcf9a81347d9c/steps/ab9ac44f82004f8b9ab5d5a492122581/exec-log { "start_offset" : 0, "end_offset" : 0, "offset" : 0, "limit" : 500, "sort" : "asc" }
Example Responses
Status code: 200
Response body.
{ "has_more" : true, "end_offset" : "5424", "start_offset" : "0", "log" : "[2024/06/20 17:26:35.044 GMT+08:00] [INFO] : [JobStatusPlugin] onStarted:Status: Downloaded newer image for swzip-1.1.0", "location" : null, "step_run_id" : "ab9ac44f82004f8b9ab5d5a492122581" }
Status Codes
Status Code |
Description |
---|---|
200 |
Response body. |
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