View Source DockerEngineAPI.Api.Task (docker_engine_api v1.43.0)

API calls for all endpoints tagged Task.

Summary

Functions

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.

Functions

Link to this function

task_inspect(connection, id, opts \\ [])

View Source

Inspect a task

Parameters

  • connection (DockerEngineAPI.Connection): Connection to server
  • id (String.t): ID of the task
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

task_list(connection, opts \\ [])

View Source

List tasks

Parameters

  • connection (DockerEngineAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters
    • :filters (String.t): 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=<task id>` - `label=key` or `label="key=value"` - `name=<task name>` - `node=<node id or name>` - `service=<service name>`

Returns

, ...]} on success {:error, info} on failure

Link to this function

task_logs(connection, id, opts \\ [])

View Source

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

  • connection (DockerEngineAPI.Connection): Connection to server
  • id (String.t): ID of the task
  • opts (KeywordList): [optional] Optional parameters
    • :details (boolean()): Show task context and extra details provided to logs.
    • :follow (boolean()): Keep connection after returning logs.
    • :stdout (boolean()): Return logs from `stdout`
    • :stderr (boolean()): Return logs from `stderr`
    • :since (integer()): Only return logs since this time, as a UNIX timestamp
    • :timestamps (boolean()): Add timestamps to every log line
    • :tail (String.t): Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines.

Returns

} on success {:error, info} on failure