v1

latestOpenAPI 3.0.02026-07-1410578280.2 KB
Task

Inspect a task

get/tasks/{id}

Path parameters

idstring required

ID of the task

Response

no error

CreatedAtstring dateTime
DesiredState'new' | 'allocated' | 'pending' | 'assigned' | 'accepted' | 'preparing' | 'ready' | 'starting' | 'running' | 'complete' | 'shutdown' | 'failed' | 'rejected'
IDstring

The ID of the task.

Labelsobject

User-defined key/value metadata.

Namestring

Name of the task.

NodeIDstring

The ID of the node that this task is on.

ServiceIDstring

The ID of the service this task is part of.

Slotinteger
UpdatedAtstring dateTime

Example response

{
  "AssignedGenericResources": [
    {
      "DiscreteResourceSpec": {
        "Kind": "SSD",
        "Value": 3
      }
    },
    {
      "NamedResourceSpec": {
        "Kind": "GPU",
        "Value": "UUID1"
      }
    },
    {
      "NamedResourceSpec": {
        "Kind": "GPU",
        "Value": "UUID2"
      }
    }
  ],
  "CreatedAt": "2016-06-07T21:07:31.171892745Z",
  "DesiredState": "running",
  "ID": "0kzzo1i0y4jz6027t0k7aezc7",
  "NetworksAttachments": [
    {
      "Addresses": [
        "10.255.0.10/16"
      ],
      "Network": {
        "CreatedAt": "2016-06-07T20:31:11.912919752Z",
        "DriverState": {
          "Name": "overlay",
          "Options": {
            "com.docker.network.driver.overlay.vxlanid_list": "256"
          }
        },
        "ID": "4qvuz4ko70xaltuqbt8956gd1",
        "IPAMOptions": {
          "Configs": [
            {
              "Gateway": "10.255.0.1",
              "Subnet": "10.255.0.0/16"
            }
          ],
          "Driver": {
            "Name": "default"
          }
        },
        "Spec": {
          "DriverConfiguration": {},
          "IPAMOptions": {
            "Configs": [
              {
                "Gateway": "10.255.0.1",
                "Subnet": "10.255.0.0/16"
              }
            ],
            "Driver": {}
          },
          "Labels": {
            "com.docker.swarm.internal": "true"
          },
          "Name": "ingress"
        },
        "UpdatedAt": "2016-06-07T21:07:29.955277358Z",
        "Version": {
          "Index": 18
        }
      }
    }
  ],
  "NodeID": "60gvrl6tm78dmak4yl7srz94v",
  "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz",
  "Slot": 1,
  "Spec": {
    "ContainerSpec": {
      "Image": "redis"
    },
    "Placement": {},
    "Resources": {
      "Limits": {},
      "Reservations": {}
    },
    "RestartPolicy": {
      "Condition": "any",
      "MaxAttempts": 0
    }
  },
  "Status": {
    "ContainerStatus": {
      "ContainerID": "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035",
      "PID": 677
    },
    "Message": "started",
    "State": "running",
    "Timestamp": "2016-06-07T21:07:31.290032978Z"
  },
  "UpdatedAt": "2016-06-07T21:07:31.376370513Z",
  "Version": {
    "Index": 71
  }
}