swarm_task_inspect
Inspect a single Docker Swarm task by ID or name to get its full configuration and status. Read-only, requires a swarm manager.
Instructions
Inspect a single swarm task, like docker inspect --type task.
For when you already hold a task reference -- from a swarm_task_list or service_ps row, a
service event, or an error message -- and want just that task. swarm_task_list returns the
same document for every task, so prefer it when scanning; this is the single-object fetch.
To reach the container behind a running task, read Status.ContainerStatus.ContainerID and pass
it to container_inspect / container_logs -- but note the container may be on another node,
where those tools cannot see it, and service_logs aggregates across tasks instead;
swarm_task_logs reads that one task's output wherever it landed. Read-only.
Requires a swarm manager; reports the daemon's own error if the task does not exist, if a
prefix matches more than one task, or if this node is not a manager.
Args:
id_or_name: The task id, an unambiguous id prefix, or the task's full name -- which is the container-name form
<service>.<slot>.<taskid> (<service>.<nodeid>.<taskid> for a global service), NOT the shorter
<service>.<slot> that docker service ps prints in its NAME column, which does not resolve. The daemon
tries full id, then full name, then prefix, and rejects an ambiguous prefix rather than picking a match
Returns:
dict: Full task inspect payload, as docker inspect --type task. Carries no name field of its own; compose one
from ServiceID/Slot if you need it
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id_or_name | Yes |