|
@@ -16,9 +16,7 @@ redirect_from:
|
|
|
will be rejected.
|
|
|
-->
|
|
|
|
|
|
-# Docker Engine API v1.24
|
|
|
-
|
|
|
-# 1. Brief introduction
|
|
|
+## 1. Brief introduction
|
|
|
|
|
|
- The daemon listens on `unix:///var/run/docker.sock` but you can
|
|
|
[Bind Docker to another host/port or a Unix socket](../commandline/dockerd.md#bind-docker-to-another-host-port-or-a-unix-socket).
|
|
@@ -26,7 +24,7 @@ redirect_from:
|
|
|
or `pull`, the HTTP connection is hijacked to transport `stdout`,
|
|
|
`stdin` and `stderr`.
|
|
|
|
|
|
-# 2. Errors
|
|
|
+## 2. Errors
|
|
|
|
|
|
The Engine 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:
|
|
|
|
|
@@ -36,11 +34,11 @@ The Engine API uses standard HTTP status codes to indicate the success or failur
|
|
|
|
|
|
The status codes that are returned for each endpoint are specified in the endpoint documentation below.
|
|
|
|
|
|
-# 3. Endpoints
|
|
|
+## 3. Endpoints
|
|
|
|
|
|
-## 3.1 Containers
|
|
|
+### 3.1 Containers
|
|
|
|
|
|
-### List containers
|
|
|
+#### List containers
|
|
|
|
|
|
`GET /containers/json`
|
|
|
|
|
@@ -245,7 +243,7 @@ List containers
|
|
|
- **400** – bad parameter
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Create a container
|
|
|
+#### Create a container
|
|
|
|
|
|
`POST /containers/create`
|
|
|
|
|
@@ -511,7 +509,7 @@ Create a container
|
|
|
- **409** – conflict
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Inspect a container
|
|
|
+#### Inspect a container
|
|
|
|
|
|
`GET /containers/(id or name)/json`
|
|
|
|
|
@@ -721,7 +719,7 @@ Return low-level information on the container `id`
|
|
|
- **404** – no such container
|
|
|
- **500** – server error
|
|
|
|
|
|
-### List processes running inside a container
|
|
|
+#### List processes running inside a container
|
|
|
|
|
|
`GET /containers/(id or name)/top`
|
|
|
|
|
@@ -785,7 +783,7 @@ supported on Windows.
|
|
|
- **404** – no such container
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Get container logs
|
|
|
+#### Get container logs
|
|
|
|
|
|
`GET /containers/(id or name)/logs`
|
|
|
|
|
@@ -828,7 +826,7 @@ Get `stdout` and `stderr` logs from the container ``id``
|
|
|
- **404** – no such container
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Inspect changes on a container's filesystem
|
|
|
+#### Inspect changes on a container's filesystem
|
|
|
|
|
|
`GET /containers/(id or name)/changes`
|
|
|
|
|
@@ -870,7 +868,7 @@ Values for `Kind`:
|
|
|
- **404** – no such container
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Export a container
|
|
|
+#### Export a container
|
|
|
|
|
|
`GET /containers/(id or name)/export`
|
|
|
|
|
@@ -895,7 +893,7 @@ Export the contents of container `id`
|
|
|
- **404** – no such container
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Get container stats based on resource usage
|
|
|
+#### Get container stats based on resource usage
|
|
|
|
|
|
`GET /containers/(id or name)/stats`
|
|
|
|
|
@@ -1019,7 +1017,7 @@ The precpu_stats is the cpu statistic of last read, which is used for calculatin
|
|
|
- **404** – no such container
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Resize a container TTY
|
|
|
+#### Resize a container TTY
|
|
|
|
|
|
`POST /containers/(id or name)/resize`
|
|
|
|
|
@@ -1046,7 +1044,7 @@ Resize the TTY for container with `id`. The unit is number of characters. You m
|
|
|
- **404** – No such container
|
|
|
- **500** – Cannot resize container
|
|
|
|
|
|
-### Start a container
|
|
|
+#### Start a container
|
|
|
|
|
|
`POST /containers/(id or name)/start`
|
|
|
|
|
@@ -1073,7 +1071,7 @@ Start the container `id`
|
|
|
- **404** – no such container
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Stop a container
|
|
|
+#### Stop a container
|
|
|
|
|
|
`POST /containers/(id or name)/stop`
|
|
|
|
|
@@ -1098,7 +1096,7 @@ Stop the container `id`
|
|
|
- **404** – no such container
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Restart a container
|
|
|
+#### Restart a container
|
|
|
|
|
|
`POST /containers/(id or name)/restart`
|
|
|
|
|
@@ -1122,7 +1120,7 @@ Restart the container `id`
|
|
|
- **404** – no such container
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Kill a container
|
|
|
+#### Kill a container
|
|
|
|
|
|
`POST /containers/(id or name)/kill`
|
|
|
|
|
@@ -1147,7 +1145,7 @@ Kill the container `id`
|
|
|
- **404** – no such container
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Update a container
|
|
|
+#### Update a container
|
|
|
|
|
|
`POST /containers/(id or name)/update`
|
|
|
|
|
@@ -1191,7 +1189,7 @@ Update configuration of one or more containers.
|
|
|
- **404** – no such container
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Rename a container
|
|
|
+#### Rename a container
|
|
|
|
|
|
`POST /containers/(id or name)/rename`
|
|
|
|
|
@@ -1216,7 +1214,7 @@ Rename the container `id` to a `new_name`
|
|
|
- **409** - conflict name already assigned
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Pause a container
|
|
|
+#### Pause a container
|
|
|
|
|
|
`POST /containers/(id or name)/pause`
|
|
|
|
|
@@ -1236,7 +1234,7 @@ Pause the container `id`
|
|
|
- **404** – no such container
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Unpause a container
|
|
|
+#### Unpause a container
|
|
|
|
|
|
`POST /containers/(id or name)/unpause`
|
|
|
|
|
@@ -1256,7 +1254,7 @@ Unpause the container `id`
|
|
|
- **404** – no such container
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Attach to a container
|
|
|
+#### Attach to a container
|
|
|
|
|
|
`POST /containers/(id or name)/attach`
|
|
|
|
|
@@ -1345,7 +1343,7 @@ The simplest way to implement the Attach protocol is the following:
|
|
|
4. Read the extracted size and output it on the correct output.
|
|
|
5. Goto 1.
|
|
|
|
|
|
-### Attach to a container (websocket)
|
|
|
+#### Attach to a container (websocket)
|
|
|
|
|
|
`GET /containers/(id or name)/attach/ws`
|
|
|
|
|
@@ -1385,7 +1383,7 @@ Implements websocket protocol handshake according to [RFC 6455](http://tools.iet
|
|
|
- **404** – no such container
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Wait a container
|
|
|
+#### Wait a container
|
|
|
|
|
|
`POST /containers/(id or name)/wait`
|
|
|
|
|
@@ -1408,7 +1406,7 @@ Block until container `id` stops, then returns the exit code
|
|
|
- **404** – no such container
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Remove a container
|
|
|
+#### Remove a container
|
|
|
|
|
|
`DELETE /containers/(id or name)`
|
|
|
|
|
@@ -1437,14 +1435,14 @@ Remove the container `id` from the filesystem
|
|
|
- **409** – conflict
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Retrieving information about files and folders in a container
|
|
|
+#### Retrieving information about files and folders in a container
|
|
|
|
|
|
`HEAD /containers/(id or name)/archive`
|
|
|
|
|
|
See the description of the `X-Docker-Container-Path-Stat` header in the
|
|
|
following section.
|
|
|
|
|
|
-### Get an archive of a filesystem resource in a container
|
|
|
+#### Get an archive of a filesystem resource in a container
|
|
|
|
|
|
`GET /containers/(id or name)/archive`
|
|
|
|
|
@@ -1509,7 +1507,7 @@ desired.
|
|
|
- no such file or directory (**path** does not exist)
|
|
|
- **500** - server error
|
|
|
|
|
|
-### Extract an archive of files or folders to a directory in a container
|
|
|
+#### Extract an archive of files or folders to a directory in a container
|
|
|
|
|
|
`PUT /containers/(id or name)/archive`
|
|
|
|
|
@@ -1557,9 +1555,9 @@ Upload a tar archive to be extracted to a path in the filesystem of container
|
|
|
- no such file or directory (**path** resource does not exist)
|
|
|
- **500** – server error
|
|
|
|
|
|
-## 3.2 Images
|
|
|
+### 3.2 Images
|
|
|
|
|
|
-### List Images
|
|
|
+#### List Images
|
|
|
|
|
|
`GET /images/json`
|
|
|
|
|
@@ -1652,7 +1650,7 @@ references on the command line.
|
|
|
- `since`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`)
|
|
|
- **filter** - only return images with the specified name
|
|
|
|
|
|
-### Build image from a Dockerfile
|
|
|
+#### Build image from a Dockerfile
|
|
|
|
|
|
`POST /build`
|
|
|
|
|
@@ -1758,7 +1756,7 @@ or being killed.
|
|
|
- **200** – no error
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Create an image
|
|
|
+#### Create an image
|
|
|
|
|
|
`POST /images/create`
|
|
|
|
|
@@ -1824,7 +1822,7 @@ a base64-encoded AuthConfig object.
|
|
|
|
|
|
|
|
|
|
|
|
-### Inspect an image
|
|
|
+#### Inspect an image
|
|
|
|
|
|
`GET /images/(name)/json`
|
|
|
|
|
@@ -1942,7 +1940,7 @@ Return low-level information on the image `name`
|
|
|
- **404** – no such image
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Get the history of an image
|
|
|
+#### Get the history of an image
|
|
|
|
|
|
`GET /images/(name)/history`
|
|
|
|
|
@@ -1996,7 +1994,7 @@ Return the history of the image `name`
|
|
|
- **404** – no such image
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Push an image on the registry
|
|
|
+#### Push an image on the registry
|
|
|
|
|
|
`POST /images/(name)/push`
|
|
|
|
|
@@ -2058,7 +2056,7 @@ The push is cancelled if the HTTP connection is closed.
|
|
|
- **404** – no such image
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Tag an image into a repository
|
|
|
+#### Tag an image into a repository
|
|
|
|
|
|
`POST /images/(name)/tag`
|
|
|
|
|
@@ -2085,7 +2083,7 @@ Tag the image `name` into a repository
|
|
|
- **409** – conflict
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Remove an image
|
|
|
+#### Remove an image
|
|
|
|
|
|
`DELETE /images/(name)`
|
|
|
|
|
@@ -2118,7 +2116,7 @@ Remove the image `name` from the filesystem
|
|
|
- **409** – conflict
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Search images
|
|
|
+#### Search images
|
|
|
|
|
|
`GET /images/search`
|
|
|
|
|
@@ -2176,9 +2174,9 @@ Search for an image on [Docker Hub](https://hub.docker.com).
|
|
|
- **200** – no error
|
|
|
- **500** – server error
|
|
|
|
|
|
-## 3.3 Misc
|
|
|
+### 3.3 Misc
|
|
|
|
|
|
-### Check auth configuration
|
|
|
+#### Check auth configuration
|
|
|
|
|
|
`POST /auth`
|
|
|
|
|
@@ -2211,7 +2209,7 @@ if available, for accessing the registry without password.
|
|
|
- **204** – no error
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Display system-wide information
|
|
|
+#### Display system-wide information
|
|
|
|
|
|
`GET /info`
|
|
|
|
|
@@ -2304,7 +2302,7 @@ Display system-wide information
|
|
|
- **200** – no error
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Show the docker version information
|
|
|
+#### Show the docker version information
|
|
|
|
|
|
`GET /version`
|
|
|
|
|
@@ -2336,7 +2334,7 @@ Show the docker version information
|
|
|
- **200** – no error
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Ping the docker server
|
|
|
+#### Ping the docker server
|
|
|
|
|
|
`GET /_ping`
|
|
|
|
|
@@ -2358,7 +2356,7 @@ Ping the docker server
|
|
|
- **200** - no error
|
|
|
- **500** - server error
|
|
|
|
|
|
-### Create a new image from a container's changes
|
|
|
+#### Create a new image from a container's changes
|
|
|
|
|
|
`POST /commit`
|
|
|
|
|
@@ -2430,7 +2428,7 @@ Create a new image from a container's changes
|
|
|
- **404** – no such container
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Monitor Docker's events
|
|
|
+#### Monitor Docker's events
|
|
|
|
|
|
`GET /events`
|
|
|
|
|
@@ -2635,7 +2633,7 @@ Docker daemon report the following event:
|
|
|
- **200** – no error
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Get a tarball containing all images in a repository
|
|
|
+#### Get a tarball containing all images in a repository
|
|
|
|
|
|
`GET /images/(name)/get`
|
|
|
|
|
@@ -2665,7 +2663,7 @@ See the [image tarball format](#image-tarball-format) for more details.
|
|
|
- **200** – no error
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Get a tarball containing all images
|
|
|
+#### Get a tarball containing all images
|
|
|
|
|
|
`GET /images/get`
|
|
|
|
|
@@ -2694,7 +2692,7 @@ See the [image tarball format](#image-tarball-format) for more details.
|
|
|
- **200** – no error
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Load a tarball with a set of images and tags into docker
|
|
|
+#### Load a tarball with a set of images and tags into docker
|
|
|
|
|
|
`POST /images/load`
|
|
|
|
|
@@ -2743,7 +2741,7 @@ action completes.
|
|
|
- **200** – no error
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Image tarball format
|
|
|
+#### Image tarball format
|
|
|
|
|
|
An image tarball contains one directory per image layer (named using its long ID),
|
|
|
each containing these files:
|
|
@@ -2764,7 +2762,7 @@ the root that contains a list of repository and tag names mapped to layer IDs.
|
|
|
}
|
|
|
```
|
|
|
|
|
|
-### Exec Create
|
|
|
+#### Exec Create
|
|
|
|
|
|
`POST /containers/(id or name)/exec`
|
|
|
|
|
@@ -2818,7 +2816,7 @@ Sets up an exec instance in a running container `id`
|
|
|
- **409** - container is paused
|
|
|
- **500** - server error
|
|
|
|
|
|
-### Exec Start
|
|
|
+#### Exec Start
|
|
|
|
|
|
`POST /exec/(id)/start`
|
|
|
|
|
@@ -2860,7 +2858,7 @@ interactive session with the `exec` command.
|
|
|
|
|
|
Similar to the stream behavior of `POST /containers/(id or name)/attach` API
|
|
|
|
|
|
-### Exec Resize
|
|
|
+#### Exec Resize
|
|
|
|
|
|
`POST /exec/(id)/resize`
|
|
|
|
|
@@ -2887,7 +2885,7 @@ This API is valid only if `tty` was specified as part of creating and starting t
|
|
|
- **201** – no error
|
|
|
- **404** – no such exec instance
|
|
|
|
|
|
-### Exec Inspect
|
|
|
+#### Exec Inspect
|
|
|
|
|
|
`GET /exec/(id)/json`
|
|
|
|
|
@@ -2930,9 +2928,9 @@ Return low-level information about the `exec` command `id`.
|
|
|
- **404** – no such exec instance
|
|
|
- **500** - server error
|
|
|
|
|
|
-## 3.4 Volumes
|
|
|
+### 3.4 Volumes
|
|
|
|
|
|
-### List volumes
|
|
|
+#### List volumes
|
|
|
|
|
|
`GET /volumes`
|
|
|
|
|
@@ -2970,7 +2968,7 @@ Return low-level information about the `exec` command `id`.
|
|
|
- **200** - no error
|
|
|
- **500** - server error
|
|
|
|
|
|
-### Create a volume
|
|
|
+#### Create a volume
|
|
|
|
|
|
`POST /volumes/create`
|
|
|
|
|
@@ -3027,7 +3025,7 @@ Create a volume
|
|
|
Refer to the [inspect a volume](#inspect-a-volume) section or details about the
|
|
|
JSON fields returned in the response.
|
|
|
|
|
|
-### Inspect a volume
|
|
|
+#### Inspect a volume
|
|
|
|
|
|
`GET /volumes/(name)`
|
|
|
|
|
@@ -3079,7 +3077,7 @@ response.
|
|
|
- **Scope** - Scope describes the level at which the volume exists, can be one of
|
|
|
`global` for cluster-wide or `local` for machine level. The default is `local`.
|
|
|
|
|
|
-### Remove a volume
|
|
|
+#### Remove a volume
|
|
|
|
|
|
`DELETE /volumes/(name)`
|
|
|
|
|
@@ -3100,9 +3098,9 @@ Instruct the driver to remove the volume (`name`).
|
|
|
- **409** - volume is in use and cannot be removed
|
|
|
- **500** - server error
|
|
|
|
|
|
-## 3.5 Networks
|
|
|
+### 3.5 Networks
|
|
|
|
|
|
-### List networks
|
|
|
+#### List networks
|
|
|
|
|
|
`GET /networks`
|
|
|
|
|
@@ -3194,7 +3192,7 @@ Content-Type: application/json
|
|
|
- **200** - no error
|
|
|
- **500** - server error
|
|
|
|
|
|
-### Inspect network
|
|
|
+#### Inspect network
|
|
|
|
|
|
`GET /networks/<network-id>`
|
|
|
|
|
@@ -3256,7 +3254,7 @@ Content-Type: application/json
|
|
|
- **200** - no error
|
|
|
- **404** - network not found
|
|
|
|
|
|
-### Create a network
|
|
|
+#### Create a network
|
|
|
|
|
|
`POST /networks/create`
|
|
|
|
|
@@ -3339,7 +3337,7 @@ Content-Type: application/json
|
|
|
- **Options** - Network specific options to be used by the drivers
|
|
|
- **Labels** - Labels to set on the network, specified as a map: `{"key":"value" [,"key2":"value2"]}`
|
|
|
|
|
|
-### Connect a container to a network
|
|
|
+#### Connect a container to a network
|
|
|
|
|
|
`POST /networks/(id)/connect`
|
|
|
|
|
@@ -3377,7 +3375,7 @@ Content-Type: application/json
|
|
|
|
|
|
- **container** - container-id/name to be connected to the network
|
|
|
|
|
|
-### Disconnect a container from a network
|
|
|
+#### Disconnect a container from a network
|
|
|
|
|
|
`POST /networks/(id)/disconnect`
|
|
|
|
|
@@ -3411,7 +3409,7 @@ Content-Type: application/json
|
|
|
- **Container** - container-id/name to be disconnected from a network
|
|
|
- **Force** - Force the container to disconnect from a network
|
|
|
|
|
|
-### Remove a network
|
|
|
+#### Remove a network
|
|
|
|
|
|
`DELETE /networks/(id)`
|
|
|
|
|
@@ -3431,9 +3429,9 @@ Instruct the driver to remove the network (`id`).
|
|
|
- **404** - no such network
|
|
|
- **500** - server error
|
|
|
|
|
|
-## 3.6 Plugins (experimental)
|
|
|
+### 3.6 Plugins (experimental)
|
|
|
|
|
|
-### List plugins
|
|
|
+#### List plugins
|
|
|
|
|
|
`GET /plugins`
|
|
|
|
|
@@ -3563,7 +3561,7 @@ Content-Type: application/json
|
|
|
- **200** - no error
|
|
|
- **500** - server error
|
|
|
|
|
|
-### Install a plugin
|
|
|
+#### Install a plugin
|
|
|
|
|
|
`POST /plugins/pull?name=<plugin name>`
|
|
|
|
|
@@ -3625,7 +3623,7 @@ Content-Length: 175
|
|
|
name must have at least one component
|
|
|
- **500** - plugin already exists
|
|
|
|
|
|
-### Inspect a plugin
|
|
|
+#### Inspect a plugin
|
|
|
|
|
|
`GET /plugins/(plugin name)`
|
|
|
|
|
@@ -3758,7 +3756,7 @@ Content-Type: application/json
|
|
|
- **200** - no error
|
|
|
- **404** - plugin not installed
|
|
|
|
|
|
-### Enable a plugin
|
|
|
+#### Enable a plugin
|
|
|
|
|
|
`POST /plugins/(plugin name)/enable`
|
|
|
|
|
@@ -3786,7 +3784,7 @@ Content-Type: text/plain; charset=utf-8
|
|
|
- **200** - no error
|
|
|
- **500** - plugin is already enabled
|
|
|
|
|
|
-### Disable a plugin
|
|
|
+#### Disable a plugin
|
|
|
|
|
|
`POST /plugins/(plugin name)/disable`
|
|
|
|
|
@@ -3814,7 +3812,7 @@ Content-Type: text/plain; charset=utf-8
|
|
|
- **200** - no error
|
|
|
- **500** - plugin is already disabled
|
|
|
|
|
|
-### Remove a plugin
|
|
|
+#### Remove a plugin
|
|
|
|
|
|
`DELETE /plugins/(plugin name)`
|
|
|
|
|
@@ -3844,7 +3842,7 @@ Content-Type: text/plain; charset=utf-8
|
|
|
|
|
|
<!-- TODO Document "docker plugin push" endpoint once we have "plugin build"
|
|
|
|
|
|
-### Push a plugin
|
|
|
+#### Push a plugin
|
|
|
|
|
|
`POST /v1.24/plugins/tiborvass/(plugin name)/push HTTP/1.1`
|
|
|
|
|
@@ -3870,11 +3868,11 @@ an image](#create-an-image) section for more details.
|
|
|
|
|
|
-->
|
|
|
|
|
|
-## 3.7 Nodes
|
|
|
+### 3.7 Nodes
|
|
|
|
|
|
**Note**: Node operations require the engine to be part of a swarm.
|
|
|
|
|
|
-### List nodes
|
|
|
+#### List nodes
|
|
|
|
|
|
|
|
|
`GET /nodes`
|
|
@@ -3967,7 +3965,7 @@ List nodes
|
|
|
- **200** – no error
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Inspect a node
|
|
|
+#### Inspect a node
|
|
|
|
|
|
|
|
|
`GET /nodes/(id or name)`
|
|
@@ -4049,7 +4047,7 @@ Return low-level information on the node `id`
|
|
|
- **404** – no such node
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Remove a node
|
|
|
+#### Remove a node
|
|
|
|
|
|
|
|
|
`DELETE /nodes/(id or name)`
|
|
@@ -4077,7 +4075,7 @@ Remove a node from the swarm.
|
|
|
- **404** – no such node
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Update a node
|
|
|
+#### Update a node
|
|
|
|
|
|
|
|
|
`POST /nodes/(id)/update`
|
|
@@ -4132,9 +4130,9 @@ JSON Parameters:
|
|
|
- **404** – no such node
|
|
|
- **500** – server error
|
|
|
|
|
|
-## 3.8 Swarm
|
|
|
+### 3.8 Swarm
|
|
|
|
|
|
-### Inspect swarm
|
|
|
+#### Inspect swarm
|
|
|
|
|
|
|
|
|
`GET /swarm`
|
|
@@ -4182,7 +4180,7 @@ Inspect swarm
|
|
|
|
|
|
- **200** - no error
|
|
|
|
|
|
-### Initialize a new swarm
|
|
|
+#### Initialize a new swarm
|
|
|
|
|
|
|
|
|
`POST /swarm/init`
|
|
@@ -4258,7 +4256,7 @@ JSON Parameters:
|
|
|
- **Options** - An object with key/value pairs that are interpreted
|
|
|
as protocol-specific options for the external CA driver.
|
|
|
|
|
|
-### Join an existing swarm
|
|
|
+#### Join an existing swarm
|
|
|
|
|
|
`POST /swarm/join`
|
|
|
|
|
@@ -4300,7 +4298,7 @@ JSON Parameters:
|
|
|
- **RemoteAddr** – Address of any manager node already participating in the swarm.
|
|
|
- **JoinToken** – Secret token for joining this swarm.
|
|
|
|
|
|
-### Leave a swarm
|
|
|
+#### Leave a swarm
|
|
|
|
|
|
|
|
|
`POST /swarm/leave`
|
|
@@ -4326,7 +4324,7 @@ Leave a swarm
|
|
|
- **200** – no error
|
|
|
- **406** – node is not part of a swarm
|
|
|
|
|
|
-### Update a swarm
|
|
|
+#### Update a swarm
|
|
|
|
|
|
|
|
|
`POST /swarm/update`
|
|
@@ -4407,11 +4405,11 @@ JSON Parameters:
|
|
|
- **Worker** - Token to use for joining as a worker.
|
|
|
- **Manager** - Token to use for joining as a manager.
|
|
|
|
|
|
-## 3.9 Services
|
|
|
+### 3.9 Services
|
|
|
|
|
|
**Note**: Service operations require to first be part of a swarm.
|
|
|
|
|
|
-### List services
|
|
|
+#### List services
|
|
|
|
|
|
|
|
|
`GET /services`
|
|
@@ -4516,7 +4514,7 @@ List services
|
|
|
- **200** – no error
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Create a service
|
|
|
+#### Create a service
|
|
|
|
|
|
`POST /services/create`
|
|
|
|
|
@@ -4689,7 +4687,7 @@ image](#create-an-image) section for more details.
|
|
|
section for more details.
|
|
|
|
|
|
|
|
|
-### Remove a service
|
|
|
+#### Remove a service
|
|
|
|
|
|
|
|
|
`DELETE /services/(id or name)`
|
|
@@ -4712,7 +4710,7 @@ Stop and remove the service `id`
|
|
|
- **404** – no such service
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Inspect one or more services
|
|
|
+#### Inspect one or more services
|
|
|
|
|
|
|
|
|
`GET /services/(id or name)`
|
|
@@ -4801,7 +4799,7 @@ Return information on the service `id`.
|
|
|
- **404** – no such service
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Update a service
|
|
|
+#### Update a service
|
|
|
|
|
|
`POST /services/(id or name)/update`
|
|
|
|
|
@@ -4934,11 +4932,11 @@ image](#create-an-image) section for more details.
|
|
|
- **404** – no such service
|
|
|
- **500** – server error
|
|
|
|
|
|
-## 3.10 Tasks
|
|
|
+### 3.10 Tasks
|
|
|
|
|
|
**Note**: Task operations require the engine to be part of a swarm.
|
|
|
|
|
|
-### List tasks
|
|
|
+#### List tasks
|
|
|
|
|
|
|
|
|
`GET /tasks`
|
|
@@ -5136,7 +5134,7 @@ List tasks
|
|
|
- **200** – no error
|
|
|
- **500** – server error
|
|
|
|
|
|
-### Inspect a task
|
|
|
+#### Inspect a task
|
|
|
|
|
|
|
|
|
`GET /tasks/(task id)`
|
|
@@ -5239,9 +5237,9 @@ Get details on a task
|
|
|
- **404** – unknown task
|
|
|
- **500** – server error
|
|
|
|
|
|
-# 4. Going further
|
|
|
+## 4. Going further
|
|
|
|
|
|
-## 4.1 Inside `docker run`
|
|
|
+### 4.1 Inside `docker run`
|
|
|
|
|
|
As an example, the `docker run` command line makes the following API calls:
|
|
|
|
|
@@ -5259,7 +5257,7 @@ As an example, the `docker run` command line makes the following API calls:
|
|
|
|
|
|
- If in detached mode or only `stdin` is attached, display the container's id.
|
|
|
|
|
|
-## 4.2 Hijacking
|
|
|
+### 4.2 Hijacking
|
|
|
|
|
|
In this version of the API, `/attach`, uses hijacking to transport `stdin`,
|
|
|
`stdout`, and `stderr` on the same socket.
|
|
@@ -5274,7 +5272,7 @@ When Docker daemon detects the `Upgrade` header, it switches its status code
|
|
|
from **200 OK** to **101 UPGRADED** and resends the same headers.
|
|
|
|
|
|
|
|
|
-## 4.3 CORS Requests
|
|
|
+### 4.3 CORS Requests
|
|
|
|
|
|
To set cross origin requests to the Engine API please give values to
|
|
|
`--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all,
|