Log API
Updated at:2025-10-20
Log API
Retrieve the log records associated with the command execution.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| runId | String | Yes | RequestBody | Execution ID |
| childId | String | Yes | RequestBody | Sub-execution ID under an execution ID |
| cursor | int | Yes | RequestBody | The initial request is 0. For subsequent pagination, fill in the nextCursor responded upon the previous request |
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| requestId | String | Request ID |
| code | String | Response state, where successful execution is indicated by success. |
| result | LogResult | Return to the log result |
Request example
Python
1if __name__ == '__main__':
2 HOST = b'http://ca.bj.baidubce.com'
3 AK = b''
4 SK = b''
5 config = BceClientConfiguration(credentials=BceCredentials(AK, SK),
6 endpoint=HOST)
7 ca_client = CaClient(config)
8 run_id = "r-raUPWwr933Liqe54"
9 child_id = "d-7abflJHODABF"
10 response = ca_client.action_log(run_id, child_id, 1)
11 print(response)
Response example
JSON
1{
2 "requestId": "aaf4bd8f-ed6c-481b-ad1a-a4c974******",
3 "code": "success",
4 "result": {
5 "logs": [
6 {
7 "msg": "pwd \n",
8 }, {
9 "msg": "second line",
10 }
11 ],
12 "nextCursor": 2,
13 "state" : "RUNNING"
14 }
15}
Appendix
LogResult
| Parameter name | Types | Description |
|---|---|---|
| childId | String | Sub-execution ID |
| logs | List<Log> | Log content, arranged in sequence |
| state | String | Execution status of the sub-task. Possible values: FAILED (execution failed), RUNNING (execution ongoing), SUCCESS (execution completed). |
| nextCursor | int | Cursor for the next request. If the sub-task execution has concluded and nextCursor=cursor, no further logs are available. Otherwise, additional logs may still exist. |
Log
| Parameter name | Types | Description |
|---|---|---|
| msg | String | Command execution log |
