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 |
Definition: Project ID. For details, see Obtaining a Project ID. Constraints: N/A Value range: The value consists of 32 characters, including digits and letters. Default value: N/A |
pipeline_id |
Yes |
String |
Definition: Pipeline ID. Obtain the ID by calling the API for querying pipelines. pipelines.pipelineId indicates the pipeline ID. Constraints: N/A Value range: The value consists of 32 characters, including digits and letters. Default value: N/A |
pipelineRunId |
Yes |
String |
Definition: Pipeline run ID. The return value of the API for starting a pipeline is the pipeline run ID. Constraints: N/A Value range: The value consists of 32 characters, including digits and letters. Default value: N/A |
jobRunId |
Yes |
String |
Definition: Pipeline job ID. Constraints: N/A Value range: The value consists of 32 characters, including digits and letters. Default value: N/A |
stepRunId |
Yes |
String |
Definition: Pipeline step ID. Constraints: N/A Value range: The value consists of 32 characters, including digits and letters. Default value: N/A |
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 |
Definition: Sorting rule. Constraints: N/A Value range:
Default value: N/A |
offset |
Yes |
Long |
Definition: Offset. Constraints: N/A Value range: N/A Default value: N/A |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
has_more |
Boolean |
Definition: Whether there are more logs. Value range:
|
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", "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