blob: d19e8c9ca895c55722761f2ffc35e569d9ec5f6a [file] [log] [blame]
# A Swagger 2.0 (a.k.a. OpenAPI) definition of the Engine API.
#
# This is used for generating API documentation and the types used by the
# client/server. See api/README.md for more information.
#
# Some style notes:
# - This file is used by ReDoc, which allows GitHub Flavored Markdown in
# descriptions.
# - There is no maximum line length, for ease of editing and pretty diffs.
# - operationIds are in the format "NounVerb", with a singular noun.
swagger: "2.0"
schemes:
- "http"
- "https"
produces:
- "application/json"
- "text/plain"
consumes:
- "application/json"
- "text/plain"
basePath: "/v1.26"
info:
title: "Docker Engine API"
version: "1.26"
x-logo:
url: "https://docs.docker.com/images/logo-docker-main.png"
description: |
The Engine API is an HTTP API served by Docker Engine. It is the API the Docker client uses to communicate with the Engine, so everything the Docker client can do can be done with the API.
Most of the client's commands map directly to API endpoints (e.g. `docker ps` is `GET /containers/json`). The notable exception is running containers, which consists of several API calls.
# Errors
The API uses standard HTTP status codes to indicate the success or failure of the API call. The body of the response will be JSON in the following format:
```
{
"message": "page not found"
}
```
# Versioning
The API is usually changed in each release of Docker, so API calls are versioned to ensure that clients don't break.
For Docker Engine >= 1.13.1, the API version is 1.26. To lock to this version, you prefix the URL with `/v1.26`. For example, calling `/info` is the same as calling `/v1.26/info`.
Engine releases in the near future should support this version of the API, so your client will continue to work even if it is talking to a newer Engine.
In previous versions of Docker, it was possible to access the API without providing a version. This behaviour is now deprecated will be removed in a future version of Docker.
The API uses an open schema model, which means server may add extra properties to responses. Likewise, the server will ignore any extra query parameters and request body properties. When you write clients, you need to ignore additional properties in responses to ensure they do not break when talking to newer Docker daemons.
This documentation is for version 1.26 of the API, which was introduced with Docker 1.13.1. Use this table to find documentation for previous versions of the API:
Docker version | API version | Changes
----------------|-------------|---------
1.13.0 | [1.25](https://docs.docker.com/engine/api/v1.25/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-25-api-changes)
1.12.x | [1.24](https://docs.docker.com/engine/api/v1.24/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-24-api-changes)
1.11.x | [1.23](https://docs.docker.com/engine/api/v1.23/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-23-api-changes)
1.10.x | [1.22](https://docs.docker.com/engine/api/v1.22/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-22-api-changes)
1.9.x | [1.21](https://docs.docker.com/engine/api/v1.21/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-21-api-changes)
1.8.x | [1.20](https://docs.docker.com/engine/api/v1.20/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-20-api-changes)
1.7.x | [1.19](https://docs.docker.com/engine/api/v1.19/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-19-api-changes)
1.6.x | [1.18](https://docs.docker.com/engine/api/v1.18/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-18-api-changes)
# Authentication
Authentication for registries is handled client side. The client has to send authentication details to various endpoints that need to communicate with registries, such as `POST /images/(name)/push`. These are sent as `X-Registry-Auth` header as a Base64 encoded (JSON) string with the following structure:
```
{
"username": "string",
"password": "string",
"email": "string",
"serveraddress": "string"
}
```
The `serveraddress` is a domain/IP without a protocol. Throughout this structure, double quotes are required.
If you have already got an identity token from the [`/auth` endpoint](#operation/SystemAuth), you can just pass this instead of credentials:
```
{
"identitytoken": "9cbaf023786cd7..."
}
```
# The tags on paths define the menu sections in the ReDoc documentation, so
# the usage of tags must make sense for that:
# - They should be singular, not plural.
# - There should not be too many tags, or the menu becomes unwieldly. For
# example, it is preferable to add a path to the "System" tag instead of
# creating a tag with a single path in it.
# - The order of tags in this list defines the order in the menu.
tags:
# Primary objects
- name: "Container"
x-displayName: "Containers"
description: |
Create and manage containers.
- name: "Image"
x-displayName: "Images"
- name: "Network"
x-displayName: "Networks"
description: |
Networks are user-defined networks that containers can be attached to. See the [networking documentation](https://docs.docker.com/engine/userguide/networking/) for more information.
- name: "Volume"
x-displayName: "Volumes"
description: |
Create and manage persistent storage that can be attached to containers.
- name: "Exec"
x-displayName: "Exec"
description: |
Run new commands inside running containers. See the [command-line reference](https://docs.docker.com/engine/reference/commandline/exec/) for more information.
To exec a command in a container, you first need to create an exec instance, then start it. These two API endpoints are wrapped up in a single command-line command, `docker exec`.
- name: "Secret"
x-displayName: "Secrets"
# Swarm things
- name: "Swarm"
x-displayName: "Swarm"
description: |
Engines can be clustered together in a swarm. See [the swarm mode documentation](https://docs.docker.com/engine/swarm/) for more information.
- name: "Node"
x-displayName: "Nodes"
description: |
Nodes are instances of the Engine participating in a swarm. Swarm mode must be enabled for these endpoints to work.
- name: "Service"
x-displayName: "Services"
description: |
Services are the definitions of tasks to run on a swarm. Swarm mode must be enabled for these endpoints to work.
- name: "Task"
x-displayName: "Tasks"
description: |
A task is a container running on a swarm. It is the atomic scheduling unit of swarm. Swarm mode must be enabled for these endpoints to work.
# System things
- name: "Plugin"
x-displayName: "Plugins"
- name: "System"
x-displayName: "System"
definitions:
Port:
type: "object"
description: "An open port on a container"
required: [PrivatePort, Type]
properties:
IP:
type: "string"
format: "ip-address"
PrivatePort:
type: "integer"
format: "uint16"
x-nullable: false
description: "Port on the container"
PublicPort:
type: "integer"
format: "uint16"
description: "Port exposed on the host"
Type:
type: "string"
x-nullable: false
enum: ["tcp", "udp"]
example:
PrivatePort: 8080
PublicPort: 80
Type: "tcp"
MountPoint:
type: "object"
description: "A mount point inside a container"
properties:
Type:
type: "string"
Name:
type: "string"
Source:
type: "string"
Destination:
type: "string"
Driver:
type: "string"
Mode:
type: "string"
RW:
type: "boolean"
Propagation:
type: "string"
DeviceMapping:
type: "object"
description: "A device mapping between the host and container"
properties:
PathOnHost:
type: "string"
PathInContainer:
type: "string"
CgroupPermissions:
type: "string"
example:
PathOnHost: "/dev/deviceName"
PathInContainer: "/dev/deviceName"
CgroupPermissions: "mrw"
ThrottleDevice:
type: "object"
properties:
Path:
description: "Device path"
type: "string"
Rate:
description: "Rate"
type: "integer"
format: "int64"
minimum: 0
Mount:
type: "object"
properties:
Target:
description: "Container path."
type: "string"
Source:
description: "Mount source (e.g. a volume name, a host path)."
Type:
description: |
The mount type. Available types:
- `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container.
- `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed.
- `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs.
type: "string"
enum:
- "bind"
- "volume"
- "tmpfs"
ReadOnly:
description: "Whether the mount should be read-only."
type: "boolean"
BindOptions:
description: "Optional configuration for the `bind` type."
type: "object"
properties:
Propagation:
description: "A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`."
enum:
- "private"
- "rprivate"
- "shared"
- "rshared"
- "slave"
- "rslave"
VolumeOptions:
description: "Optional configuration for the `volume` type."
type: "object"
properties:
NoCopy:
description: "Populate volume with data from the target."
type: "boolean"
default: false
Labels:
description: "User-defined key/value metadata."
type: "object"
additionalProperties:
type: "string"
DriverConfig:
description: "Map of driver specific options"
type: "object"
properties:
Name:
description: "Name of the driver to use to create the volume."
type: "string"
Options:
description: "key/value map of driver specific options."
type: "object"
additionalProperties:
type: "string"
TmpfsOptions:
description: "Optional configuration for the `tmpfs` type."
type: "object"
properties:
SizeBytes:
description: "The size for the tmpfs mount in bytes."
type: "integer"
format: "int64"
Mode:
description: "The permission mode for the tmpfs mount in an integer."
type: "integer"
RestartPolicy:
description: |
The behavior to apply when the container exits. The default is not to restart.
An ever increasing delay (double the previous delay, starting at 100ms) is added before each restart to prevent flooding the server.
type: "object"
properties:
Name:
type: "string"
description: |
- `always` Always restart
- `unless-stopped` Restart always except when the user has manually stopped the container
- `on-failure` Restart only when the container exit code is non-zero
enum:
- "always"
- "unless-stopped"
- "on-failure"
MaximumRetryCount:
type: "integer"
description: "If `on-failure` is used, the number of times to retry before giving up"
default: {}
Resources:
description: "A container's resources (cgroups config, ulimits, etc)"
type: "object"
properties:
# Applicable to all platforms
CpuShares:
description: "An integer value representing this container's relative CPU weight versus other containers."
type: "integer"
Memory:
description: "Memory limit in bytes."
type: "integer"
default: 0
# Applicable to UNIX platforms
CgroupParent:
description: "Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist."
type: "string"
BlkioWeight:
description: "Block IO weight (relative weight)."
type: "integer"
minimum: 0
maximum: 1000
BlkioWeightDevice:
description: |
Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`.
type: "array"
items:
type: "object"
properties:
Path:
type: "string"
Weight:
type: "integer"
minimum: 0
BlkioDeviceReadBps:
description: |
Limit read rate (bytes per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`.
type: "array"
items:
$ref: "#/definitions/ThrottleDevice"
BlkioDeviceWriteBps:
description: |
Limit write rate (bytes per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`.
type: "array"
items:
$ref: "#/definitions/ThrottleDevice"
BlkioDeviceReadIOps:
description: |
Limit read rate (IO per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`.
type: "array"
items:
$ref: "#/definitions/ThrottleDevice"
BlkioDeviceWriteIOps:
description: |
Limit write rate (IO per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`.
type: "array"
items:
$ref: "#/definitions/ThrottleDevice"
CpuPeriod:
description: "The length of a CPU period in microseconds."
type: "integer"
format: "int64"
CpuQuota:
description: "Microseconds of CPU time that the container can get in a CPU period."
type: "integer"
format: "int64"
CpuRealtimePeriod:
description: "The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks."
type: "integer"
format: "int64"
CpuRealtimeRuntime:
description: "The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks."
type: "integer"
format: "int64"
CpusetCpus:
description: "CPUs in which to allow execution (e.g., `0-3`, `0,1`)"
type: "string"
CpusetMems:
description: "Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems."
type: "string"
Devices:
description: "A list of devices to add to the container."
type: "array"
items:
$ref: "#/definitions/DeviceMapping"
DiskQuota:
description: "Disk limit (in bytes)."
type: "integer"
format: "int64"
KernelMemory:
description: "Kernel memory limit in bytes."
type: "integer"
format: "int64"
MemoryReservation:
description: "Memory soft limit in bytes."
type: "integer"
format: "int64"
MemorySwap:
description: "Total memory limit (memory + swap). Set as `-1` to enable unlimited swap."
type: "integer"
format: "int64"
MemorySwappiness:
description: "Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100."
type: "integer"
format: "int64"
minimum: 0
maximum: 100
NanoCPUs:
description: "CPU quota in units of 10<sup>-9</sup> CPUs."
type: "integer"
format: "int64"
OomKillDisable:
description: "Disable OOM Killer for the container."
type: "boolean"
PidsLimit:
description: "Tune a container's pids limit. Set -1 for unlimited."
type: "integer"
format: "int64"
Ulimits:
description: |
A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`"
type: "array"
items:
type: "object"
properties:
Name:
description: "Name of ulimit"
type: "string"
Soft:
description: "Soft limit"
type: "integer"
Hard:
description: "Hard limit"
type: "integer"
# Applicable to Windows
CpuCount:
description: |
The number of usable CPUs (Windows only).
On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last.
type: "integer"
format: "int64"
CpuPercent:
description: |
The usable percentage of the available CPUs (Windows only).
On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last.
type: "integer"
format: "int64"
IOMaximumIOps:
description: "Maximum IOps for the container system drive (Windows only)"
type: "integer"
format: "int64"
IOMaximumBandwidth:
description: "Maximum IO in bytes per second for the container system drive (Windows only)"
type: "integer"
format: "int64"
HostConfig:
description: "Container configuration that depends on the host we are running on"
allOf:
- $ref: "#/definitions/Resources"
- type: "object"
properties:
# Applicable to all platforms
Binds:
type: "array"
description: |
A list of volume bindings for this container. Each volume binding is a string in one of these forms:
- `host-src:container-dest` to bind-mount a host path into the container. Both `host-src`, and `container-dest` must be an _absolute_ path.
- `host-src:container-dest:ro` to make the bind-mount read-only inside the container. Both `host-src`, and `container-dest` must be an _absolute_ path.
- `volume-name:container-dest` to bind-mount a volume managed by a volume driver into the container. `container-dest` must be an _absolute_ path.
- `volume-name:container-dest:ro` to mount the volume read-only inside the container. `container-dest` must be an _absolute_ path.
items:
type: "string"
ContainerIDFile:
type: "string"
description: "Path to a file where the container ID is written"
LogConfig:
type: "object"
description: "The logging configuration for this container"
properties:
Type:
type: "string"
enum:
- "json-file"
- "syslog"
- "journald"
- "gelf"
- "fluentd"
- "awslogs"
- "splunk"
- "etwlogs"
- "none"
Config:
type: "object"
additionalProperties:
type: "string"
NetworkMode:
type: "string"
description: "Network mode to use for this container. Supported standard values are: `bridge`, `host`, `none`, and `container:<name|id>`. Any other value is taken
as a custom network's name to which this container should connect to."
PortBindings:
type: "object"
description: "A map of exposed container ports and the host port they should map to."
additionalProperties:
type: "object"
properties:
HostIp:
type: "string"
description: "The host IP address"
HostPort:
type: "string"
description: "The host port number, as a string"
RestartPolicy:
$ref: "#/definitions/RestartPolicy"
AutoRemove:
type: "boolean"
description: "Automatically remove the container when the container's process exits. This has no effect if `RestartPolicy` is set."
VolumeDriver:
type: "string"
description: "Driver that this container uses to mount volumes."
VolumesFrom:
type: "array"
description: "A list of volumes to inherit from another container, specified in the form `<container name>[:<ro|rw>]`."
items:
type: "string"
Mounts:
description: "Specification for mounts to be added to the container."
type: "array"
items:
$ref: "#/definitions/Mount"
# Applicable to UNIX platforms
CapAdd:
type: "array"
description: "A list of kernel capabilities to add to the container."
items:
type: "string"
CapDrop:
type: "array"
description: "A list of kernel capabilities to drop from the container."
items:
type: "string"
Dns:
type: "array"
description: "A list of DNS servers for the container to use."
items:
type: "string"
DnsOptions:
type: "array"
description: "A list of DNS options."
items:
type: "string"
DnsSearch:
type: "array"
description: "A list of DNS search domains."
items:
type: "string"
ExtraHosts:
type: "array"
description: |
A list of hostnames/IP mappings to add to the container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`.
items:
type: "string"
GroupAdd:
type: "array"
description: "A list of additional groups that the container process will run as."
items:
type: "string"
IpcMode:
type: "string"
description: "IPC namespace to use for the container."
Cgroup:
type: "string"
description: "Cgroup to use for the container."
Links:
type: "array"
description: "A list of links for the container in the form `container_name:alias`."
items:
type: "string"
OomScoreAdj:
type: "integer"
description: "An integer value containing the score given to the container in order to tune OOM killer preferences."
PidMode:
type: "string"
description: |
Set the PID (Process) Namespace mode for the container. It can be either:
- `"container:<name|id>"`: joins another container's PID namespace
- `"host"`: use the host's PID namespace inside the container
Privileged:
type: "boolean"
description: "Gives the container full access to the host."
PublishAllPorts:
type: "boolean"
description: "Allocates a random host port for all of a container's exposed ports."
ReadonlyRootfs:
type: "boolean"
description: "Mount the container's root filesystem as read only."
SecurityOpt:
type: "array"
description: "A list of string values to customize labels for MLS
systems, such as SELinux."
items:
type: "string"
StorageOpt:
type: "object"
description: |
Storage driver options for this container, in the form `{"size": "120G"}`.
additionalProperties:
type: "string"
Tmpfs:
type: "object"
description: |
A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options. For example: `{ "/run": "rw,noexec,nosuid,size=65536k" }`.
additionalProperties:
type: "string"
UTSMode:
type: "string"
description: "UTS namespace to use for the container."
UsernsMode:
type: "string"
description: "Sets the usernamespace mode for the container when usernamespace remapping option is enabled."
ShmSize:
type: "integer"
description: "Size of `/dev/shm` in bytes. If omitted, the system uses 64MB."
minimum: 0
Sysctls:
type: "object"
description: |
A list of kernel parameters (sysctls) to set in the container. For example: `{"net.ipv4.ip_forward": "1"}`
additionalProperties:
type: "string"
Runtime:
type: "string"
description: "Runtime to use with this container."
# Applicable to Windows
ConsoleSize:
type: "array"
description: "Initial console size, as an `[height, width]` array. (Windows only)"
minItems: 2
maxItems: 2
items:
type: "integer"
minimum: 0
Isolation:
type: "string"
description: "Isolation technology of the container. (Windows only)"
enum:
- "default"
- "process"
- "hyperv"
Config:
description: "Configuration for a container that is portable between hosts"
type: "object"
properties:
Hostname:
description: "The hostname to use for the container, as a valid RFC 1123 hostname."
type: "string"
Domainname:
description: "The domain name to use for the container."
type: "string"
User:
description: "The user that commands are run as inside the container."
type: "string"
AttachStdin:
description: "Whether to attach to `stdin`."
type: "boolean"
default: false
AttachStdout:
description: "Whether to attach to `stdout`."
type: "boolean"
default: true
AttachStderr:
description: "Whether to attach to `stderr`."
type: "boolean"
default: true
ExposedPorts:
description: |
An object mapping ports to an empty object in the form:
`{"<port>/<tcp|udp>": {}}`
type: "object"
additionalProperties:
type: "object"
enum:
- {}
default: {}
Tty:
description: "Attach standard streams to a TTY, including `stdin` if it is not closed."
type: "boolean"
default: false
OpenStdin:
description: "Open `stdin`"
type: "boolean"
default: false
StdinOnce:
description: "Close `stdin` after one attached client disconnects"
type: "boolean"
default: false
Env:
description: |
A list of environment variables to set inside the container in the form `["VAR=value", ...]`
type: "array"
items:
type: "string"
Cmd:
description: "Command to run specified as a string or an array of strings."
type:
- "array"
- "string"
items:
type: "string"
Healthcheck:
description: "A test to perform to check that the container is healthy."
type: "object"
properties:
Test:
description: |
The test to perform. Possible values are:
- `{}` inherit healthcheck from image or parent image
- `{"NONE"}` disable healthcheck
- `{"CMD", args...}` exec arguments directly
- `{"CMD-SHELL", command}` run command with system's default shell
type: "array"
items:
type: "string"
Interval:
description: "The time to wait between checks in nanoseconds. 0 means inherit."
type: "integer"
Timeout:
description: "The time to wait before considering the check to have hung. 0 means inherit."
type: "integer"
Retries:
description: "The number of consecutive failures needed to consider a container as unhealthy. 0 means inherit."
type: "integer"
ArgsEscaped:
description: "Command is already escaped (Windows only)"
type: "boolean"
Image:
description: "The name of the image to use when creating the container"
type: "string"
Volumes:
description: "An object mapping mount point paths inside the container to empty objects."
type: "object"
properties:
additionalProperties:
type: "object"
enum:
- {}
default: {}
WorkingDir:
description: "The working directory for commands to run in."
type: "string"
Entrypoint:
description: |
The entry point for the container as a string or an array of strings.
If the array consists of exactly one empty string (`[""]`) then the entry point is reset to system default (i.e., the entry point used by docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`).
type:
- "array"
- "string"
items:
type: "string"
NetworkDisabled:
description: "Disable networking for the container."
type: "boolean"
MacAddress:
description: "MAC address of the container."
type: "string"
OnBuild:
description: "`ONBUILD` metadata that were defined in the image's `Dockerfile`."
type: "array"
items:
type: "string"
Labels:
description: "User-defined key/value metadata."
type: "object"
additionalProperties:
type: "string"
StopSignal:
description: "Signal to stop a container as a string or unsigned integer."
type: "string"
default: "SIGTERM"
StopTimeout:
description: "Timeout to stop a container in seconds."
type: "integer"
default: 10
Shell:
description: "Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell."
type: "array"
items:
type: "string"
NetworkConfig:
description: "TODO: check is correct"
type: "object"
properties:
Bridge:
type: "string"
Gateway:
type: "string"
Address:
type: "string"
IPPrefixLen:
type: "integer"
MacAddress:
type: "string"
PortMapping:
type: "string"
Ports:
type: "array"
items:
$ref: "#/definitions/Port"
GraphDriver:
description: "Information about this container's graph driver."
type: "object"
properties:
Name:
type: "string"
Data:
type: "object"
additionalProperties:
type: "string"
Image:
type: "object"
properties:
Id:
type: "string"
RepoTags:
type: "array"
items:
type: "string"
RepoDigests:
type: "array"
items:
type: "string"
Parent:
type: "string"
Comment:
type: "string"
Created:
type: "string"
Container:
type: "string"
ContainerConfig:
$ref: "#/definitions/Config"
DockerVersion:
type: "string"
Author:
type: "string"
Config:
$ref: "#/definitions/Config"
Architecture:
type: "string"
Os:
type: "string"
Size:
type: "integer"
format: "int64"
VirtualSize:
type: "integer"
format: "int64"
GraphDriver:
$ref: "#/definitions/GraphDriver"
RootFS:
type: "object"
properties:
Type:
type: "string"
Layers:
type: "array"
items:
type: "string"
BaseLayer:
type: "string"
ImageSummary:
type: "object"
required:
- Id
- ParentId
- RepoTags
- RepoDigests
- Created
- Size
- SharedSize
- VirtualSize
- Labels
- Containers
properties:
Id:
type: "string"
x-nullable: false
ParentId:
type: "string"
x-nullable: false
RepoTags:
type: "array"
x-nullable: false
items:
type: "string"
RepoDigests:
type: "array"
x-nullable: false
items:
type: "string"
Created:
type: "integer"
x-nullable: false
Size:
type: "integer"
x-nullable: false
SharedSize:
type: "integer"
x-nullable: false
VirtualSize:
type: "integer"
x-nullable: false
Labels:
type: "object"
x-nullable: false
additionalProperties:
type: "string"
Containers:
x-nullable: false
type: "integer"
AuthConfig:
type: "object"
properties:
username:
type: "string"
password:
type: "string"
email:
type: "string"
serveraddress:
type: "string"
example:
username: "hannibal"
password: "xxxx"
serveraddress: "https://index.docker.io/v1/"
ProcessConfig:
type: "object"
properties:
privileged:
type: "boolean"
user:
type: "string"
tty:
type: "boolean"
entrypoint:
type: "string"
arguments:
type: "array"
items:
type: "string"
Volume:
type: "object"
required: [Name, Driver, Mountpoint, Labels, Scope, Options]
properties:
Name:
type: "string"
description: "Name of the volume."
x-nullable: false
Driver:
type: "string"
description: "Name of the volume driver used by the volume."
x-nullable: false
Mountpoint:
type: "string"
description: "Mount path of the volume on the host."
x-nullable: false
Status:
type: "object"
description: |
Low-level details about the volume, provided by the volume driver.
Details are returned as a map with key/value pairs:
`{"key":"value","key2":"value2"}`.
The `Status` field is optional, and is omitted if the volume driver
does not support this feature.
additionalProperties:
type: "object"
Labels:
type: "object"
description: "User-defined key/value metadata."
x-nullable: false
additionalProperties:
type: "string"
Scope:
type: "string"
description: "The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level."
default: "local"
x-nullable: false
enum: ["local", "global"]
Options:
type: "object"
description: "The driver specific options used when creating the volume."
additionalProperties:
type: "string"
UsageData:
type: "object"
required: [Size, RefCount]
properties:
Size:
type: "integer"
description: "The disk space used by the volume (local driver only)"
default: -1
x-nullable: false
RefCount:
type: "integer"
default: -1
description: "The number of containers referencing this volume."
x-nullable: false
example:
Name: "tardis"
Driver: "custom"
Mountpoint: "/var/lib/docker/volumes/tardis"
Status:
hello: "world"
Labels:
com.example.some-label: "some-value"
com.example.some-other-label: "some-other-value"
Scope: "local"
Network:
type: "object"
properties:
Name:
type: "string"
Id:
type: "string"
Created:
type: "string"
format: "dateTime"
Scope:
type: "string"
Driver:
type: "string"
EnableIPv6:
type: "boolean"
IPAM:
$ref: "#/definitions/IPAM"
Internal:
type: "boolean"
Containers:
type: "object"
additionalProperties:
$ref: "#/definitions/NetworkContainer"
Options:
type: "object"
additionalProperties:
type: "string"
Labels:
type: "object"
additionalProperties:
type: "string"
example:
Name: "net01"
Id: "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99"
Created: "2016-10-19T04:33:30.360899459Z"
Scope: "local"
Driver: "bridge"
EnableIPv6: false
IPAM:
Driver: "default"
Config:
- Subnet: "172.19.0.0/16"
Gateway: "172.19.0.1"
Options:
foo: "bar"
Internal: false
Containers:
19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c:
Name: "test"
EndpointID: "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a"
MacAddress: "02:42:ac:13:00:02"
IPv4Address: "172.19.0.2/16"
IPv6Address: ""
Options:
com.docker.network.bridge.default_bridge: "true"
com.docker.network.bridge.enable_icc: "true"
com.docker.network.bridge.enable_ip_masquerade: "true"
com.docker.network.bridge.host_binding_ipv4: "0.0.0.0"
com.docker.network.bridge.name: "docker0"
com.docker.network.driver.mtu: "1500"
Labels:
com.example.some-label: "some-value"
com.example.some-other-label: "some-other-value"
IPAM:
type: "object"
properties:
Driver:
description: "Name of the IPAM driver to use."
type: "string"
default: "default"
Config:
description: "List of IPAM configuration options, specified as a map: `{\"Subnet\": <CIDR>, \"IPRange\": <CIDR>, \"Gateway\": <IP address>, \"AuxAddress\": <device_name:IP address>}`"
type: "array"
items:
type: "object"
additionalProperties:
type: "string"
Options:
description: "Driver-specific options, specified as a map."
type: "array"
items:
type: "object"
additionalProperties:
type: "string"
NetworkContainer:
type: "object"
properties:
EndpointID:
type: "string"
MacAddress:
type: "string"
IPv4Address:
type: "string"
IPv6Address:
type: "string"
BuildInfo:
type: "object"
properties:
id:
type: "string"
stream:
type: "string"
error:
type: "string"
errorDetail:
$ref: "#/definitions/ErrorDetail"
status:
type: "string"
progress:
type: "string"
progressDetail:
$ref: "#/definitions/ProgressDetail"
CreateImageInfo:
type: "object"
properties:
error:
type: "string"
status:
type: "string"
progress:
type: "string"
progressDetail:
$ref: "#/definitions/ProgressDetail"
PushImageInfo:
type: "object"
properties:
error:
type: "string"
status:
type: "string"
progress:
type: "string"
progressDetail:
$ref: "#/definitions/ProgressDetail"
ErrorDetail:
type: "object"
properties:
code:
type: "integer"
message:
type: "string"
ProgressDetail:
type: "object"
properties:
code:
type: "integer"
message:
type: "integer"
ErrorResponse:
description: "Represents an error."
type: "object"
required: ["message"]
properties:
message:
description: "The error message."
type: "string"
x-nullable: false
example:
message: "Something went wrong."
IdResponse:
description: "Response to an API call that returns just an Id"
type: "object"
required: ["Id"]
properties:
Id:
description: "The id of the newly created object."
type: "string"
x-nullable: false
EndpointSettings:
description: "Configuration for a network endpoint."
type: "object"
properties:
IPAMConfig:
description: "IPAM configurations for the endpoint"
type: "object"
properties:
IPv4Address:
type: "string"
IPv6Address:
type: "string"
LinkLocalIPs:
type: "array"
items:
type: "string"
Links:
type: "array"
items:
type: "string"
Aliases:
type: "array"
items:
type: "string"
NetworkID:
type: "string"
EndpointID:
type: "string"
Gateway:
type: "string"
IPAddress:
type: "string"
IPPrefixLen:
type: "integer"
IPv6Gateway:
type: "string"
GlobalIPv6Address:
type: "string"
GlobalIPv6PrefixLen:
type: "integer"
format: "int64"
MacAddress:
type: "string"
PluginMount:
type: "object"
x-nullable: false
required: [Name, Description, Settable, Source, Destination, Type, Options]
properties:
Name:
type: "string"
x-nullable: false
Description:
type: "string"
x-nullable: false
Settable:
type: "array"
items:
type: "string"
Source:
type: "string"
Destination:
type: "string"
x-nullable: false
Type:
type: "string"
x-nullable: false
Options:
type: "array"
items:
type: "string"
PluginDevice:
type: "object"
required: [Name, Description, Settable, Path]
x-nullable: false
properties:
Name:
type: "string"
x-nullable: false
Description:
type: "string"
x-nullable: false
Settable:
type: "array"
items:
type: "string"
Path:
type: "string"
PluginEnv:
type: "object"
x-nullable: false
required: [Name, Description, Settable, Value]
properties:
Name:
x-nullable: false
type: "string"
Description:
x-nullable: false
type: "string"
Settable:
type: "array"
items:
type: "string"
Value:
type: "string"
PluginInterfaceType:
type: "object"
x-nullable: false
required: [Prefix, Capability, Version]
properties:
Prefix:
type: "string"
x-nullable: false
Capability:
type: "string"
x-nullable: false
Version:
type: "string"
x-nullable: false
Plugin:
description: "A plugin for the Engine API"
type: "object"
required: [Settings, Enabled, Config, Name]
properties:
Id:
type: "string"
Name:
type: "string"
x-nullable: false
Enabled:
description: "True when the plugin is running. False when the plugin is not running, only installed."
type: "boolean"
x-nullable: false
Settings:
description: "Settings that can be modified by users."
type: "object"
x-nullable: false
required: [Args, Devices, Env, Mounts]
properties:
Mounts:
type: "array"
items:
$ref: "#/definitions/PluginMount"
Env:
type: "array"
items:
type: "string"
Args:
type: "array"
items:
type: "string"
Devices:
type: "array"
items:
$ref: "#/definitions/PluginDevice"
PluginReference:
description: "plugin remote reference used to push/pull the plugin"
type: "string"
x-nullable: false
Config:
description: "The config of a plugin."
type: "object"
x-nullable: false
required:
- Description
- Documentation
- Interface
- Entrypoint
- WorkDir
- Network
- Linux
- PropagatedMount
- Mounts
- Env
- Args
properties:
Description:
type: "string"
x-nullable: false
Documentation:
type: "string"
x-nullable: false
Interface:
description: "The interface between Docker and the plugin"
x-nullable: false
type: "object"
required: [Types, Socket]
properties:
Types:
type: "array"
items:
$ref: "#/definitions/PluginInterfaceType"
Socket:
type: "string"
x-nullable: false
Entrypoint:
type: "array"
items:
type: "string"
WorkDir:
type: "string"
x-nullable: false
User:
type: "object"
x-nullable: false
properties:
UID:
type: "integer"
format: "uint32"
GID:
type: "integer"
format: "uint32"
Network:
type: "object"
x-nullable: false
required: [Type]
properties:
Type:
x-nullable: false
type: "string"
Linux:
type: "object"
x-nullable: false
required: [Capabilities, AllowAllDevices, Devices]
properties:
Capabilities:
type: "array"
items:
type: "string"
AllowAllDevices:
type: "boolean"
x-nullable: false
Devices:
type: "array"
items:
$ref: "#/definitions/PluginDevice"
PropagatedMount:
type: "string"
x-nullable: false
Mounts:
type: "array"
items:
$ref: "#/definitions/PluginMount"
Env:
type: "array"
items:
$ref: "#/definitions/PluginEnv"
Args:
type: "object"
x-nullable: false
required: [Name, Description, Settable, Value]
properties:
Name:
x-nullable: false
type: "string"
Description:
x-nullable: false
type: "string"
Settable:
type: "array"
items:
type: "string"
Value:
type: "array"
items:
type: "string"
rootfs:
type: "object"
properties:
type:
type: "string"
diff_ids:
type: "array"
items:
type: "string"
example:
Id: "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078"
Name: "tiborvass/sample-volume-plugin"
Tag: "latest"
Active: true
Settings:
Env:
- "DEBUG=0"
Args: null
Devices: null
Config:
Description: "A sample volume plugin for Docker"
Documentation: "https://docs.docker.com/engine/extend/plugins/"
Interface:
Types:
- "docker.volumedriver/1.0"
Socket: "plugins.sock"
Entrypoint:
- "/usr/bin/sample-volume-plugin"
- "/data"
WorkDir: ""
User: {}
Network:
Type: ""
Linux:
Capabilities: null
AllowAllDevices: false
Devices: null
Mounts: null
PropagatedMount: "/data"
Env:
- Name: "DEBUG"
Description: "If set, prints debug messages"
Settable: null
Value: "0"
Args:
Name: "args"
Description: "command line arguments"
Settable: null
Value: []
NodeSpec:
type: "object"
properties:
Name:
description: "Name for the node."
type: "string"
Labels:
description: "User-defined key/value metadata."
type: "object"
additionalProperties:
type: "string"
Role:
description: "Role of the node."
type: "string"
enum:
- "worker"
- "manager"
Availability:
description: "Availability of the node."
type: "string"
enum:
- "active"
- "pause"
- "drain"
example:
Availability: "active"
Name: "node-name"
Role: "manager"
Labels:
foo: "bar"
Node:
type: "object"
properties:
ID:
type: "string"
Version:
type: "object"
properties:
Index:
type: "integer"
format: "int64"
CreatedAt:
type: "string"
format: "dateTime"
UpdatedAt:
type: "string"
format: "dateTime"
Spec:
$ref: "#/definitions/NodeSpec"
Description:
type: "object"
properties:
Hostname:
type: "string"
Platform:
type: "object"
properties:
Architecture:
type: "string"
OS:
type: "string"
Resources:
type: "object"
properties:
NanoCPUs:
type: "integer"
format: "int64"
MemoryBytes:
type: "integer"
format: "int64"
Engine:
type: "object"
properties:
EngineVersion:
type: "string"
Labels:
type: "object"
additionalProperties:
type: "string"
Plugins:
type: "array"
items:
type: "object"
properties:
Type:
type: "string"
Name:
type: "string"
example:
ID: "24ifsmvkjbyhk"
Version:
Index: 8
CreatedAt: "2016-06-07T20:31:11.853781916Z"
UpdatedAt: "2016-06-07T20:31:11.999868824Z"
Spec:
Name: "my-node"
Role: "manager"
Availability: "active"
Labels:
foo: "bar"
Description:
Hostname: "bf3067039e47"
Platform:
Architecture: "x86_64"
OS: "linux"
Resources:
NanoCPUs: 4000000000
MemoryBytes: 8272408576
Engine:
EngineVersion: "1.13.0"
Labels:
foo: "bar"
Plugins:
- Type: "Volume"
Name: "local"
- Type: "Network"
Name: "bridge"
- Type: "Network"
Name: "null"
- Type: "Network"
Name: "overlay"
Status:
State: "ready"
Addr: "172.17.0.2"
ManagerStatus:
Leader: true
Reachability: "reachable"
Addr: "172.17.0.2:2377"
SwarmSpec:
description: "User modifiable swarm configuration."
type: "object"
properties:
Name:
description: "Name of the swarm."
type: "string"
Labels:
description: "User-defined key/value metadata."
type: "object"
additionalProperties:
type: "string"
Orchestration:
description: "Orchestration configuration."
type: "object"
properties:
TaskHistoryRetentionLimit:
description: "The number of historic tasks to keep per instance or node. If negative, never remove completed or failed tasks."
type: "integer"
format: "int64"
Raft:
description: "Raft configuration."
type: "object"
properties:
SnapshotInterval:
description: "The number of log entries between snapshots."
type: "integer"
format: "int64"
KeepOldSnapshots:
description: "The number of snapshots to keep beyond the current snapshot."
type: "integer"
format: "int64"
LogEntriesForSlowFollowers:
description: "The number of log entries to keep around to sync up slow followers after a snapshot is created."
type: "integer"
format: "int64"
ElectionTick:
description: |
The number of ticks that a follower will wait for a message from the leader before becoming a candidate and starting an election. `ElectionTick` must be greater than `HeartbeatTick`.
A tick currently defaults to one second, so these translate directly to seconds currently, but this is NOT guaranteed.
type: "integer"
HeartbeatTick:
description: |
The number of ticks between heartbeats. Every HeartbeatTick ticks, the leader will send a heartbeat to the followers.
A tick currently defaults to one second, so these translate directly to seconds currently, but this is NOT guaranteed.
type: "integer"
Dispatcher:
description: "Dispatcher configuration."
type: "object"
properties:
HeartbeatPeriod:
description: "The delay for an agent to send a heartbeat to the dispatcher."
type: "integer"
format: "int64"
CAConfig:
description: "CA configuration."
type: "object"
properties:
NodeCertExpiry:
description: "The duration node certificates are issued for."
type: "integer"
format: "int64"
ExternalCAs:
description: "Configuration for forwarding signing requests to an external certificate authority."
type: "array"
items:
type: "object"
properties:
Protocol:
description: "Protocol for communication with the external CA (currently only `cfssl` is supported)."
type: "string"
enum:
- "cfssl"
default: "cfssl"
URL:
description: "URL where certificate signing requests should be sent."
type: "string"
Options:
description: "An object with key/value pairs that are interpreted as protocol-specific options for the external CA driver."
type: "object"
additionalProperties:
type: "string"
EncryptionConfig:
description: "Parameters related to encryption-at-rest."
type: "object"
properties:
AutoLockManagers:
description: "If set, generate a key and use it to lock data stored on the managers."
type: "boolean"
TaskDefaults:
description: "Defaults for creating tasks in this cluster."
type: "object"
properties:
LogDriver:
description: |
The log driver to use for tasks created in the orchestrator if unspecified by a service.
Updating this value will only have an affect on new tasks. Old tasks will continue use their previously configured log driver until recreated.
type: "object"
properties:
Name:
type: "string"
Options:
type: "object"
additionalProperties:
type: "string"
example:
Name: "default"
Orchestration:
TaskHistoryRetentionLimit: 10
Raft:
SnapshotInterval: 10000
LogEntriesForSlowFollowers: 500
HeartbeatTick: 1
ElectionTick: 3
Dispatcher:
HeartbeatPeriod: 5000000000
CAConfig:
NodeCertExpiry: 7776000000000000
JoinTokens:
Worker: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx"
Manager: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2"
EncryptionConfig:
AutoLockManagers: false
# The Swarm information for `GET /info`. It is the same as `GET /swarm`, but
# without `JoinTokens`.
ClusterInfo:
type: "object"
properties:
ID:
description: "The ID of the swarm."
type: "string"
Version:
type: "object"
properties:
Index:
type: "integer"
format: "int64"
CreatedAt:
type: "string"
format: "dateTime"
UpdatedAt:
type: "string"
format: "dateTime"
Spec:
$ref: "#/definitions/SwarmSpec"
TaskSpec:
description: "User modifiable task configuration."
type: "object"
properties:
ContainerSpec:
type: "object"
properties:
Image:
description: "The image name to use for the container."
type: "string"
Command:
description: "The command to be run in the image."
type: "array"
items:
type: "string"
Args:
description: "Arguments to the command."
type: "array"
items:
type: "string"
Env:
description: "A list of environment variables in the form `VAR=value`."
type: "array"
items:
type: "string"
Dir:
description: "The working directory for commands to run in."
type: "string"
User:
description: "The user inside the container."
type: "string"
Labels:
description: "User-defined key/value data."
type: "object"
additionalProperties:
type: "string"
TTY:
description: "Whether a pseudo-TTY should be allocated."
type: "boolean"
Mounts:
description: "Specification for mounts to be added to containers created as part of the service."
type: "array"
items:
$ref: "#/definitions/Mount"
StopGracePeriod:
description: "Amount of time to wait for the container to terminate before forcefully killing it."
type: "integer"
format: "int64"
DNSConfig:
description: "Specification for DNS related configurations in resolver configuration file (`resolv.conf`)."
type: "object"
properties:
Nameservers:
description: "The IP addresses of the name servers."
type: "array"
items:
type: "string"
Search:
description: "A search list for host-name lookup."
type: "array"
items:
type: "string"
Options:
description: "A list of internal resolver variables to be modified (e.g., `debug`, `ndots:3`, etc.)."
type: "array"
items:
type: "string"
Resources:
description: "Resource requirements which apply to each individual container created as part of the service."
type: "object"
properties:
Limits:
description: "Define resources limits."
type: "object"
properties:
NanoCPUs:
description: "CPU limit in units of 10<sup>-9</sup> CPU shares."
type: "integer"
format: "int64"
MemoryBytes:
description: "Memory limit in Bytes."
type: "integer"
format: "int64"
Reservation:
description: "Define resources reservation."
properties:
NanoCPUs:
description: "CPU reservation in units of 10<sup>-9</sup> CPU shares."
type: "integer"
format: "int64"
MemoryBytes:
description: "Memory reservation in Bytes."
type: "integer"
format: "int64"
RestartPolicy:
description: "Specification for the restart policy which applies to containers created as part of this service."
type: "object"
properties:
Condition:
description: "Condition for restart."
type: "string"
enum:
- "none"
- "on-failure"
- "any"
Delay:
description: "Delay between restart attempts."
type: "integer"
format: "int64"
MaxAttempts:
description: "Maximum attempts to restart a given container before giving up (default value is 0, which is ignored)."
type: "integer"
format: "int64"
default: 0
Window:
description: "Windows is the time window used to evaluate the restart policy (default value is 0, which is unbounded)."
type: "integer"
format: "int64"
default: 0
Placement:
type: "object"
properties:
Constraints:
description: "An array of constraints."
type: "array"
items:
type: "string"
ForceUpdate:
description: "A counter that triggers an update even if no relevant parameters have been changed."
type: "integer"
Networks:
type: "array"
items:
type: "object"
properties:
Target:
type: "string"
Aliases:
type: "array"
items:
type: "string"
LogDriver:
description: "Specifies the log driver to use for tasks created from this spec. If not present, the default one for the swarm will be used, finally falling back to the engine default if not specified."
type: "object"
properties:
Name:
type: "string"
Options:
type: "object"
additionalProperties:
type: "string"
TaskState:
type: "string"
enum:
- "new"
- "allocated"
- "pending"
- "assigned"
- "accepted"
- "preparing"
- "ready"
- "starting"
- "running"
- "complete"
- "shutdown"
- "failed"
- "rejected"
Task:
type: "object"
properties:
ID:
description: "The ID of the task."
type: "string"
Version:
type: "object"
properties:
Index:
type: "integer"
format: "int64"
CreatedAt:
type: "string"
format: "dateTime"
UpdatedAt:
type: "string"
format: "dateTime"
Name:
description: "Name of the task."
type: "string"
Labels:
description: "User-defined key/value metadata."
type: "object"
additionalProperties:
type: "string"
Spec:
$ref: "#/definitions/TaskSpec"
ServiceID:
description: "The ID of the service this task is part of."
type: "string"
Slot:
type: "integer"
NodeID:
description: "The ID of the node that this task is on."
type: "string"
Status:
type: "object"
properties:
Timestamp:
type: "string"
format: "dateTime"
State:
$ref: "#/definitions/TaskState"
Message:
type: "string"
Err:
type: "string"
ContainerStatus:
type: "object"
properties:
ContainerID:
type: "string"
PID:
type: "integer"
ExitCode:
type: "integer"
DesiredState:
$ref: "#/definitions/TaskState"
example:
ID: "0kzzo1i0y4jz6027t0k7aezc7"
Version:
Index: 71
CreatedAt: "2016-06-07T21:07:31.171892745Z"
UpdatedAt: "2016-06-07T21:07:31.376370513Z"
Spec:
ContainerSpec:
Image: "redis"
Resources:
Limits: {}
Reservations: {}
RestartPolicy:
Condition: "any"
MaxAttempts: 0
Placement: {}
ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz"
Slot: 1
NodeID: "60gvrl6tm78dmak4yl7srz94v"
Status:
Timestamp: "2016-06-07T21:07:31.290032978Z"
State: "running"
Message: "started"
ContainerStatus:
ContainerID: "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035"
PID: 677
DesiredState: "running"
NetworksAttachments:
- Network:
ID: "4qvuz4ko70xaltuqbt8956gd1"
Version:
Index: 18
CreatedAt: "2016-06-07T20:31:11.912919752Z"
UpdatedAt: "2016-06-07T21:07:29.955277358Z"
Spec:
Name: "ingress"
Labels:
com.docker.swarm.internal: "true"
DriverConfiguration: {}
IPAMOptions:
Driver: {}
Configs:
- Subnet: "10.255.0.0/16"
Gateway: "10.255.0.1"
DriverState:
Name: "overlay"
Options:
com.docker.network.driver.overlay.vxlanid_list: "256"
IPAMOptions:
Driver:
Name: "default"
Configs:
- Subnet: "10.255.0.0/16"
Gateway: "10.255.0.1"
Addresses:
- "10.255.0.10/16"
ServiceSpec:
description: "User modifiable configuration for a service."
properties:
Name:
description: "Name of the service."
type: "string"
Labels:
description: "User-defined key/value metadata."
type: "object"
additionalProperties:
type: "string"
TaskTemplate:
$ref: "#/definitions/TaskSpec"
Mode:
description: "Scheduling mode for the service."
type: "object"
properties:
Replicated:
type: "object"
properties:
Replicas:
type: "integer"
format: "int64"
Global:
type: "object"
UpdateConfig:
description: "Specification for the update strategy of the service."
type: "object"
properties:
Parallelism:
description: "Maximum number of tasks to be updated in one iteration (0 means unlimited parallelism)."
type: "integer"
format: "int64"
Delay:
description: "Amount of time between updates, in nanoseconds."
type: "integer"
format: "int64"
FailureAction:
description: "Action to take if an updated task fails to run, or stops running during the update."
type: "string"
enum:
- "continue"
- "pause"
Monitor:
description: "Amount of time to monitor each updated task for failures, in nanoseconds."
type: "integer"
format: "int64"
MaxFailureRatio:
description: "The fraction of tasks that may fail during an update before the failure action is invoked, specified as a floating point number between 0 and 1."
type: "number"
default: 0
Networks:
description: "Array of network names or IDs to attach the service to."
type: "array"
items:
type: "object"
properties:
Target:
type: "string"
Aliases:
type: "array"
items:
type: "string"
EndpointSpec:
$ref: "#/definitions/EndpointSpec"
EndpointPortConfig:
type: "object"
properties:
Name:
type: "string"
Protocol:
type: "string"
enum:
- "tcp"
- "udp"
TargetPort:
description: "The port inside the container."
type: "integer"
PublishedPort:
description: "The port on the swarm hosts."
type: "integer"
EndpointSpec:
description: "Properties that can be configured to access and load balance a service."
type: "object"
properties:
Mode:
description: "The mode of resolution to use for internal load balancing
between tasks."
type: "string"
enum:
- "vip"
- "dnsrr"
default: "vip"
Ports:
description: "List of exposed ports that this service is accessible on from the outside. Ports can only be provided if `vip` resolution mode is used."
type: "array"
items:
$ref: "#/definitions/EndpointPortConfig"
Service:
type: "object"
properties:
ID:
type: "string"
Version:
type: "object"
properties:
Index:
type: "integer"
format: "int64"
CreatedAt:
type: "string"
format: "dateTime"
UpdatedAt:
type: "string"
format: "dateTime"
Spec:
$ref: "#/definitions/ServiceSpec"
Endpoint:
type: "object"
properties:
Spec:
$ref: "#/definitions/EndpointSpec"
Ports:
type: "array"
items:
$ref: "#/definitions/EndpointPortConfig"
VirtualIPs:
type: "array"
items:
type: "object"
properties:
NetworkID:
type: "string"
Addr:
type: "string"
UpdateStatus:
description: "The status of a service update."
type: "object"
properties:
State:
type: "string"
enum:
- "updating"
- "paused"
- "completed"
StartedAt:
type: "string"
format: "dateTime"
CompletedAt:
type: "string"
format: "dateTime"
Message:
type: "string"
example:
ID: "9mnpnzenvg8p8tdbtq4wvbkcz"
Version:
Index: 19
CreatedAt: "2016-06-07T21:05:51.880065305Z"
UpdatedAt: "2016-06-07T21:07:29.962229872Z"
Spec:
Name: "hopeful_cori"
TaskTemplate:
ContainerSpec:
Image: "redis"
Resources:
Limits: {}
Reservations: {}
RestartPolicy:
Condition: "any"
MaxAttempts: 0
Placement: {}
ForceUpdate: 0
Mode:
Replicated:
Replicas: 1
UpdateConfig:
Parallelism: 1
FailureAction: "pause"
Monitor: 15000000000
MaxFailureRatio: 0.15
EndpointSpec:
Mode: "vip"
Ports:
-
Protocol: "tcp"
TargetPort: 6379
PublishedPort: 30001
Endpoint:
Spec:
Mode: "vip"
Ports:
-
Protocol: "tcp"
TargetPort: 6379
PublishedPort: 30001
Ports:
-
Protocol: "tcp"
TargetPort: 6379
PublishedPort: 30001
VirtualIPs:
-
NetworkID: "4qvuz4ko70xaltuqbt8956gd1"
Addr: "10.255.0.2/16"
-
NetworkID: "4qvuz4ko70xaltuqbt8956gd1"
Addr: "10.255.0.3/16"
ImageDeleteResponse:
type: "object"
properties:
Untagged:
description: "The image ID of an image that was untagged"
type: "string"
Deleted:
description: "The image ID of an image that was deleted"
type: "string"
ServiceUpdateResponse:
type: "object"
properties:
Warnings:
description: "Optional warning messages"
type: "array"
items:
type: "string"
example:
Warning: "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found"
ContainerSummary:
type: "array"
items:
type: "object"
properties:
Id:
description: "The ID of this container"
type: "string"
x-go-name: "ID"
Names:
description: "The names that this container has been given"
type: "array"
items:
type: "string"
Image:
description: "The name of the image used when creating this container"
type: "string"
ImageID:
description: "The ID of the image that this container was created from"
type: "string"
Command:
description: "Command to run when starting the container"
type: "string"
Created:
description: "When the container was created"
type: "integer"
format: "int64"
Ports:
description: "The ports exposed by this container"
type: "array"
items:
$ref: "#/definitions/Port"
SizeRw:
description: "The size of files that have been created or changed by this container"
type: "integer"
format: "int64"
SizeRootFs:
description: "The total size of all the files in this container"
type: "integer"
format: "int64"
Labels:
description: "User-defined key/value metadata."
type: "object"
additionalProperties:
type: "string"
State:
description: "The state of this container (e.g. `Exited`)"
type: "string"
Status:
description: "Additional human-readable status of this container (e.g. `Exit 0`)"
type: "string"
HostConfig:
type: "object"
properties:
NetworkMode:
type: "string"
NetworkSettings:
description: "A summary of the container's network settings"
type: "object"
properties:
Networks:
type: "object"
additionalProperties:
$ref: "#/definitions/EndpointSettings"
Mounts:
type: "array"
items:
$ref: "#/definitions/Mount"
SecretSpec:
type: "object"
properties:
Name:
description: "User-defined name of the secret."
type: "string"
Labels:
description: "User-defined key/value metadata."
type: "object"
additionalProperties:
type: "string"
Data:
description: "Base64-url-safe-encoded secret data"
type: "array"
items:
type: "string"
Secret:
type: "object"
properties:
ID:
type: "string"
Version:
type: "object"
properties:
Index:
type: "integer"
format: "int64"
CreatedAt:
type: "string"
format: "dateTime"
UpdatedAt:
type: "string"
format: "dateTime"
Spec:
$ref: "#/definitions/ServiceSpec"
paths:
/containers/json:
get:
summary: "List containers"
operationId: "ContainerList"
produces:
- "application/json"
parameters:
- name: "all"
in: "query"
description: "Return all containers. By default, only running containers are shown"
type: "boolean"
default: false
- name: "limit"
in: "query"
description: "Return this number of most recently created containers, including non-running ones."
type: "integer"
- name: "size"
in: "query"
description: "Return the size of container as fields `SizeRw` and `SizeRootFs`."
type: "boolean"
default: false
- name: "filters"
in: "query"
description: |
Filters to process on the container list, encoded as JSON (a `map[string][]string`). For example, `{"status": ["paused"]}` will only return paused containers.
Available filters:
- `exited=<int>` containers with exit code of `<int>`
- `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`)
- `label=key` or `label="key=value"` of a container label
- `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only)
- `id=<ID>` a container's ID
- `name=<name>` a container's name
- `is-task=`(`true`|`false`)
- `ancestor`=(`<image-name>[:<tag>]`, `<image id>`, or `<image@digest>`)
- `before`=(`<container id>` or `<container name>`)
- `since`=(`<container id>` or `<container name>`)
- `volume`=(`<volume name>` or `<mount point destination>`)
- `network`=(`<network id>` or `<network name>`)
- `health`=(`starting`|`healthy`|`unhealthy`|`none`)
type: "string"
responses:
200:
description: "no error"
schema:
$ref: "#/definitions/ContainerSummary"
examples:
application/json:
- Id: "8dfafdbc3a40"
Names:
- "/boring_feynman"
Image: "ubuntu:latest"
ImageID: "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82"
Command: "echo 1"
Created: 1367854155
State: "Exited"
Status: "Exit 0"
Ports:
- PrivatePort: 2222
PublicPort: 3333
Type: "tcp"
Labels:
com.example.vendor: "Acme"
com.example.license: "GPL"
com.example.version: "1.0"
SizeRw: 12288
SizeRootFs: 0
HostConfig:
NetworkMode: "default"
NetworkSettings:
Networks:
bridge:
NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812"
EndpointID: "2cdc4edb1ded3631c81f57966563e5c8525b81121bb3706a9a9a3ae102711f3f"
Gateway: "172.17.0.1"
IPAddress: "172.17.0.2"
IPPrefixLen: 16
IPv6Gateway: ""
GlobalIPv6Address: ""
GlobalIPv6PrefixLen: 0
MacAddress: "02:42:ac:11:00:02"
Mounts:
- Name: "fac362...80535"
Source: "/data"
Destination: "/data"
Driver: "local"
Mode: "ro,Z"
RW: false
Propagation: ""
- Id: "9cd87474be90"
Names:
- "/coolName"
Image: "ubuntu:latest"
ImageID: "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82"
Command: "echo 222222"
Created: 1367854155
State: "Exited"
Status: "Exit 0"
Ports: []
Labels: {}
SizeRw: 12288
SizeRootFs: 0
HostConfig:
NetworkMode: "default"
NetworkSettings:
Networks:
bridge:
NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812"
EndpointID: "88eaed7b37b38c2a3f0c4bc796494fdf51b270c2d22656412a2ca5d559a64d7a"
Gateway: "172.17.0.1"
IPAddress: "172.17.0.8"
IPPrefixLen: 16
IPv6Gateway: ""
GlobalIPv6Address: ""
GlobalIPv6PrefixLen: 0
MacAddress: "02:42:ac:11:00:08"
Mounts: []
- Id: "3176a2479c92"
Names:
- "/sleepy_dog"
Image: "ubuntu:latest"
ImageID: "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82"
Command: "echo 3333333333333333"
Created: 1367854154
State: "Exited"
Status: "Exit 0"
Ports: []
Labels: {}
SizeRw: 12288
SizeRootFs: 0
HostConfig:
NetworkMode: "default"
NetworkSettings:
Networks:
bridge:
NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812"
EndpointID: "8b27c041c30326d59cd6e6f510d4f8d1d570a228466f956edf7815508f78e30d"
Gateway: "172.17.0.1"
IPAddress: "172.17.0.6"
IPPrefixLen: 16
IPv6Gateway: ""
GlobalIPv6Address: ""
GlobalIPv6PrefixLen: 0
MacAddress: "02:42:ac:11:00:06"
Mounts: []
- Id: "4cb07b47f9fb"
Names:
- "/running_cat"
Image: "ubuntu:latest"
ImageID: "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82"
Command: "echo 444444444444444444444444444444444"
Created: 1367854152
State: "Exited"
Status: "Exit 0"
Ports: []
Labels: {}
SizeRw: 12288
SizeRootFs: 0
HostConfig:
NetworkMode: "default"
NetworkSettings:
Networks:
bridge:
NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812"
EndpointID: "d91c7b2f0644403d7ef3095985ea0e2370325cd2332ff3a3225c4247328e66e9"
Gateway: "172.17.0.1"
IPAddress: "172.17.0.5"
IPPrefixLen: 16
IPv6Gateway: ""
GlobalIPv6Address: ""
GlobalIPv6PrefixLen: 0
MacAddress: "02:42:ac:11:00:05"
Mounts: []
400:
description: "bad parameter"
schema:
$ref: "#/definitions/ErrorResponse"
500:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
tags: ["Container"]
/containers/create:
post:
summary: "Create a container"
operationId: "ContainerCreate"
consumes:
- "application/json"
- "application/octet-stream"
produces:
- "application/json"
parameters:
- name: "name"
in: "query"
description: "Assign the specified name to the container. Must match `/?[a-zA-Z0-9_-]+`."
type: "string"
pattern: "/?[a-zA-Z0-9_-]+"
- name: "body"
in: "body"
description: "Container to create"
schema:
allOf:
- $ref: "#/definitions/Config"
- type: "object"
properties:
HostConfig:
$ref: "#/definitions/HostConfig"
NetworkingConfig:
description: "This container's networking configuration."
type: "object"
properties:
EndpointsConfig:
description: "A mapping of network name to endpoint configuration for that network."
type: "object"
additionalProperties:
$ref: "#/definitions/EndpointSettings"
example:
Hostname: ""
Domainname: ""
User: ""
AttachStdin: false
AttachStdout: true
AttachStderr: true
Tty: false
OpenStdin: false
StdinOnce: false
Env:
- "FOO=bar"
- "BAZ=quux"
Cmd:
- "date"
Entrypoint: ""
Image: "ubuntu"
Labels:
com.example.vendor: "Acme"
com.example.license: "GPL"
com.example.version: "1.0"
Volumes:
/volumes/data: {}
WorkingDir: ""
NetworkDisabled: false
MacAddress: "12:34:56:78:9a:bc"
ExposedPorts:
22/tcp: {}
StopSignal: "SIGTERM"
StopTimeout: 10
HostConfig:
Binds:
- "/tmp:/tmp"
Links:
- "redis3:redis"
Memory: 0
MemorySwap: 0
MemoryReservation: 0
KernelMemory: 0
NanoCPUs: 500000
CpuPercent: 80
CpuShares: 512
CpuPeriod: 100000
CpuRealtimePeriod: 1000000
CpuRealtimeRuntime: 10000
CpuQuota: 50000
CpusetCpus: "0,1"
CpusetMems: "0,1"
MaximumIOps: 0
MaximumIOBps: 0
BlkioWeight: 300
BlkioWeightDevice:
- {}
BlkioDeviceReadBps:
- {}
BlkioDeviceReadIOps:
- {}
BlkioDeviceWriteBps:
- {}
BlkioDeviceWriteIOps:
- {}
MemorySwappiness: 60
OomKillDisable: false
OomScoreAdj: 500
PidMode: ""
PidsLimit: -1
PortBindings:
22/tcp:
- HostPort: "11022"
PublishAllPorts: false
Privileged: false
ReadonlyRootfs: false
Dns:
- "8.8.8.8"
DnsOptions:
- ""
DnsSearch:
- ""
VolumesFrom:
- "parent"
- "other:ro"
CapAdd:
- "NET_ADMIN"
CapDrop:
- "MKNOD"
GroupAdd:
- "newgroup"
RestartPolicy:
Name: ""
MaximumRetryCount: 0
AutoRemove: true
NetworkMode: "bridge"
Devices: []
Ulimits:
- {}
LogConfig:
Type: "json-file"
Config: {}
SecurityOpt: []
StorageOpt: {}
CgroupParent: ""
VolumeDriver: ""
ShmSize: 67108864
NetworkingConfig:
EndpointsConfig:
isolated_nw:
IPAMConfig:
IPv4Address: "172.20.30.33"
IPv6Address: "2001:db8:abcd::3033"
LinkLocalIPs:
- "169.254.34.68"
- "fe80::3468"
Links:
- "container_1"
- "container_2"
Aliases:
- "server_x"
- "server_y"
required: true
responses:
201:
description: "Container created successfully"
schema:
type: "object"
required: [Id, Warnings]
properties:
Id:
description: "The ID of the created container"
type: "string"
x-nullable: false
Warnings:
description: "Warnings encountered when creating the container"
type: "array"
x-nullable: false
items:
type: "string"
examples:
application/json:
Id: "e90e34656806"
Warnings: []
400:
description: "bad parameter"
schema:
$ref: "#/definitions/ErrorResponse"
404:
description: "no such container"
schema:
$ref: "#/definitions/ErrorResponse"
examples:
application/json:
message: "No such container: c2ada9df5af8"
406:
description: "impossible to attach"
schema:
$ref: "#/definitions/ErrorResponse"
409:
description: "conflict"
schema:
$ref: "#/definitions/ErrorResponse"
500:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
tags: ["Container"]
/containers/{id}/json:
get:
summary: "Inspect a container"
description: "Return low-level information about a container."
operationId: "ContainerInspect"
produces:
- "application/json"
responses:
200:
description: "no error"
schema:
type: "object"
properties:
Id:
description: "The ID of the container"
type: "string"
Created:
description: "The time the container was created"
type: "string"
Path:
description: "The path to the command being run"
type: "string"
Args:
description: "The arguments to the command being run"
type: "array"
items:
type: "string"
State:
description: "The state of the container."
type: "object"
properties:
Status:
description: "The status of the container. For example, `running` or `exited`."
type: "string"
Running:
description: "Whether this container is running."
type: "boolean"
Paused:
description: "Whether this container is paused."
type: "boolean"
Restarting:
description: "Whether this container is restarting."
type: "boolean"
OOMKilled:
description: "Whether this container has been killed because it ran out of memory."
type: "boolean"
Dead:
type: "boolean"
Pid:
description: "The process ID of this container"
type: "integer"
ExitCode:
description: "The last exit code of this container"
type: "integer"
Error:
type: "string"
StartedAt:
description: "The time when this container was last started."
type: "string"
FinishedAt:
description: "The time when this container last exited."
type: "string"
Image:
description: "The container's image"
type: "string"
ResolvConfPath:
type: "string"
HostnamePath:
type: "string"
HostsPath:
type: "string"
LogPath:
type: "string"
Node:
description: "TODO"
type: "object"
Name:
type: "string"
RestartCount:
type: "integer"
Driver:
type: "string"
MountLabel:
type: "string"
ProcessLabel:
type: "string"
AppArmorProfile:
type: "string"
ExecIDs:
type: "string"
HostConfig:
$ref: "#/definitions/HostConfig"
GraphDriver:
$ref: "#/definitions/GraphDriver"
SizeRw:
description: "The size of files that have been created or changed by this container."
type: "integer"
format: "int64"
SizeRootFs:
description: "The total size of all the files in this container."
type: "integer"
format: "int64"
Mounts:
type: "array"
items:
$ref: "#/definitions/MountPoint"
Config:
$ref: "#/definitions/Config"
NetworkSettings:
$ref: "#/definitions/NetworkConfig"
examples:
application/json:
AppArmorProfile: ""
Args:
- "-c"
- "exit 9"
Config:
AttachStderr: true
AttachStdin: false
AttachStdout: true
Cmd:
- "/bin/sh"
- "-c"
- "exit 9"
Domainname: ""
Env:
- "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Hostname: "ba033ac44011"
Image: "ubuntu"
Labels:
com.example.vendor: "Acme"
com.example.license: "GPL"
com.example.version: "1.0"
MacAddress: ""
NetworkDisabled: false
OpenStdin: false
StdinOnce: false
Tty: false
User: ""
Volumes:
/volumes/data: {}
WorkingDir: ""
StopSignal: "SIGTERM"
StopTimeout: 10
Created: "2015-01-06T15:47:31.485331387Z"
Driver: "devicemapper"
HostConfig:
MaximumIOps: 0
MaximumIOBps: 0
BlkioWeight: 0
BlkioWeightDevice:
- {}
BlkioDeviceReadBps:
- {}
BlkioDeviceWriteBps:
- {}
BlkioDeviceReadIOps:
- {}
BlkioDeviceWriteIOps:
- {}
ContainerIDFile: ""
CpusetCpus: ""
CpusetMems: ""
CpuPercent: 80
CpuShares: 0
CpuPeriod: 100000
CpuRealtimePeriod: 1000000
CpuRealtimeRuntime: 10000
Devices: []
IpcMode: ""
LxcConf: []
Memory: 0
MemorySwap: 0
MemoryReservation: 0
KernelMemory: 0
OomKillDisable: false
OomScoreAdj: 500
NetworkMode: "bridge"
PidMode: ""
PortBindings: {}
Privileged: false
ReadonlyRootfs: false
PublishAllPorts: false
RestartPolicy:
MaximumRetryCount: 2
Name: "on-failure"
LogConfig:
Type: "json-file"
Sysctls:
net.ipv4.ip_forward: "1"
Ulimits:
- {}
VolumeDriver: ""
ShmSize: 67108864
HostnamePath: "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname"
HostsPath: "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts"
LogPath: "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log"
Id: "ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39"
Image: "04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2"
MountLabel: ""
Name: "/boring_euclid"
NetworkSettings:
Bridge: ""
SandboxID: ""
HairpinMode: false
LinkLocalIPv6Address: ""
LinkLocalIPv6PrefixLen: 0
SandboxKey: ""
SecondaryIPAddresses: null
SecondaryIPv6Addresses: null
EndpointID: ""
Gateway: ""
GlobalIPv6Address: ""
GlobalIPv6PrefixLen: 0
IPAddress: ""
IPPrefixLen: 0
IPv6Gateway: ""
MacAddress: ""
Networks:
bridge:
NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812"
EndpointID: "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d"
Gateway: "172.17.0.1"
IPAddress: "172.17.0.2"
IPPrefixLen: 16
IPv6Gateway: ""
GlobalIPv6Address: ""
GlobalIPv6PrefixLen: 0
MacAddress: "02:42:ac:12:00:02"
Path: "/bin/sh"
ProcessLabel: ""
ResolvConfPath: "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf"
RestartCount: 1
State:
Error: ""
ExitCode: 9
FinishedAt: "2015-01-06T15:47:32.080254511Z"
OOMKilled: false
Dead: false
Paused: false
Pid: 0
Restarting: false
Running: true
StartedAt: "2015-01-06T15:47:32.072697474Z"
Status: "running"
Mounts:
- Name: "fac362...80535"
Source: "/data"
Destination: "/data"
Driver: "local"
Mode: "ro,Z"
RW: false
Propagation: ""
404:
description: "no such container"
schema:
$ref: "#/definitions/ErrorResponse"
examples:
application/json:
message: "No such container: c2ada9df5af8"
500:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
parameters:
- name: "id"
in: "path"
required: true
description: "ID or name of the container"
type: "string"
- name: "size"
in: "query"
type: "boolean"
default: false
description: "Return the size of container as fields `SizeRw` and `SizeRootFs`"
tags: ["Container"]
/containers/{id}/top:
get:
summary: "List processes running inside a container"
description: "On Unix systems, this is done by running the `ps` command. This endpoint is not supported on Windows."
operationId: "ContainerTop"
responses:
200:
description: "no error"
schema:
type: "object"
properties:
Titles:
description: "The ps column titles"
type: "array"
items:
type: "string"
Processes:
description: "Each process running in the container, where each is process is an array of values corresponding to the titles"
type: "array"
items:
type: "array"
items:
type: "string"
examples:
application/json:
Titles:
- "UID"
- "PID"
- "PPID"
- "C"
- "STIME"
- "TTY"
- "TIME"
- "CMD"
Processes:
-
- "root"
- "13642"
- "882"
- "0"
- "17:03"
- "pts/0"
- "00:00:00"
- "/bin/bash"
-
- "root"
- "13735"
- "13642"
- "0"
- "17:06"
- "pts/0"
- "00:00:00"
- "sleep 10"
404:
description: "no such container"
schema:
$ref: "#/definitions/ErrorResponse"
examples:
application/json:
message: "No such container: c2ada9df5af8"
500:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
parameters:
- name: "id"
in: "path"
required: true
description: "ID or name of the container"
type: "string"
- name: "ps_args"
in: "query"
description: "The arguments to pass to `ps`. For example, `aux`"
type: "string"
default: "-ef"
tags: ["Container"]
/containers/{id}/logs:
get:
summary: "Get container logs"
description: |
Get `stdout` and `stderr` logs from a container.
Note: This endpoint works only for containers with the `json-file` or `journald` logging driver.
operationId: "ContainerLogs"
responses:
101:
description: "logs returned as a stream"
schema:
type: "string"
format: "binary"
200:
description: "logs returned as a string in response body"
schema:
type: "string"
404:
description: "no such container"
schema:
$ref: "#/definitions/ErrorResponse"
examples:
application/json:
message: "No such container: c2ada9df5af8"
500:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
parameters:
- name: "id"
in: "path"
required: true
description: "ID or name of the container"
type: "string"
- name: "follow"
in: "query"
description: |
Return the logs as a stream.
This will return a `101` HTTP response with a `Connection: upgrade` header, then hijack the HTTP connection to send raw output. For more information about hijacking and the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach).
type: "boolean"
default: false
- name: "stdout"
in: "query"
description: "Return logs from `stdout`"
type: "boolean"
default: false
- name: "stderr"
in: "query"
description: "Return logs from `stderr`"
type: "boolean"
default: false
- name: "since"
in: "query"
description: "Only return logs since this time, as a UNIX timestamp"
type: "integer"
default: 0
- name: "timestamps"
in: "query"
description: "Add timestamps to every log line"
type: "boolean"
default: false
- name: "tail"
in: "query"
description: "Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines."
type: "string"
default: "all"
tags: ["Container"]
/containers/{id}/changes:
get:
summary: "Get changes on a container’s filesystem"
description: |
Returns which files in a container's filesystem have been added, deleted, or modified. The `Kind` of modification can be one of:
- `0`: Modified
- `1`: Added
- `2`: Deleted
operationId: "ContainerChanges"
produces:
- "application/json"
responses:
200:
description: "no error"
schema:
type: "array"
items:
type: "object"
properties:
Path:
description: "Path to file that has changed"
type: "string"
Kind:
description: "Kind of change"
type: "integer"
enum:
- 0
- 1
- 2
examples:
application/json:
- Path: "/dev"
Kind: 0
- Path: "/dev/kmsg"
Kind: 1
- Path: "/test"
Kind: 1
404:
description: "no such container"
schema:
$ref: "#/definitions/ErrorResponse"
examples:
application/json:
message: "No such container: c2ada9df5af8"
500:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
parameters:
- name: "id"
in: "path"
required: true
description: "ID or name of the container"
type: "string"
tags: ["Container"]
/containers/{id}/export:
get:
summary: "Export a container"
description: "Export the contents of a container as a tarball."
operationId: "ContainerExport"
produces:
- "application/octet-stream"
responses:
200:
description: "no error"
404:
description: "no such container"
schema:
$ref: "#/definitions/ErrorResponse"
examples:
application/json:
message: "No such container: c2ada9df5af8"
500:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
parameters:
- name: "id"
in: "path"
required: true
description: "ID or name of the container"
type: "string"
tags: ["Container"]
/containers/{id}/stats:
get:
summary: "Get container stats based on resource usage"
description: |
This endpoint returns a live stream of a container’s resource usage statistics.
The `precpu_stats` is the CPU statistic of last read, which is used for calculating the CPU usage percentage. It is not the same as the `cpu_stats` field.
operationId: "ContainerStats"
produces:
- "application/json"
responses:
200:
description: "no error"
schema:
type: "object"
examples:
application/json:
read: "2015-01-08T22:57:31.547920715Z"
pids_stats:
current: 3
networks:
eth0:
rx_bytes: 5338
rx_dropped: 0
rx_errors: 0
rx_packets: 36
tx_bytes: 648
tx_dropped: 0
tx_errors: 0
tx_packets: 8
eth5:
rx_bytes: 4641
rx_dropped: 0
rx_errors: 0
rx_packets: 26
tx_bytes: 690
tx_dropped: 0
tx_errors: 0
tx_packets: 9
memory_stats:
stats:
total_pgmajfault: 0
cache: 0
mapped_file: 0
total_inactive_file: 0
pgpgout: 414
rss: 6537216
total_mapped_file: 0
writeback: 0
unevictable: 0
pgpgin: 477
total_unevictable: 0
pgmajfault: 0
total_rss: 6537216
total_rss_huge: 6291456
total_writeback: 0
total_inactive_anon: 0
rss_huge: 6291456
hierarchical_memory_limit: 67108864
total_pgfault: 964
total_active_file: 0
active_anon: 6537216
total_active_anon: 6537216
total_pgpgout: 414
total_cache: 0
inactive_anon: 0
active_file: 0
pgfault: 964
inactive_file: 0
total_pgpgin: 477
max_usage: 6651904
usage: 6537216
failcnt: 0
limit: 67108864
blkio_stats: {}
cpu_stats:
cpu_usage:
percpu_usage:
- 8646879
- 24472255
- 36438778
- 30657443
usage_in_usermode: 50000000
total_usage: 100215355
usage_in_kernelmode: 30000000
system_cpu_usage: 739306590000000
throttling_data:
periods: 0
throttled_periods: 0
throttled_time: 0
precpu_stats:
cpu_usage:
percpu_usage:
- 8646879
- 24350896
- 36438778
- 30657443
usage_in_usermode: 50000000
total_usage: 100093996
usage_in_kernelmode: 30000000
system_cpu_usage: 9492140000000
throttling_data:
periods: 0
throttled_periods: 0
throttled_time: 0
404:
description: "no such container"
schema:
$ref: "#/definitions/ErrorResponse"
examples:
application/json:
message: "No such container: c2ada9df5af8"
500:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
parameters:
- name: "id"
in: "path"
required: true
description: "ID or name of the container"
type: "string"
- name: "stream"
in: "query"
description: "Stream the output. If false, the stats will be output once and then it will disconnect."
type: "boolean"
default: true
tags: ["Container"]
/containers/{id}/resize:
post:
summary: "Resize a container TTY"
description: "Resize the TTY for a container. You must restart the container for the resize to take effect."
operationId: "ContainerResize"
consumes:
- "application/octet-stream"
produces:
- "text/plain"
responses:
200:
description: "no error"
404:
description: "no such container"
schema:
$ref: "#/definitions/ErrorResponse"
examples:
application/json:
message: "No such container: c2ada9df5af8"
500:
description: "cannot resize container"
schema:
$ref: "#/definitions/ErrorResponse"
parameters:
- name: "id"
in: "path"
required: true
description: "ID or name of the container"
type: "string"
- name: "h"
in: "query"
description: "Height of the tty session in characters"
type: "integer"
- name: "w"
in: "query"
description: "Width of the tty session in characters"
type: "integer"
tags: ["Container"]
/containers/{id}/start:
post:
summary: "Start a container"
operationId: "ContainerStart"
responses:
204:
description: "no error"
304:
description: "container already started"
schema:
$ref: "#/definitions/ErrorResponse"
404:
description: "no such container"
schema:
$ref: "#/definitions/ErrorResponse"
examples:
application/json:
message: "No such container: c2ada9df5af8"
500:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
parameters:
- name: "id"
in: "path"
required: true
description: "ID or name of the container"
type: "string"
- name: "detachKeys"
in: "query"
description: "Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`."
type: "string"
tags: ["Container"]
/containers/{id}/stop:
post:
summary: "Stop a container"
operationId: "ContainerStop"
responses:
204:
description: "no error"
304:
description: "container already stopped"
schema:
$ref: "#/definitions/ErrorResponse"
404:
description: "no such container"
schema:
$ref: "#/definitions/ErrorResponse"
examples:
application/json:
message: "No such container: c2ada9df5af8"
500:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
parameters:
- name: "id"
in: "path"
required: true
description: "ID or name of the container"
type: "string"
- name: "t"
in: "query"
description: "Number of seconds to wait before killing the container"
type: "integer"
tags: ["Container"]
/containers/{id}/restart:
post:
summary: "Restart a container"
operationId: "ContainerRestart"
responses:
204:
description: "no error"
404:
description: "no such container"
schema:
$ref: "#/definitions/ErrorResponse"
examples:
application/json:
message: "No such container: c2ada9df5af8"
500:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
parameters:
- name: "id"
in: "path"
required: true
description: "ID or name of the container"
type: "string"
- name: "t"
in: "query"
description: "Number of seconds to wait before killing the container"
type: "integer"
tags: ["Container"]
/containers/{id}/kill:
post:
summary: "Kill a container"
description: "Send a POSIX signal to a container, defaulting to killing to the container."
operationId: "ContainerKill"
responses:
204:
description: "no error"
404:
description: "no such container"
schema:
$ref: "#/definitions/ErrorResponse"
examples:
application/json:
message: "No such container: c2ada9df5af8"
500:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
parameters:
- name: "id"
in: "path"
required: true
description: "ID or name of the container"
type: "string"
- name: "signal"
in: "query"
description: "Signal to send to the container as an integer or string (e.g. `SIGINT`)"
type: "string"
default: "SIGKILL"
tags: ["Container"]
/containers/{id}/update:
post:
summary: "Update a container"
description: "Change various configuration options of a container without having to recreate it."
operationId: "ContainerUpdate"
consumes: ["application/json"]
produces: ["application/json"]
responses:
200:
description: "The container has been updated."
schema:
type: "object"
properties:
Warnings:
type: "array"
items:
type: "string"
404:
description: "no such container"