Search or ask Docker

Task

Task schema in Docker Engine API 1.57.

View Markdown

Schema

Type: object

AssignedGenericResources

Schema: GenericResources

CreatedAt

Type: string

All schema constraints and annotations
{
  "format": "dateTime",
  "type": "string"
}
DesiredState

Schema: TaskState

ID

Type: string

The ID of the task.
All schema constraints and annotations
{
  "description": "The ID of the task.",
  "type": "string"
}
JobIteration

Schema: ObjectVersion

If the Service this Task belongs to is a job-mode service, contains the JobIteration of the Service this Task was created for. Absent if the Task was created for a Replicated or Global Service.
All schema constraints and annotations
{
  "$ref": "#/components/schemas/ObjectVersion",
  "description": "If the Service this Task belongs to is a job-mode service, contains\nthe JobIteration of the Service this Task was created for. Absent if\nthe Task was created for a Replicated or Global Service.\n"
}
Labels

Type: object

User-defined key/value metadata.
All schema constraints and annotations
{
  "additionalProperties": {
    "type": "string"
  },
  "description": "User-defined key/value metadata.",
  "type": "object"
}
Name

Type: string

Name of the task.
All schema constraints and annotations
{
  "description": "Name of the task.",
  "type": "string"
}
NetworksAttachments

Type: array

The networks that this task is attached to, and the addresses the task was assigned on each of them.
Array item

Schema: NetworkAttachment

All schema constraints and annotations
{
  "description": "The networks that this task is attached to, and the addresses the\ntask was assigned on each of them.\n",
  "items": {
    "$ref": "#/components/schemas/NetworkAttachment"
  },
  "type": "array"
}
NodeID

Type: string

The ID of the node that this task is on.
All schema constraints and annotations
{
  "description": "The ID of the node that this task is on.",
  "type": "string"
}
ServiceID

Type: string

The ID of the service this task is part of.
All schema constraints and annotations
{
  "description": "The ID of the service this task is part of.",
  "type": "string"
}
Slot

Type: integer

All schema constraints and annotations
{
  "type": "integer"
}
Spec

Schema: TaskSpec

Status

Schema: TaskStatus

UpdatedAt

Type: string

All schema constraints and annotations
{
  "format": "dateTime",
  "type": "string"
}
Version

Schema: ObjectVersion

All schema constraints and annotations
{
  "example": {
    "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
    }
  },
  "properties": {
    "AssignedGenericResources": {
      "$ref": "#/components/schemas/GenericResources"
    },
    "CreatedAt": {
      "format": "dateTime",
      "type": "string"
    },
    "DesiredState": {
      "$ref": "#/components/schemas/TaskState"
    },
    "ID": {
      "description": "The ID of the task.",
      "type": "string"
    },
    "JobIteration": {
      "$ref": "#/components/schemas/ObjectVersion",
      "description": "If the Service this Task belongs to is a job-mode service, contains\nthe JobIteration of the Service this Task was created for. Absent if\nthe Task was created for a Replicated or Global Service.\n"
    },
    "Labels": {
      "additionalProperties": {
        "type": "string"
      },
      "description": "User-defined key/value metadata.",
      "type": "object"
    },
    "Name": {
      "description": "Name of the task.",
      "type": "string"
    },
    "NetworksAttachments": {
      "description": "The networks that this task is attached to, and the addresses the\ntask was assigned on each of them.\n",
      "items": {
        "$ref": "#/components/schemas/NetworkAttachment"
      },
      "type": "array"
    },
    "NodeID": {
      "description": "The ID of the node that this task is on.",
      "type": "string"
    },
    "ServiceID": {
      "description": "The ID of the service this task is part of.",
      "type": "string"
    },
    "Slot": {
      "type": "integer"
    },
    "Spec": {
      "$ref": "#/components/schemas/TaskSpec"
    },
    "Status": {
      "$ref": "#/components/schemas/TaskStatus"
    },
    "UpdatedAt": {
      "format": "dateTime",
      "type": "string"
    },
    "Version": {
      "$ref": "#/components/schemas/ObjectVersion"
    }
  },
  "type": "object"
}