3.6 KiB
3.6 KiB
\TaskApi
All URIs are relative to http://localhost/v1.51
| Method | HTTP request | Description |
|---|---|---|
| task_inspect | GET /tasks/{id} | Inspect a task |
| task_list | GET /tasks | List tasks |
| task_logs | GET /tasks/{id}/logs | Get task logs |
task_inspect
models::Task task_inspect(id) Inspect a task
Parameters
| Name | Type | Description | Required | Notes |
|---|---|---|---|---|
| id | String | ID of the task | [required] |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
task_list
Vecmodels::Task task_list(filters) List tasks
Parameters
| Name | Type | Description | Required | Notes |
|---|---|---|---|---|
| filters | Option<String> | A JSON encoded value of the filters (a map[string][]string) to process on the tasks list. Available filters: - `desired-state=(running |
shutdown | accepted)-id=-label=keyorlabel="key=value"-name=-node=-service=` |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
task_logs
std::path::PathBuf task_logs(id, details, follow, stdout, stderr, since, timestamps, tail) Get task logs
Get stdout and stderr logs from a task. See also /containers/{id}/logs. Note: This endpoint works only for services with the local, json-file or journald logging drivers.
Parameters
| Name | Type | Description | Required | Notes |
|---|---|---|---|---|
| id | String | ID of the task | [required] | |
| details | Option<bool> | Show task context and extra details provided to logs. | [default to false] | |
| follow | Option<bool> | Keep connection after returning logs. | [default to false] | |
| stdout | Option<bool> | Return logs from stdout |
[default to false] | |
| stderr | Option<bool> | Return logs from stderr |
[default to false] | |
| since | Option<i32> | Only return logs since this time, as a UNIX timestamp | [default to 0] | |
| timestamps | Option<bool> | Add timestamps to every log line | [default to false] | |
| tail | Option<String> | Only return this number of log lines from the end of the logs. Specify as an integer or all to output all log lines. |
[default to all] |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/vnd.docker.raw-stream, application/vnd.docker.multiplexed-stream, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]