docker_task {stevedore} | R Documentation |
Management commands for working with a particular docker task
Description
Methods for working with a particular docker task. Task objects
are returned by using $task$get
to fetch an existing task
by name or id, or $tasks
from a
docker_service
object representing a docker service.
Details
Below is reference documentation for all methods for version '1.29' of the docker API - other versions are available. This documentation is automatically generated from docker's API schema, and so inaccuracies may exist between it and stevedore's interface (especially references to JSON objects). Please report any documentation that might be improved at https://github.com/richfitz/stevedore/issues
Methods
help
Display help for this object
Usage:
help(help_type = getOption("help_type"))
Arguments:
help_type
: Passed toutils::help
, can be one of "text", "html" or "pdf" (or an abbreviation). By default it uses the valuegetOption("help_type")
and should follow the same behaviour as other R help (e.g., using "?")
id
Return the tasks's id
Usage:
id()
inspect
Return detailed information about this task
Usage:
inspect(reload = TRUE)
Arguments:
reload
: Logical scalar, indicating if the information should be refreshed from the daemon. This is useful to set toFALSE
after a task has been removed.
task_logs
Get task logs. Get
stdout
andstderr
logs from a task.Note: This endpoint works only for services with the
json-file
orjournald
logging drivers.Usage:
task_logs(details = NULL, follow = NULL, stdout = TRUE, stderr = TRUE, since = NULL, timestamps = NULL, tail = NULL, stream = stdout())
Arguments:
details
: Show task context and extra details provided to logs.follow
: Return the logs as a stream.This will return a
101
HTTP response with aConnection: upgrade
header, then hijack the HTTP connection to send raw output. For more information about hijacking and the stream format, hrefhttps://docs.docker.com/engine/api/1.29/#operation/ContainerAttachsee the documentation for the attach endpoint.stdout
: Return logs fromstdout
stderr
: Return logs fromstderr
since
: Only return logs since this time, as a UNIX timestamptimestamps
: Add timestamps to every log linetail
: Only return this number of log lines from the end of the logs. Specify as an integer orall
to output all log lines.stream
: The stream to send output to. Options here are (1) a connection object (e.g.stdout()
,stderr()
or a writable open file connection object, (2) a scalar character indicating a filename to write to, or (3)FALSE
orNULL
to disable any output.
reload
Refresh infomation on the task from the server, returning
$inspect()
invisibly.Usage:
reload()
service
Return parent service
Usage:
service()
state
Retrieve task state (running, shutdown, etc). Richer information about task status is available as
$inspect()$status
Usage:
state(reload = TRUE)
Arguments:
reload
: Logical scalar, indicating if the information should be refreshed from the daemon. This is useful to set toFALSE
after a task has been removed.
See Also
docker_task_collection
for other
task management methods.