DockerEngineAPI.Api.Task (elixir_dea v1.45.7)
API calls for all endpoints tagged Task
.
Summary
Functions
Inspect a task
List tasks
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
task_inspect(connection, id, opts \\ [])
@spec task_inspect(Tesla.Env.client(), String.t(), keyword()) :: {:ok, DockerEngineAPI.Model.Task.t()} | {:ok, DockerEngineAPI.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Inspect a task
Parameters
connection
(DockerEngineAPI.Connection): Connection to serverid
(String.t): ID of the taskopts
(keyword): Optional parameters
Returns
{:ok, DockerEngineAPI.Model.Task.t}
on success{:error, Tesla.Env.t}
on failure
task_list(connection, opts \\ [])
@spec task_list( Tesla.Env.client(), keyword() ) :: {:ok, [DockerEngineAPI.Model.Task.t()]} | {:ok, DockerEngineAPI.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
List tasks
Parameters
connection
(DockerEngineAPI.Connection): Connection to serveropts
(keyword): Optional parameters:filters
(String.t): A JSON encoded value of the filters (amap[string][]string
) to process on the tasks list. Available filters: -desired-state=(running | shutdown | accepted)
-id=<task id>
-label=key
orlabel="key=value"
-name=<task name>
-node=<node id or name>
-service=<service name>
Returns
{:ok, [%Task{}, ...]}
on success{:error, Tesla.Env.t}
on failure
task_logs(connection, id, opts \\ [])
@spec task_logs(Tesla.Env.client(), String.t(), keyword()) :: {:ok, DockerEngineAPI.Model.ErrorResponse.t()} | {:ok, String.t()} | {:error, Tesla.Env.t()}
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 serverid
(String.t): ID of the taskopts
(keyword): Optional parameters:details
(boolean()): Show task context and extra details provided to logs.:follow
(boolean()): Keep connection after returning logs.:stdout
(boolean()): Return logs fromstdout
:stderr
(boolean()): Return logs fromstderr
: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 orall
to output all log lines.
Returns
{:ok, String.t}
on success{:error, Tesla.Env.t}
on failure