Browse code

Bump API to v1.26

Signed-off-by: John Howard <jhoward@microsoft.com>

John Howard authored on 2016/11/12 04:51:26
Showing 6 changed files
... ...
@@ -21,7 +21,7 @@ import (
21 21
 // Common constants for daemon and client.
22 22
 const (
23 23
 	// DefaultVersion of Current REST API
24
-	DefaultVersion string = "1.25"
24
+	DefaultVersion string = "1.26"
25 25
 
26 26
 	// NoBaseImageSpecifier is the symbol used by the FROM
27 27
 	// command to specify that no base image is to be used.
... ...
@@ -8,10 +8,10 @@ produces:
8 8
 consumes:
9 9
   - "application/json"
10 10
   - "text/plain"
11
-basePath: "/v1.25"
11
+basePath: "/v1.26"
12 12
 info:
13 13
   title: "Docker Remote API"
14
-  version: "1.25"
14
+  version: "1.26"
15 15
   x-logo:
16 16
     url: "https://docs.docker.com/images/logo-docker-main.png"
17 17
   description: |
... ...
@@ -33,7 +33,7 @@ info:
33 33
 
34 34
     The API is usually changed in each release of Docker. If you want to write a client that doesn't break when connecting to newer Docker releases, you can lock to a specific API version.
35 35
 
36
-    For Docker 1.13, the API version is 1.25. To lock to this version, you prefix the URL with `/v1.25`. For example, calling `/info` is the same as calling `/v1.25/info`.
36
+    For Docker 1.14, 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`.
37 37
 
38 38
     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.
39 39
 
... ...
@@ -1581,7 +1581,7 @@ definitions:
1581 1581
           NanoCPUs: 4000000000
1582 1582
           MemoryBytes: 8272408576
1583 1583
         Engine:
1584
-          EngineVersion: "1.13.0"
1584
+          EngineVersion: "1.14.0"
1585 1585
           Labels:
1586 1586
             foo: "bar"
1587 1587
           Plugins:
... ...
@@ -5052,13 +5052,13 @@ paths:
5052 5052
                 type: "string"
5053 5053
           examples:
5054 5054
             application/json:
5055
-              Version: "1.13.0"
5055
+              Version: "1.14.0"
5056 5056
               Os: "linux"
5057 5057
               KernelVersion: "3.19.0-23-generic"
5058 5058
               GoVersion: "go1.6.3"
5059 5059
               GitCommit: "deadbee"
5060 5060
               Arch: "amd64"
5061
-              ApiVersion: "1.25"
5061
+              ApiVersion: "1.26"
5062 5062
               MinAPIVersion: "1.12"
5063 5063
               BuildTime: "2016-06-14T07:09:13.444803460+00:00"
5064 5064
               Experimental: true
... ...
@@ -3,7 +3,7 @@ Package client is a Go client for the Docker Remote API.
3 3
 
4 4
 The "docker" command uses this package to communicate with the daemon. It can also
5 5
 be used by your own Go applications to do anything the command-line interface does
6
-– running containers, pulling images, managing swarms, etc.
6
+- running containers, pulling images, managing swarms, etc.
7 7
 
8 8
 For more information about the Remote API, see the documentation:
9 9
 https://docs.docker.com/engine/reference/api/docker_remote_api/
... ...
@@ -58,7 +58,7 @@ import (
58 58
 )
59 59
 
60 60
 // DefaultVersion is the version of the current stable API
61
-const DefaultVersion string = "1.25"
61
+const DefaultVersion string = "1.26"
62 62
 
63 63
 // Client is the API client that performs all operations
64 64
 // against a docker server.
... ...
@@ -165,7 +165,7 @@ func (cli *Client) doRequest(ctx context.Context, req *http.Request) (serverResp
165 165
 		// daemon on Windows where the daemon is listening on a named pipe
166 166
 		// `//./pipe/docker_engine, and the client must be running elevated.
167 167
 		// Give users a clue rather than the not-overly useful message
168
-		// such as `error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.25/info:
168
+		// such as `error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.26/info:
169 169
 		// open //./pipe/docker_engine: The system cannot find the file specified.`.
170 170
 		// Note we can't string compare "The system cannot find the file specified" as
171 171
 		// this is localised - for example in French the error would be
... ...
@@ -54,8 +54,8 @@ default.
54 54
 It is required to to supply a version to API calls. This is done by prefixing
55 55
 the URL with the version number.
56 56
 
57
-The current version of the API is 1.25, so to call the `/info` endpoint, you
58
-would send a request to the URL `/v1.25/info`. To call, for example, version
57
+The current version of the API is 1.26, so to call the `/info` endpoint, you
58
+would send a request to the URL `/v1.26/info`. To call, for example, version
59 59
 1.24 of the API instead, you would request `/v1.24/info`.
60 60
 
61 61
 If a newer daemon is installed, new properties may be returned even when
... ...
@@ -69,6 +69,7 @@ Use the table below to find the API version for a Docker version:
69 69
 
70 70
 Docker version  | API version                        | Changes
71 71
 ----------------|------------------------------------|------------------------------------------------------
72
+1.14.x          | [1.26](docker_remote_api_v1.26.md) | [API changes](docker_remote_api.md#v1-26-api-changes)
72 73
 1.13.x          | [1.25](docker_remote_api_v1.25.md) | [API changes](docker_remote_api.md#v1-25-api-changes)
73 74
 1.12.x          | [1.24](docker_remote_api_v1.24.md) | [API changes](docker_remote_api.md#v1-24-api-changes)
74 75
 1.11.x          | [1.23](docker_remote_api_v1.23.md) | [API changes](docker_remote_api.md#v1-23-api-changes)
... ...
@@ -137,6 +138,11 @@ Running `docker rmi` emits an **untag** event when removing an image name.  The
137 137
 
138 138
 This section lists each version from latest to oldest.  Each listing includes a link to the full documentation set and the changes relevant in that release.
139 139
 
140
+### v1.26 API changes
141
+
142
+[Docker Remote API v1.26](docker_remote_api_v1.26.md) documentation
143
+
144
+
140 145
 ### v1.25 API changes
141 146
 
142 147
 [Docker Remote API v1.25](docker_remote_api_v1.25.md) documentation
143 148
new file mode 100644
... ...
@@ -0,0 +1,6148 @@
0
+---
1
+title: "Remote API v1.26"
2
+description: "API Documentation for Docker"
3
+keywords: "API, Docker, rcli, REST, documentation"
4
+---
5
+
6
+<!-- This file is maintained within the docker/docker Github
7
+     repository at https://github.com/docker/docker/. Make all
8
+     pull requests against that repo. If you see this file in
9
+     another repository, consider it read-only there, as it will
10
+     periodically be overwritten by the definitive file. Pull
11
+     requests which include edits to this file in other repositories
12
+     will be rejected.
13
+-->
14
+
15
+# Docker Remote API v1.26
16
+
17
+# 1. Brief introduction
18
+
19
+ - The Remote API has replaced `rcli`.
20
+ - The daemon listens on `unix:///var/run/docker.sock` but you can
21
+   [Bind Docker to another host/port or a Unix socket](../commandline/dockerd.md#bind-docker-to-another-host-port-or-a-unix-socket).
22
+ - The API tends to be REST. However, for some complex commands, like `attach`
23
+   or `pull`, the HTTP connection is hijacked to transport `stdout`,
24
+   `stdin` and `stderr`.
25
+
26
+# 2. Errors
27
+
28
+The Remote 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:
29
+
30
+    {
31
+        "message": "page not found"
32
+    }
33
+
34
+The status codes that are returned for each endpoint are specified in the endpoint documentation below.
35
+
36
+# 3. Endpoints
37
+
38
+## 3.1 Containers
39
+
40
+### List containers
41
+
42
+`GET /containers/json`
43
+
44
+List containers
45
+
46
+**Example request**:
47
+
48
+    GET /v1.26/containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1
49
+
50
+**Example response**:
51
+
52
+    HTTP/1.1 200 OK
53
+    Content-Type: application/json
54
+
55
+    [
56
+         {
57
+                 "Id": "8dfafdbc3a40",
58
+                 "Names":["/boring_feynman"],
59
+                 "Image": "ubuntu:latest",
60
+                 "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82",
61
+                 "Command": "echo 1",
62
+                 "Created": 1367854155,
63
+                 "State": "Exited",
64
+                 "Status": "Exit 0",
65
+                 "Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}],
66
+                 "Labels": {
67
+                         "com.example.vendor": "Acme",
68
+                         "com.example.license": "GPL",
69
+                         "com.example.version": "1.0"
70
+                 },
71
+                 "SizeRw": 12288,
72
+                 "SizeRootFs": 0,
73
+                 "HostConfig": {
74
+                         "NetworkMode": "default"
75
+                 },
76
+                 "NetworkSettings": {
77
+                         "Networks": {
78
+                                 "bridge": {
79
+                                          "IPAMConfig": null,
80
+                                          "Links": null,
81
+                                          "Aliases": null,
82
+                                          "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812",
83
+                                          "EndpointID": "2cdc4edb1ded3631c81f57966563e5c8525b81121bb3706a9a9a3ae102711f3f",
84
+                                          "Gateway": "172.17.0.1",
85
+                                          "IPAddress": "172.17.0.2",
86
+                                          "IPPrefixLen": 16,
87
+                                          "IPv6Gateway": "",
88
+                                          "GlobalIPv6Address": "",
89
+                                          "GlobalIPv6PrefixLen": 0,
90
+                                          "MacAddress": "02:42:ac:11:00:02"
91
+                                  }
92
+                         }
93
+                 },
94
+                 "Mounts": [
95
+                         {
96
+                                  "Name": "fac362...80535",
97
+                                  "Source": "/data",
98
+                                  "Destination": "/data",
99
+                                  "Driver": "local",
100
+                                  "Mode": "ro,Z",
101
+                                  "RW": false,
102
+                                  "Propagation": ""
103
+                         }
104
+                 ]
105
+         },
106
+         {
107
+                 "Id": "9cd87474be90",
108
+                 "Names":["/coolName"],
109
+                 "Image": "ubuntu:latest",
110
+                 "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82",
111
+                 "Command": "echo 222222",
112
+                 "Created": 1367854155,
113
+                 "State": "Exited",
114
+                 "Status": "Exit 0",
115
+                 "Ports": [],
116
+                 "Labels": {},
117
+                 "SizeRw": 12288,
118
+                 "SizeRootFs": 0,
119
+                 "HostConfig": {
120
+                         "NetworkMode": "default"
121
+                 },
122
+                 "NetworkSettings": {
123
+                         "Networks": {
124
+                                 "bridge": {
125
+                                          "IPAMConfig": null,
126
+                                          "Links": null,
127
+                                          "Aliases": null,
128
+                                          "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812",
129
+                                          "EndpointID": "88eaed7b37b38c2a3f0c4bc796494fdf51b270c2d22656412a2ca5d559a64d7a",
130
+                                          "Gateway": "172.17.0.1",
131
+                                          "IPAddress": "172.17.0.8",
132
+                                          "IPPrefixLen": 16,
133
+                                          "IPv6Gateway": "",
134
+                                          "GlobalIPv6Address": "",
135
+                                          "GlobalIPv6PrefixLen": 0,
136
+                                          "MacAddress": "02:42:ac:11:00:08"
137
+                                  }
138
+                         }
139
+                 },
140
+                 "Mounts": []
141
+         },
142
+         {
143
+                 "Id": "3176a2479c92",
144
+                 "Names":["/sleepy_dog"],
145
+                 "Image": "ubuntu:latest",
146
+                 "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82",
147
+                 "Command": "echo 3333333333333333",
148
+                 "Created": 1367854154,
149
+                 "State": "Exited",
150
+                 "Status": "Exit 0",
151
+                 "Ports":[],
152
+                 "Labels": {},
153
+                 "SizeRw":12288,
154
+                 "SizeRootFs":0,
155
+                 "HostConfig": {
156
+                         "NetworkMode": "default"
157
+                 },
158
+                 "NetworkSettings": {
159
+                         "Networks": {
160
+                                 "bridge": {
161
+                                          "IPAMConfig": null,
162
+                                          "Links": null,
163
+                                          "Aliases": null,
164
+                                          "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812",
165
+                                          "EndpointID": "8b27c041c30326d59cd6e6f510d4f8d1d570a228466f956edf7815508f78e30d",
166
+                                          "Gateway": "172.17.0.1",
167
+                                          "IPAddress": "172.17.0.6",
168
+                                          "IPPrefixLen": 16,
169
+                                          "IPv6Gateway": "",
170
+                                          "GlobalIPv6Address": "",
171
+                                          "GlobalIPv6PrefixLen": 0,
172
+                                          "MacAddress": "02:42:ac:11:00:06"
173
+                                  }
174
+                         }
175
+                 },
176
+                 "Mounts": []
177
+         },
178
+         {
179
+                 "Id": "4cb07b47f9fb",
180
+                 "Names":["/running_cat"],
181
+                 "Image": "ubuntu:latest",
182
+                 "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82",
183
+                 "Command": "echo 444444444444444444444444444444444",
184
+                 "Created": 1367854152,
185
+                 "State": "Exited",
186
+                 "Status": "Exit 0",
187
+                 "Ports": [],
188
+                 "Labels": {},
189
+                 "SizeRw": 12288,
190
+                 "SizeRootFs": 0,
191
+                 "HostConfig": {
192
+                         "NetworkMode": "default"
193
+                 },
194
+                 "NetworkSettings": {
195
+                         "Networks": {
196
+                                 "bridge": {
197
+                                          "IPAMConfig": null,
198
+                                          "Links": null,
199
+                                          "Aliases": null,
200
+                                          "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812",
201
+                                          "EndpointID": "d91c7b2f0644403d7ef3095985ea0e2370325cd2332ff3a3225c4247328e66e9",
202
+                                          "Gateway": "172.17.0.1",
203
+                                          "IPAddress": "172.17.0.5",
204
+                                          "IPPrefixLen": 16,
205
+                                          "IPv6Gateway": "",
206
+                                          "GlobalIPv6Address": "",
207
+                                          "GlobalIPv6PrefixLen": 0,
208
+                                          "MacAddress": "02:42:ac:11:00:05"
209
+                                  }
210
+                         }
211
+                 },
212
+                 "Mounts": []
213
+         }
214
+    ]
215
+
216
+**Query parameters**:
217
+
218
+-   **all** – 1/True/true or 0/False/false, Show all containers.
219
+        Only running containers are shown by default (i.e., this defaults to false)
220
+-   **limit** – Show `limit` last created
221
+        containers, include non-running ones.
222
+-   **since** – Show only containers created since Id, include
223
+        non-running ones.
224
+-   **before** – Show only containers created before Id, include
225
+        non-running ones.
226
+-   **size** – 1/True/true or 0/False/false, Show the containers
227
+        sizes
228
+-   **filters** - a JSON encoded value of the filters (a `map[string][]string`) to process on the containers list. Available filters:
229
+  -   `exited=<int>`; -- containers with exit code of  `<int>` ;
230
+  -   `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`)
231
+  -   `label=key` or `label="key=value"` of a container label
232
+  -   `isolation=`(`default`|`process`|`hyperv`)   (Windows daemon only)
233
+      `id=<ID>` a container's ID
234
+      `name=<name>` a container's name
235
+      `is-task=`(`true`|`false`)
236
+  -   `ancestor`=(`<image-name>[:<tag>]`,  `<image id>` or `<image@digest>`)
237
+  -   `before`=(`<container id>` or `<container name>`)
238
+  -   `since`=(`<container id>` or `<container name>`)
239
+  -   `volume`=(`<volume name>` or `<mount point destination>`)
240
+  -   `network`=(`<network id>` or `<network name>`)
241
+  -   `health`=(`starting`|`healthy`|`unhealthy`|`none`)
242
+
243
+**Status codes**:
244
+
245
+-   **200** – no error
246
+-   **400** – bad parameter
247
+-   **500** – server error
248
+
249
+### Create a container
250
+
251
+`POST /containers/create`
252
+
253
+Create a container
254
+
255
+**Example request**:
256
+
257
+    POST /v1.26/containers/create HTTP/1.1
258
+    Content-Type: application/json
259
+
260
+    {
261
+           "Hostname": "",
262
+           "Domainname": "",
263
+           "User": "",
264
+           "AttachStdin": false,
265
+           "AttachStdout": true,
266
+           "AttachStderr": true,
267
+           "Tty": false,
268
+           "OpenStdin": false,
269
+           "StdinOnce": false,
270
+           "Env": [
271
+                   "FOO=bar",
272
+                   "BAZ=quux"
273
+           ],
274
+           "Cmd": [
275
+                   "date"
276
+           ],
277
+           "Entrypoint": "",
278
+           "Image": "ubuntu",
279
+           "Labels": {
280
+                   "com.example.vendor": "Acme",
281
+                   "com.example.license": "GPL",
282
+                   "com.example.version": "1.0"
283
+           },
284
+           "Volumes": {
285
+             "/volumes/data": {}
286
+           },
287
+           "WorkingDir": "",
288
+           "NetworkDisabled": false,
289
+           "MacAddress": "12:34:56:78:9a:bc",
290
+           "ExposedPorts": {
291
+                   "22/tcp": {}
292
+           },
293
+           "StopSignal": "SIGTERM",
294
+           "StopTimeout": 10,
295
+           "HostConfig": {
296
+             "Binds": ["/tmp:/tmp"],
297
+             "Links": ["redis3:redis"],
298
+             "Memory": 0,
299
+             "MemorySwap": 0,
300
+             "MemoryReservation": 0,
301
+             "KernelMemory": 0,
302
+             "NanoCPUs": 500000,
303
+             "CpuCount": 4,
304
+             "CpuPercent": 80,
305
+             "CpuShares": 512,
306
+             "CpuPeriod": 100000,
307
+             "CpuRealtimePeriod": 1000000,
308
+             "CpuRealtimeRuntime": 10000,
309
+             "CpuQuota": 50000,
310
+             "CpusetCpus": "0,1",
311
+             "CpusetMems": "0,1",
312
+             "IOMaximumBandwidth": 0,
313
+             "IOMaximumIOps": 0,
314
+             "BlkioWeight": 300,
315
+             "BlkioWeightDevice": [{}],
316
+             "BlkioDeviceReadBps": [{}],
317
+             "BlkioDeviceReadIOps": [{}],
318
+             "BlkioDeviceWriteBps": [{}],
319
+             "BlkioDeviceWriteIOps": [{}],
320
+             "MemorySwappiness": 60,
321
+             "OomKillDisable": false,
322
+             "OomScoreAdj": 500,
323
+             "PidMode": "",
324
+             "PidsLimit": -1,
325
+             "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
326
+             "PublishAllPorts": false,
327
+             "Privileged": false,
328
+             "ReadonlyRootfs": false,
329
+             "Dns": ["8.8.8.8"],
330
+             "DnsOptions": [""],
331
+             "DnsSearch": [""],
332
+             "ExtraHosts": null,
333
+             "VolumesFrom": ["parent", "other:ro"],
334
+             "CapAdd": ["NET_ADMIN"],
335
+             "CapDrop": ["MKNOD"],
336
+             "GroupAdd": ["newgroup"],
337
+             "RestartPolicy": { "Name": "", "MaximumRetryCount": 0 },
338
+             "AutoRemove": true,
339
+             "NetworkMode": "bridge",
340
+             "Devices": [],
341
+             "Sysctls": { "net.ipv4.ip_forward": "1" },
342
+             "Ulimits": [{}],
343
+             "LogConfig": { "Type": "json-file", "Config": {} },
344
+             "SecurityOpt": [],
345
+             "StorageOpt": {},
346
+             "CgroupParent": "",
347
+             "VolumeDriver": "",
348
+             "ShmSize": 67108864,
349
+             "Mounts": []
350
+          },
351
+          "NetworkingConfig": {
352
+              "EndpointsConfig": {
353
+                  "isolated_nw" : {
354
+                      "IPAMConfig": {
355
+                          "IPv4Address":"172.20.30.33",
356
+                          "IPv6Address":"2001:db8:abcd::3033",
357
+                          "LinkLocalIPs":["169.254.34.68", "fe80::3468"]
358
+                      },
359
+                      "Links":["container_1", "container_2"],
360
+                      "Aliases":["server_x", "server_y"]
361
+                  }
362
+              }
363
+          }
364
+      }
365
+
366
+**Example response**:
367
+
368
+      HTTP/1.1 201 Created
369
+      Content-Type: application/json
370
+
371
+      {
372
+           "Id":"e90e34656806",
373
+           "Warnings":[]
374
+      }
375
+
376
+**JSON parameters**:
377
+
378
+-   **Hostname** - A string value containing the hostname to use for the
379
+      container. This must be a valid RFC 1123 hostname.
380
+-   **Domainname** - A string value containing the domain name to use
381
+      for the container.
382
+-   **User** - A string value specifying the user inside the container.
383
+-   **AttachStdin** - Boolean value, attaches to `stdin`.
384
+-   **AttachStdout** - Boolean value, attaches to `stdout`.
385
+-   **AttachStderr** - Boolean value, attaches to `stderr`.
386
+-   **Tty** - Boolean value, Attach standard streams to a `tty`, including `stdin` if it is not closed.
387
+-   **OpenStdin** - Boolean value, opens `stdin`,
388
+-   **StdinOnce** - Boolean value, close `stdin` after the 1 attached client disconnects.
389
+-   **Env** - A list of environment variables in the form of `["VAR=value", ...]`
390
+-   **Labels** - Adds a map of labels to a container. To specify a map: `{"key":"value", ... }`
391
+-   **Cmd** - Command to run specified as a string or an array of strings.
392
+-   **Entrypoint** - Set the entry point for the container as a string or an array
393
+      of strings. If the array consists of exactly one empty string (`[""]`) then the entry point
394
+      is reset to system default (i.e., the entry point used by docker when there is no `ENTRYPOINT`
395
+      instruction in the Dockerfile).
396
+-   **Image** - A string specifying the image name to use for the container.
397
+-   **Volumes** - An object mapping mount point paths (strings) inside the
398
+      container to empty objects.
399
+-   **WorkingDir** - A string specifying the working directory for commands to
400
+      run in.
401
+-   **NetworkDisabled** - Boolean value, when true disables networking for the
402
+      container
403
+-   **ExposedPorts** - An object mapping ports to an empty object in the form of:
404
+      `"ExposedPorts": { "<port>/<tcp|udp>: {}" }`
405
+-   **StopSignal** - Signal to stop a container as a string or unsigned integer. `SIGTERM` by default.
406
+-   **StopTimeout** - Timeout (in seconds) to stop a container. 10 by default.
407
+-   **HostConfig**
408
+    -   **Binds** – A list of volume bindings for this container. Each volume binding is a string in one of these forms:
409
+           + `host-src:container-dest` to bind-mount a host path into the
410
+             container. Both `host-src`, and `container-dest` must be an
411
+             _absolute_ path.
412
+           + `host-src:container-dest:ro` to make the bind-mount read-only
413
+             inside the container. Both `host-src`, and `container-dest` must be
414
+             an _absolute_ path.
415
+           + `volume-name:container-dest` to bind-mount a volume managed by a
416
+             volume driver into the container. `container-dest` must be an
417
+             _absolute_ path.
418
+           + `volume-name:container-dest:ro` to mount the volume read-only
419
+             inside the container.  `container-dest` must be an _absolute_ path.
420
+    -   **Links** - A list of links for the container. Each link entry should be
421
+          in the form of `container_name:alias`.
422
+    -   **Memory** - Memory limit in bytes.
423
+    -   **MemorySwap** - Total memory limit (memory + swap); set `-1` to enable unlimited swap.
424
+          You must use this with `memory` and make the swap value larger than `memory`.
425
+    -   **MemoryReservation** - Memory soft limit in bytes.
426
+    -   **KernelMemory** - Kernel memory limit in bytes.
427
+    -   **NanoCPUs** - CPU quota in units of 10<sup>-9</sup> CPUs. The default value is 0, which means there is no limit.
428
+    -   **CpuCount** - An integer value containing the number of usable CPUs.
429
+          Windows daemon only. On Windows Server containers,
430
+          the processor resource controls are mutually exclusive, the order of precedence
431
+          is CPUCount first, then CPUShares, and CPUPercent last.
432
+    -   **CpuPercent** - An integer value containing the usable percentage of
433
+          the available CPUs. Windows daemon only. On Windows Server containers,
434
+          the processor resource controls are mutually exclusive, the order of precedence
435
+          is CPUCount first, then CPUShares, and CPUPercent last.
436
+    -   **CpuShares** - An integer value containing the container's CPU Shares
437
+          (ie. the relative weight vs other containers).
438
+    -   **CpuPeriod** - The length of a CPU period in microseconds.
439
+    -   **CpuRealtimePeriod** - The length of a CPU real-time period in microseconds (0=no time allocated for rt tasks)
440
+    -   **CpuRealtimeRuntime** - The length of a CPU real-time runtime in microseconds (0=no time allocated for rt tasks)
441
+    -   **CpuQuota** - Microseconds of CPU time that the container can get in a CPU period.
442
+    -   **CpusetCpus** - String value containing the `cgroups CpusetCpus` to use.
443
+    -   **CpusetMems** - Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.
444
+    -   **IOMaximumBandwidth** - Maximum IO absolute rate in terms of IOps.
445
+    -   **IOMaximumIOps** - Maximum IO absolute rate in terms of bytes per second.
446
+    -   **BlkioWeight** - Block IO weight (relative weight) accepts a weight value between 10 and 1000.
447
+    -   **BlkioWeightDevice** - Block IO weight (relative device weight) in the form of:        `"BlkioWeightDevice": [{"Path": "device_path", "Weight": weight}]`
448
+    -   **BlkioDeviceReadBps** - Limit read rate (bytes per second) from a device in the form of:	`"BlkioDeviceReadBps": [{"Path": "device_path", "Rate": rate}]`, for example:
449
+        `"BlkioDeviceReadBps": [{"Path": "/dev/sda", "Rate": "1024"}]"`
450
+    -   **BlkioDeviceWriteBps** - Limit write rate (bytes per second) to a device in the form of:	`"BlkioDeviceWriteBps": [{"Path": "device_path", "Rate": rate}]`, for example:
451
+        `"BlkioDeviceWriteBps": [{"Path": "/dev/sda", "Rate": "1024"}]"`
452
+    -   **BlkioDeviceReadIOps** - Limit read rate (IO per second) from a device in the form of:	`"BlkioDeviceReadIOps": [{"Path": "device_path", "Rate": rate}]`, for example:
453
+        `"BlkioDeviceReadIOps": [{"Path": "/dev/sda", "Rate": "1000"}]`
454
+    -   **BlkioDeviceWiiteIOps** - Limit write rate (IO per second) to a device in the form of:	`"BlkioDeviceWriteIOps": [{"Path": "device_path", "Rate": rate}]`, for example:
455
+        `"BlkioDeviceWriteIOps": [{"Path": "/dev/sda", "Rate": "1000"}]`
456
+    -   **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
457
+    -   **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not.
458
+    -   **OomScoreAdj** - An integer value containing the score given to the container in order to tune OOM killer preferences.
459
+    -   **PidMode** - Set the PID (Process) Namespace mode for the container;
460
+          `"container:<name|id>"`: joins another container's PID namespace
461
+          `"host"`: use the host's PID namespace inside the container
462
+    -   **PidsLimit** - Tune a container's pids limit. Set -1 for unlimited.
463
+    -   **PortBindings** - A map of exposed container ports and the host port they
464
+          should map to. A JSON object in the form
465
+          `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }`
466
+          Take note that `port` is specified as a string and not an integer value.
467
+    -   **PublishAllPorts** - Allocates a random host port for all of a container's
468
+          exposed ports. Specified as a boolean value.
469
+    -   **Privileged** - Gives the container full access to the host. Specified as
470
+          a boolean value.
471
+    -   **ReadonlyRootfs** - Mount the container's root filesystem as read only.
472
+          Specified as a boolean value.
473
+    -   **Dns** - A list of DNS servers for the container to use.
474
+    -   **DnsOptions** - A list of DNS options
475
+    -   **DnsSearch** - A list of DNS search domains
476
+    -   **ExtraHosts** - A list of hostnames/IP mappings to add to the
477
+        container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`.
478
+    -   **VolumesFrom** - A list of volumes to inherit from another container.
479
+          Specified in the form `<container name>[:<ro|rw>]`
480
+    -   **CapAdd** - A list of kernel capabilities to add to the container.
481
+    -   **Capdrop** - A list of kernel capabilities to drop from the container.
482
+    -   **GroupAdd** - A list of additional groups that the container process will run as
483
+    -   **RestartPolicy** – The behavior to apply when the container exits.  The
484
+            value is an object with a `Name` property of either `"always"` to
485
+            always restart, `"unless-stopped"` to restart always except when
486
+            user has manually stopped the container or `"on-failure"` to restart only when the container
487
+            exit code is non-zero.  If `on-failure` is used, `MaximumRetryCount`
488
+            controls the number of times to retry before giving up.
489
+            The default is not to restart. (optional)
490
+            An ever increasing delay (double the previous delay, starting at 100mS)
491
+            is added before each restart to prevent flooding the server.
492
+    -   **AutoRemove** - Boolean value, set to `true` to automatically remove the container on daemon side
493
+            when the container's process exits. Note that `RestartPolicy` other than `none` is exclusive to `AutoRemove`.
494
+    -   **UsernsMode**  - Sets the usernamespace mode for the container when usernamespace remapping option is enabled.
495
+           supported values are: `host`.
496
+    -   **NetworkMode** - Sets the networking mode for the container. Supported
497
+          standard values are: `bridge`, `host`, `none`, and `container:<name|id>`. Any other value is taken
498
+          as a custom network's name to which this container should connect to.
499
+    -   **Devices** - A list of devices to add to the container specified as a JSON object in the
500
+      form
501
+          `{ "PathOnHost": "/dev/deviceName", "PathInContainer": "/dev/deviceName", "CgroupPermissions": "mrw"}`
502
+    -   **Ulimits** - A list of ulimits to set in the container, specified as
503
+          `{ "Name": <name>, "Soft": <soft limit>, "Hard": <hard limit> }`, for example:
504
+          `Ulimits: { "Name": "nofile", "Soft": 1024, "Hard": 2048 }`
505
+    -   **Sysctls** - A list of kernel parameters (sysctls) to set in the container, specified as
506
+          `{ <name>: <Value> }`, for example:
507
+	  `{ "net.ipv4.ip_forward": "1" }`
508
+    -   **SecurityOpt**: A list of string values to customize labels for MLS
509
+        systems, such as SELinux.
510
+    -   **StorageOpt**: Storage driver options per container. Options can be passed in the form
511
+        `{"size":"120G"}`
512
+    -   **LogConfig** - Log configuration for the container, specified as a JSON object in the form
513
+          `{ "Type": "<driver_name>", "Config": {"key1": "val1"}}`.
514
+          Available types: `json-file`, `syslog`, `journald`, `gelf`, `fluentd`, `awslogs`, `splunk`, `etwlogs`, `none`.
515
+          `json-file` logging driver.
516
+    -   **CgroupParent** - 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.
517
+    -   **VolumeDriver** - Driver that this container users to mount volumes.
518
+    -   **ShmSize** - Size of `/dev/shm` in bytes. The size must be greater than 0.  If omitted the system uses 64MB.
519
+    -   **Mounts** – Specification for mounts to be added to the container.
520
+        - **Target** – Container path.
521
+        - **Source** – Mount source (e.g. a volume name, a host path).
522
+        - **Type** – The mount type (`bind`, `volume`, or `tmpfs`).
523
+          Available types (for the `Type` field):
524
+          - **bind** - Mounts a file or directory from the host into the container. Must exist prior to creating the container.
525
+          - **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.
526
+          - **tmpfs** - Create a tmpfs with the given options. The mount source cannot be specified for tmpfs.
527
+        - **ReadOnly** – A boolean indicating whether the mount should be read-only.
528
+        - **BindOptions** - Optional configuration for the `bind` type.
529
+          - **Propagation** – A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`.
530
+        - **VolumeOptions** – Optional configuration for the `volume` type.
531
+            - **NoCopy** – A boolean indicating if volume should be
532
+              populated with the data from the target. (Default false)
533
+            - **Labels** – User-defined name and labels for the volume as key/value pairs: `{"name": "value"}`
534
+            - **DriverConfig** – Map of driver-specific options.
535
+              - **Name** - Name of the driver to use to create the volume.
536
+              - **Options** - key/value map of driver specific options.
537
+        - **TmpfsOptions** – Optional configuration for the `tmpfs` type.
538
+            - **SizeBytes** – The size for the tmpfs mount in bytes.
539
+            - **Mode** – The permission mode for the tmpfs mount in an integer.
540
+
541
+
542
+**Query parameters**:
543
+
544
+-   **name** – Assign the specified name to the container. Must
545
+    match `/?[a-zA-Z0-9_-]+`.
546
+
547
+**Status codes**:
548
+
549
+-   **201** – no error
550
+-   **400** – bad parameter
551
+-   **404** – no such container
552
+-   **406** – impossible to attach (container not running)
553
+-   **409** – conflict
554
+-   **500** – server error
555
+
556
+### Inspect a container
557
+
558
+`GET /containers/(id or name)/json`
559
+
560
+Return low-level information on the container `id`
561
+
562
+**Example request**:
563
+
564
+      GET /v1.26/containers/4fa6e0f0c678/json HTTP/1.1
565
+
566
+**Example response**:
567
+
568
+    HTTP/1.1 200 OK
569
+    Content-Type: application/json
570
+
571
+	{
572
+		"AppArmorProfile": "",
573
+		"Args": [
574
+			"-c",
575
+			"exit 9"
576
+		],
577
+		"Config": {
578
+			"AttachStderr": true,
579
+			"AttachStdin": false,
580
+			"AttachStdout": true,
581
+			"Cmd": [
582
+				"/bin/sh",
583
+				"-c",
584
+				"exit 9"
585
+			],
586
+			"Domainname": "",
587
+			"Entrypoint": null,
588
+			"Env": [
589
+				"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
590
+			],
591
+			"ExposedPorts": null,
592
+			"Hostname": "ba033ac44011",
593
+			"Image": "ubuntu",
594
+			"Labels": {
595
+				"com.example.vendor": "Acme",
596
+				"com.example.license": "GPL",
597
+				"com.example.version": "1.0"
598
+			},
599
+			"MacAddress": "",
600
+			"NetworkDisabled": false,
601
+			"OnBuild": null,
602
+			"OpenStdin": false,
603
+			"StdinOnce": false,
604
+			"Tty": false,
605
+			"User": "",
606
+			"Volumes": {
607
+				"/volumes/data": {}
608
+			},
609
+			"WorkingDir": "",
610
+			"StopSignal": "SIGTERM",
611
+			"StopTimeout": 10
612
+		},
613
+		"Created": "2015-01-06T15:47:31.485331387Z",
614
+		"Driver": "devicemapper",
615
+		"ExecIDs": null,
616
+		"HostConfig": {
617
+			"Binds": null,
618
+			"IOMaximumBandwidth": 0,
619
+			"IOMaximumIOps": 0,
620
+			"BlkioWeight": 0,
621
+			"BlkioWeightDevice": [{}],
622
+			"BlkioDeviceReadBps": [{}],
623
+			"BlkioDeviceWriteBps": [{}],
624
+			"BlkioDeviceReadIOps": [{}],
625
+			"BlkioDeviceWriteIOps": [{}],
626
+			"CapAdd": null,
627
+			"CapDrop": null,
628
+			"ContainerIDFile": "",
629
+			"CpusetCpus": "",
630
+			"CpusetMems": "",
631
+			"CpuCount": 4,
632
+			"CpuPercent": 80,
633
+			"CpuShares": 0,
634
+			"CpuPeriod": 100000,
635
+			"CpuRealtimePeriod": 1000000,
636
+			"CpuRealtimeRuntime": 10000,
637
+			"Devices": [],
638
+			"Dns": null,
639
+			"DnsOptions": null,
640
+			"DnsSearch": null,
641
+			"ExtraHosts": null,
642
+			"IpcMode": "",
643
+			"Links": null,
644
+			"LxcConf": [],
645
+			"Memory": 0,
646
+			"MemorySwap": 0,
647
+			"MemoryReservation": 0,
648
+			"KernelMemory": 0,
649
+			"OomKillDisable": false,
650
+			"OomScoreAdj": 500,
651
+			"NetworkMode": "bridge",
652
+			"PidMode": "",
653
+			"PortBindings": {},
654
+			"Privileged": false,
655
+			"ReadonlyRootfs": false,
656
+			"PublishAllPorts": false,
657
+			"RestartPolicy": {
658
+				"MaximumRetryCount": 2,
659
+				"Name": "on-failure"
660
+			},
661
+			"AutoRemove": true,
662
+			"LogConfig": {
663
+				"Config": null,
664
+				"Type": "json-file"
665
+			},
666
+			"SecurityOpt": null,
667
+			"Sysctls": {
668
+			        "net.ipv4.ip_forward": "1"
669
+			},
670
+			"StorageOpt": null,
671
+			"VolumesFrom": null,
672
+			"Ulimits": [{}],
673
+			"VolumeDriver": "",
674
+			"ShmSize": 67108864,
675
+			"Mounts": []
676
+		},
677
+		"HostnamePath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname",
678
+		"HostsPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts",
679
+		"LogPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log",
680
+		"Id": "ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39",
681
+		"Image": "04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2",
682
+		"MountLabel": "",
683
+		"Name": "/boring_euclid",
684
+		"NetworkSettings": {
685
+			"Bridge": "",
686
+			"SandboxID": "",
687
+			"HairpinMode": false,
688
+			"LinkLocalIPv6Address": "",
689
+			"LinkLocalIPv6PrefixLen": 0,
690
+			"Ports": null,
691
+			"SandboxKey": "",
692
+			"SecondaryIPAddresses": null,
693
+			"SecondaryIPv6Addresses": null,
694
+			"EndpointID": "",
695
+			"Gateway": "",
696
+			"GlobalIPv6Address": "",
697
+			"GlobalIPv6PrefixLen": 0,
698
+			"IPAddress": "",
699
+			"IPPrefixLen": 0,
700
+			"IPv6Gateway": "",
701
+			"MacAddress": "",
702
+			"Networks": {
703
+				"bridge": {
704
+					"NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812",
705
+					"EndpointID": "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d",
706
+					"Gateway": "172.17.0.1",
707
+					"IPAddress": "172.17.0.2",
708
+					"IPPrefixLen": 16,
709
+					"IPv6Gateway": "",
710
+					"GlobalIPv6Address": "",
711
+					"GlobalIPv6PrefixLen": 0,
712
+					"MacAddress": "02:42:ac:12:00:02"
713
+				}
714
+			}
715
+		},
716
+		"Path": "/bin/sh",
717
+		"ProcessLabel": "",
718
+		"ResolvConfPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf",
719
+		"RestartCount": 1,
720
+		"State": {
721
+			"Error": "",
722
+			"ExitCode": 9,
723
+			"FinishedAt": "2015-01-06T15:47:32.080254511Z",
724
+			"OOMKilled": false,
725
+			"Dead": false,
726
+			"Paused": false,
727
+			"Pid": 0,
728
+			"Restarting": false,
729
+			"Running": true,
730
+			"StartedAt": "2015-01-06T15:47:32.072697474Z",
731
+			"Status": "running"
732
+		},
733
+		"Mounts": [
734
+			{
735
+				"Name": "fac362...80535",
736
+				"Source": "/data",
737
+				"Destination": "/data",
738
+				"Driver": "local",
739
+				"Mode": "ro,Z",
740
+				"RW": false,
741
+				"Propagation": ""
742
+			}
743
+		]
744
+	}
745
+
746
+**Example request, with size information**:
747
+
748
+    GET /v1.26/containers/4fa6e0f0c678/json?size=1 HTTP/1.1
749
+
750
+**Example response, with size information**:
751
+
752
+    HTTP/1.1 200 OK
753
+    Content-Type: application/json
754
+
755
+    {
756
+    ....
757
+    "SizeRw": 0,
758
+    "SizeRootFs": 972,
759
+    ....
760
+    }
761
+
762
+**Query parameters**:
763
+
764
+-   **size** – 1/True/true or 0/False/false, return container size information. Default is `false`.
765
+
766
+**Status codes**:
767
+
768
+-   **200** – no error
769
+-   **404** – no such container
770
+-   **500** – server error
771
+
772
+### List processes running inside a container
773
+
774
+`GET /containers/(id or name)/top`
775
+
776
+List processes running inside the container `id`. On Unix systems this
777
+is done by running the `ps` command. This endpoint is not
778
+supported on Windows.
779
+
780
+**Example request**:
781
+
782
+    GET /v1.26/containers/4fa6e0f0c678/top HTTP/1.1
783
+
784
+**Example response**:
785
+
786
+    HTTP/1.1 200 OK
787
+    Content-Type: application/json
788
+
789
+    {
790
+       "Titles" : [
791
+         "UID", "PID", "PPID", "C", "STIME", "TTY", "TIME", "CMD"
792
+       ],
793
+       "Processes" : [
794
+         [
795
+           "root", "13642", "882", "0", "17:03", "pts/0", "00:00:00", "/bin/bash"
796
+         ],
797
+         [
798
+           "root", "13735", "13642", "0", "17:06", "pts/0", "00:00:00", "sleep 10"
799
+         ]
800
+       ]
801
+    }
802
+
803
+**Example request**:
804
+
805
+    GET /v1.26/containers/4fa6e0f0c678/top?ps_args=aux HTTP/1.1
806
+
807
+**Example response**:
808
+
809
+    HTTP/1.1 200 OK
810
+    Content-Type: application/json
811
+
812
+    {
813
+      "Titles" : [
814
+        "USER","PID","%CPU","%MEM","VSZ","RSS","TTY","STAT","START","TIME","COMMAND"
815
+      ]
816
+      "Processes" : [
817
+        [
818
+          "root","13642","0.0","0.1","18172","3184","pts/0","Ss","17:03","0:00","/bin/bash"
819
+        ],
820
+        [
821
+          "root","13895","0.0","0.0","4348","692","pts/0","S+","17:15","0:00","sleep 10"
822
+        ]
823
+      ],
824
+    }
825
+
826
+**Query parameters**:
827
+
828
+-   **ps_args** – `ps` arguments to use (e.g., `aux`), defaults to `-ef`
829
+
830
+**Status codes**:
831
+
832
+-   **200** – no error
833
+-   **404** – no such container
834
+-   **500** – server error
835
+
836
+### Get container logs
837
+
838
+`GET /containers/(id or name)/logs`
839
+
840
+Get `stdout` and `stderr` logs from the container ``id``
841
+
842
+> **Note**:
843
+> This endpoint works only for containers with the `json-file` or `journald` logging drivers.
844
+
845
+**Example request**:
846
+
847
+     GET /v1.26/containers/4fa6e0f0c678/logs?stderr=1&stdout=1&timestamps=1&follow=1&tail=10&since=1428990821 HTTP/1.1
848
+
849
+**Example response**:
850
+
851
+     HTTP/1.1 101 UPGRADED
852
+     Content-Type: application/vnd.docker.raw-stream
853
+     Connection: Upgrade
854
+     Upgrade: tcp
855
+
856
+     {% raw %}
857
+     {{ STREAM }}
858
+     {% endraw %}
859
+
860
+**Query parameters**:
861
+
862
+-   **details** - 1/True/true or 0/False/flase, Show extra details provided to logs. Default `false`.
863
+-   **follow** – 1/True/true or 0/False/false, return stream. Default `false`.
864
+-   **stdout** – 1/True/true or 0/False/false, show `stdout` log. Default `false`.
865
+-   **stderr** – 1/True/true or 0/False/false, show `stderr` log. Default `false`.
866
+-   **since** – UNIX timestamp (integer) to filter logs. Specifying a timestamp
867
+    will only output log-entries since that timestamp. Default: 0 (unfiltered)
868
+-   **timestamps** – 1/True/true or 0/False/false, print timestamps for
869
+        every log line. Default `false`.
870
+-   **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all.
871
+
872
+**Status codes**:
873
+
874
+-   **101** – no error, hints proxy about hijacking
875
+-   **200** – no error, no upgrade header found
876
+-   **404** – no such container
877
+-   **500** – server error
878
+
879
+### Inspect changes on a container's filesystem
880
+
881
+`GET /containers/(id or name)/changes`
882
+
883
+Inspect changes on container `id`'s filesystem
884
+
885
+**Example request**:
886
+
887
+    GET /v1.26/containers/4fa6e0f0c678/changes HTTP/1.1
888
+
889
+**Example response**:
890
+
891
+    HTTP/1.1 200 OK
892
+    Content-Type: application/json
893
+
894
+    [
895
+         {
896
+                 "Path": "/dev",
897
+                 "Kind": 0
898
+         },
899
+         {
900
+                 "Path": "/dev/kmsg",
901
+                 "Kind": 1
902
+         },
903
+         {
904
+                 "Path": "/test",
905
+                 "Kind": 1
906
+         }
907
+    ]
908
+
909
+Values for `Kind`:
910
+
911
+- `0`: Modify
912
+- `1`: Add
913
+- `2`: Delete
914
+
915
+**Status codes**:
916
+
917
+-   **200** – no error
918
+-   **404** – no such container
919
+-   **500** – server error
920
+
921
+### Export a container
922
+
923
+`GET /containers/(id or name)/export`
924
+
925
+Export the contents of container `id`
926
+
927
+**Example request**:
928
+
929
+    GET /v1.26/containers/4fa6e0f0c678/export HTTP/1.1
930
+
931
+**Example response**:
932
+
933
+    HTTP/1.1 200 OK
934
+    Content-Type: application/octet-stream
935
+
936
+    {% raw %}
937
+    {{ TAR STREAM }}
938
+    {% endraw %}
939
+
940
+**Status codes**:
941
+
942
+-   **200** – no error
943
+-   **404** – no such container
944
+-   **500** – server error
945
+
946
+### Get container stats based on resource usage
947
+
948
+`GET /containers/(id or name)/stats`
949
+
950
+This endpoint returns a live stream of a container's resource usage statistics.
951
+
952
+**Example request**:
953
+
954
+    GET /v1.26/containers/redis1/stats HTTP/1.1
955
+
956
+**Example response**:
957
+
958
+      HTTP/1.1 200 OK
959
+      Content-Type: application/json
960
+
961
+      {
962
+         "read" : "2015-01-08T22:57:31.547920715Z",
963
+         "pids_stats": {
964
+            "current": 3
965
+         },
966
+         "networks": {
967
+                 "eth0": {
968
+                     "rx_bytes": 5338,
969
+                     "rx_dropped": 0,
970
+                     "rx_errors": 0,
971
+                     "rx_packets": 36,
972
+                     "tx_bytes": 648,
973
+                     "tx_dropped": 0,
974
+                     "tx_errors": 0,
975
+                     "tx_packets": 8
976
+                 },
977
+                 "eth5": {
978
+                     "rx_bytes": 4641,
979
+                     "rx_dropped": 0,
980
+                     "rx_errors": 0,
981
+                     "rx_packets": 26,
982
+                     "tx_bytes": 690,
983
+                     "tx_dropped": 0,
984
+                     "tx_errors": 0,
985
+                     "tx_packets": 9
986
+                 }
987
+         },
988
+         "memory_stats" : {
989
+            "stats" : {
990
+               "total_pgmajfault" : 0,
991
+               "cache" : 0,
992
+               "mapped_file" : 0,
993
+               "total_inactive_file" : 0,
994
+               "pgpgout" : 414,
995
+               "rss" : 6537216,
996
+               "total_mapped_file" : 0,
997
+               "writeback" : 0,
998
+               "unevictable" : 0,
999
+               "pgpgin" : 477,
1000
+               "total_unevictable" : 0,
1001
+               "pgmajfault" : 0,
1002
+               "total_rss" : 6537216,
1003
+               "total_rss_huge" : 6291456,
1004
+               "total_writeback" : 0,
1005
+               "total_inactive_anon" : 0,
1006
+               "rss_huge" : 6291456,
1007
+               "hierarchical_memory_limit" : 67108864,
1008
+               "total_pgfault" : 964,
1009
+               "total_active_file" : 0,
1010
+               "active_anon" : 6537216,
1011
+               "total_active_anon" : 6537216,
1012
+               "total_pgpgout" : 414,
1013
+               "total_cache" : 0,
1014
+               "inactive_anon" : 0,
1015
+               "active_file" : 0,
1016
+               "pgfault" : 964,
1017
+               "inactive_file" : 0,
1018
+               "total_pgpgin" : 477
1019
+            },
1020
+            "max_usage" : 6651904,
1021
+            "usage" : 6537216,
1022
+            "failcnt" : 0,
1023
+            "limit" : 67108864
1024
+         },
1025
+         "blkio_stats" : {},
1026
+         "cpu_stats" : {
1027
+            "cpu_usage" : {
1028
+               "percpu_usage" : [
1029
+                  8646879,
1030
+                  24472255,
1031
+                  36438778,
1032
+                  30657443
1033
+               ],
1034
+               "usage_in_usermode" : 50000000,
1035
+               "total_usage" : 100215355,
1036
+               "usage_in_kernelmode" : 30000000
1037
+            },
1038
+            "system_cpu_usage" : 739306590000000,
1039
+            "throttling_data" : {"periods":0,"throttled_periods":0,"throttled_time":0}
1040
+         },
1041
+         "precpu_stats" : {
1042
+            "cpu_usage" : {
1043
+               "percpu_usage" : [
1044
+                  8646879,
1045
+                  24350896,
1046
+                  36438778,
1047
+                  30657443
1048
+               ],
1049
+               "usage_in_usermode" : 50000000,
1050
+               "total_usage" : 100093996,
1051
+               "usage_in_kernelmode" : 30000000
1052
+            },
1053
+            "system_cpu_usage" : 9492140000000,
1054
+            "throttling_data" : {"periods":0,"throttled_periods":0,"throttled_time":0}
1055
+         }
1056
+      }
1057
+
1058
+The precpu_stats is the cpu statistic of last read, which is used for calculating the cpu usage percent. It is not the exact copy of the “cpu_stats” field.
1059
+
1060
+**Query parameters**:
1061
+
1062
+-   **stream** – 1/True/true or 0/False/false, pull stats once then disconnect. Default `true`.
1063
+
1064
+**Status codes**:
1065
+
1066
+-   **200** – no error
1067
+-   **404** – no such container
1068
+-   **500** – server error
1069
+
1070
+### Resize a container TTY
1071
+
1072
+`POST /containers/(id or name)/resize`
1073
+
1074
+Resize the TTY for container with  `id`. The unit is number of characters. You must restart the container for the resize to take effect.
1075
+
1076
+**Example request**:
1077
+
1078
+      POST /v1.26/containers/4fa6e0f0c678/resize?h=40&w=80 HTTP/1.1
1079
+
1080
+**Example response**:
1081
+
1082
+      HTTP/1.1 200 OK
1083
+      Content-Length: 0
1084
+      Content-Type: text/plain; charset=utf-8
1085
+
1086
+**Query parameters**:
1087
+
1088
+-   **h** – height of `tty` session
1089
+-   **w** – width
1090
+
1091
+**Status codes**:
1092
+
1093
+-   **200** – no error
1094
+-   **404** – No such container
1095
+-   **500** – Cannot resize container
1096
+
1097
+### Start a container
1098
+
1099
+`POST /containers/(id or name)/start`
1100
+
1101
+Start the container `id`
1102
+
1103
+**Example request**:
1104
+
1105
+    POST /v1.26/containers/e90e34656806/start HTTP/1.1
1106
+
1107
+**Example response**:
1108
+
1109
+    HTTP/1.1 204 No Content
1110
+
1111
+**Query parameters**:
1112
+
1113
+-   **detachKeys** – Override the key sequence for detaching a
1114
+        container. Format is a single character `[a-Z]` or `ctrl-<value>`
1115
+        where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`.
1116
+
1117
+**Status codes**:
1118
+
1119
+-   **204** – no error
1120
+-   **304** – container already started
1121
+-   **404** – no such container
1122
+-   **500** – server error
1123
+
1124
+### Stop a container
1125
+
1126
+`POST /containers/(id or name)/stop`
1127
+
1128
+Stop the container `id`
1129
+
1130
+**Example request**:
1131
+
1132
+    POST /v1.26/containers/e90e34656806/stop?t=5 HTTP/1.1
1133
+
1134
+**Example response**:
1135
+
1136
+    HTTP/1.1 204 No Content
1137
+
1138
+**Query parameters**:
1139
+
1140
+-   **t** – number of seconds to wait before killing the container
1141
+
1142
+**Status codes**:
1143
+
1144
+-   **204** – no error
1145
+-   **304** – container already stopped
1146
+-   **404** – no such container
1147
+-   **500** – server error
1148
+
1149
+### Restart a container
1150
+
1151
+`POST /containers/(id or name)/restart`
1152
+
1153
+Restart the container `id`
1154
+
1155
+**Example request**:
1156
+
1157
+    POST /v1.26/containers/e90e34656806/restart?t=5 HTTP/1.1
1158
+
1159
+**Example response**:
1160
+
1161
+    HTTP/1.1 204 No Content
1162
+
1163
+**Query parameters**:
1164
+
1165
+-   **t** – number of seconds to wait before killing the container
1166
+
1167
+**Status codes**:
1168
+
1169
+-   **204** – no error
1170
+-   **404** – no such container
1171
+-   **500** – server error
1172
+
1173
+### Kill a container
1174
+
1175
+`POST /containers/(id or name)/kill`
1176
+
1177
+Kill the container `id`
1178
+
1179
+**Example request**:
1180
+
1181
+    POST /v1.26/containers/e90e34656806/kill HTTP/1.1
1182
+
1183
+**Example response**:
1184
+
1185
+    HTTP/1.1 204 No Content
1186
+
1187
+**Query parameters**:
1188
+
1189
+-   **signal** - Signal to send to the container: integer or string like `SIGINT`.
1190
+        When not set, `SIGKILL` is assumed and the call waits for the container to exit.
1191
+
1192
+**Status codes**:
1193
+
1194
+-   **204** – no error
1195
+-   **404** – no such container
1196
+-   **500** – server error
1197
+
1198
+### Update a container
1199
+
1200
+`POST /containers/(id or name)/update`
1201
+
1202
+Update configuration of one or more containers.
1203
+
1204
+**Example request**:
1205
+
1206
+       POST /v1.26/containers/e90e34656806/update HTTP/1.1
1207
+       Content-Type: application/json
1208
+
1209
+       {
1210
+         "BlkioWeight": 300,
1211
+         "CpuShares": 512,
1212
+         "CpuPeriod": 100000,
1213
+         "CpuRealtimePeriod": 1000000,
1214
+         "CpuRealtimeRuntime": 10000,
1215
+         "CpuQuota": 50000,
1216
+         "CpusetCpus": "0,1",
1217
+         "CpusetMems": "0",
1218
+         "Memory": 314572800,
1219
+         "MemorySwap": 514288000,
1220
+         "MemoryReservation": 209715200,
1221
+         "KernelMemory": 52428800,
1222
+         "RestartPolicy": {
1223
+           "MaximumRetryCount": 4,
1224
+           "Name": "on-failure"
1225
+         },
1226
+       }
1227
+
1228
+**Example response**:
1229
+
1230
+       HTTP/1.1 200 OK
1231
+       Content-Type: application/json
1232
+
1233
+       {
1234
+           "Warnings": []
1235
+       }
1236
+
1237
+**Status codes**:
1238
+
1239
+-   **200** – no error
1240
+-   **400** – bad parameter
1241
+-   **404** – no such container
1242
+-   **500** – server error
1243
+
1244
+### Rename a container
1245
+
1246
+`POST /containers/(id or name)/rename`
1247
+
1248
+Rename the container `id` to a `new_name`
1249
+
1250
+**Example request**:
1251
+
1252
+    POST /v1.26/containers/e90e34656806/rename?name=new_name HTTP/1.1
1253
+
1254
+**Example response**:
1255
+
1256
+    HTTP/1.1 204 No Content
1257
+
1258
+**Query parameters**:
1259
+
1260
+-   **name** – new name for the container
1261
+
1262
+**Status codes**:
1263
+
1264
+-   **204** – no error
1265
+-   **404** – no such container
1266
+-   **409** - conflict name already assigned
1267
+-   **500** – server error
1268
+
1269
+### Pause a container
1270
+
1271
+`POST /containers/(id or name)/pause`
1272
+
1273
+Pause the container `id`
1274
+
1275
+**Example request**:
1276
+
1277
+    POST /v1.26/containers/e90e34656806/pause HTTP/1.1
1278
+
1279
+**Example response**:
1280
+
1281
+    HTTP/1.1 204 No Content
1282
+
1283
+**Status codes**:
1284
+
1285
+-   **204** – no error
1286
+-   **404** – no such container
1287
+-   **500** – server error
1288
+
1289
+### Unpause a container
1290
+
1291
+`POST /containers/(id or name)/unpause`
1292
+
1293
+Unpause the container `id`
1294
+
1295
+**Example request**:
1296
+
1297
+    POST /v1.26/containers/e90e34656806/unpause HTTP/1.1
1298
+
1299
+**Example response**:
1300
+
1301
+    HTTP/1.1 204 No Content
1302
+
1303
+**Status codes**:
1304
+
1305
+-   **204** – no error
1306
+-   **404** – no such container
1307
+-   **500** – server error
1308
+
1309
+### Attach to a container
1310
+
1311
+`POST /containers/(id or name)/attach`
1312
+
1313
+Attach to the container `id`
1314
+
1315
+**Example request**:
1316
+
1317
+    POST /v1.26/containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1
1318
+
1319
+**Example response**:
1320
+
1321
+    HTTP/1.1 101 UPGRADED
1322
+    Content-Type: application/vnd.docker.raw-stream
1323
+    Connection: Upgrade
1324
+    Upgrade: tcp
1325
+
1326
+    {% raw %}
1327
+    {{ STREAM }}
1328
+    {% endraw %}
1329
+
1330
+**Query parameters**:
1331
+
1332
+-   **detachKeys** – Override the key sequence for detaching a
1333
+        container. Format is a single character `[a-Z]` or `ctrl-<value>`
1334
+        where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`.
1335
+-   **logs** – 1/True/true or 0/False/false, return logs. Default `false`.
1336
+-   **stream** – 1/True/true or 0/False/false, return stream.
1337
+        Default `false`.
1338
+-   **stdin** – 1/True/true or 0/False/false, if `stream=true`, attach
1339
+        to `stdin`. Default `false`.
1340
+-   **stdout** – 1/True/true or 0/False/false, if `logs=true`, return
1341
+        `stdout` log, if `stream=true`, attach to `stdout`. Default `false`.
1342
+-   **stderr** – 1/True/true or 0/False/false, if `logs=true`, return
1343
+        `stderr` log, if `stream=true`, attach to `stderr`. Default `false`.
1344
+
1345
+**Status codes**:
1346
+
1347
+-   **101** – no error, hints proxy about hijacking
1348
+-   **200** – no error, no upgrade header found
1349
+-   **400** – bad parameter
1350
+-   **404** – no such container
1351
+-   **409** - container is paused
1352
+-   **500** – server error
1353
+
1354
+**Stream details**:
1355
+
1356
+When using the TTY setting is enabled in
1357
+[`POST /containers/create`
1358
+](#create-a-container),
1359
+the stream is the raw data from the process PTY and client's `stdin`.
1360
+When the TTY is disabled, then the stream is multiplexed to separate
1361
+`stdout` and `stderr`.
1362
+
1363
+The format is a **Header** and a **Payload** (frame).
1364
+
1365
+**HEADER**
1366
+
1367
+The header contains the information which the stream writes (`stdout` or
1368
+`stderr`). It also contains the size of the associated frame encoded in the
1369
+last four bytes (`uint32`).
1370
+
1371
+It is encoded on the first eight bytes like this:
1372
+
1373
+    header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4}
1374
+
1375
+`STREAM_TYPE` can be:
1376
+
1377
+-   0: `stdin` (is written on `stdout`)
1378
+-   1: `stdout`
1379
+-   2: `stderr`
1380
+
1381
+`SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of
1382
+the `uint32` size encoded as big endian.
1383
+
1384
+**PAYLOAD**
1385
+
1386
+The payload is the raw stream.
1387
+
1388
+**IMPLEMENTATION**
1389
+
1390
+The simplest way to implement the Attach protocol is the following:
1391
+
1392
+    1.  Read eight bytes.
1393
+    2.  Choose `stdout` or `stderr` depending on the first byte.
1394
+    3.  Extract the frame size from the last four bytes.
1395
+    4.  Read the extracted size and output it on the correct output.
1396
+    5.  Goto 1.
1397
+
1398
+### Attach to a container (websocket)
1399
+
1400
+`GET /containers/(id or name)/attach/ws`
1401
+
1402
+Attach to the container `id` via websocket
1403
+
1404
+Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455)
1405
+
1406
+**Example request**
1407
+
1408
+    GET /v1.26/containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1
1409
+
1410
+**Example response**
1411
+
1412
+    {% raw %}
1413
+    {{ STREAM }}
1414
+    {% endraw %}
1415
+
1416
+**Query parameters**:
1417
+
1418
+-   **detachKeys** – Override the key sequence for detaching a
1419
+        container. Format is a single character `[a-Z]` or `ctrl-<value>`
1420
+        where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`.
1421
+-   **logs** – 1/True/true or 0/False/false, return logs. Default `false`.
1422
+-   **stream** – 1/True/true or 0/False/false, return stream.
1423
+        Default `false`.
1424
+-   **stdin** – 1/True/true or 0/False/false, if `stream=true`, attach
1425
+        to `stdin`. Default `false`.
1426
+-   **stdout** – 1/True/true or 0/False/false, if `logs=true`, return
1427
+        `stdout` log, if `stream=true`, attach to `stdout`. Default `false`.
1428
+-   **stderr** – 1/True/true or 0/False/false, if `logs=true`, return
1429
+        `stderr` log, if `stream=true`, attach to `stderr`. Default `false`.
1430
+
1431
+**Status codes**:
1432
+
1433
+-   **200** – no error
1434
+-   **400** – bad parameter
1435
+-   **404** – no such container
1436
+-   **500** – server error
1437
+
1438
+### Wait a container
1439
+
1440
+`POST /containers/(id or name)/wait`
1441
+
1442
+Block until container `id` stops, then returns the exit code
1443
+
1444
+**Example request**:
1445
+
1446
+    POST /v1.26/containers/16253994b7c4/wait HTTP/1.1
1447
+
1448
+**Example response**:
1449
+
1450
+    HTTP/1.1 200 OK
1451
+    Content-Type: application/json
1452
+
1453
+    {"StatusCode": 0}
1454
+
1455
+**Status codes**:
1456
+
1457
+-   **200** – no error
1458
+-   **404** – no such container
1459
+-   **500** – server error
1460
+
1461
+### Remove a container
1462
+
1463
+`DELETE /containers/(id or name)`
1464
+
1465
+Remove the container `id` from the filesystem
1466
+
1467
+**Example request**:
1468
+
1469
+    DELETE /containers/16253994b7c4?v=1 HTTP/1.1
1470
+
1471
+**Example response**:
1472
+
1473
+    HTTP/1.1 204 No Content
1474
+
1475
+**Query parameters**:
1476
+
1477
+-   **v** – 1/True/true or 0/False/false, Remove the volumes
1478
+        associated to the container. Default `false`.
1479
+-   **force** - 1/True/true or 0/False/false, Kill then remove the container.
1480
+        Default `false`.
1481
+
1482
+**Status codes**:
1483
+
1484
+-   **204** – no error
1485
+-   **400** – bad parameter
1486
+-   **404** – no such container
1487
+-   **409** – conflict
1488
+-   **500** – server error
1489
+
1490
+### Retrieving information about files and folders in a container
1491
+
1492
+`HEAD /containers/(id or name)/archive`
1493
+
1494
+See the description of the `X-Docker-Container-Path-Stat` header in the
1495
+following section.
1496
+
1497
+### Get an archive of a filesystem resource in a container
1498
+
1499
+`GET /containers/(id or name)/archive`
1500
+
1501
+Get a tar archive of a resource in the filesystem of container `id`.
1502
+
1503
+**Query parameters**:
1504
+
1505
+- **path** - resource in the container's filesystem to archive. Required.
1506
+
1507
+    If not an absolute path, it is relative to the container's root directory.
1508
+    The resource specified by **path** must exist. To assert that the resource
1509
+    is expected to be a directory, **path** should end in `/` or  `/.`
1510
+    (assuming a path separator of `/`). If **path** ends in `/.` then this
1511
+    indicates that only the contents of the **path** directory should be
1512
+    copied. A symlink is always resolved to its target.
1513
+
1514
+    > **Note**: It is not possible to copy certain system files such as resources
1515
+    > under `/proc`, `/sys`, `/dev`, and mounts created by the user in the
1516
+    > container.
1517
+
1518
+**Example request**:
1519
+
1520
+    GET /v1.26/containers/8cce319429b2/archive?path=/root HTTP/1.1
1521
+
1522
+**Example response**:
1523
+
1524
+    HTTP/1.1 200 OK
1525
+    Content-Type: application/x-tar
1526
+    X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oiLCJsaW5rVGFyZ2V0IjoiIn0=
1527
+
1528
+    {% raw %}
1529
+    {{ TAR STREAM }}
1530
+    {% endraw %}
1531
+
1532
+On success, a response header `X-Docker-Container-Path-Stat` will be set to a
1533
+base64-encoded JSON object containing some filesystem header information about
1534
+the archived resource. The above example value would decode to the following
1535
+JSON object (whitespace added for readability):
1536
+
1537
+```json
1538
+{
1539
+    "name": "root",
1540
+    "size": 4096,
1541
+    "mode": 2147484096,
1542
+    "mtime": "2014-02-27T20:51:23Z",
1543
+    "linkTarget": ""
1544
+}
1545
+```
1546
+
1547
+A `HEAD` request can also be made to this endpoint if only this information is
1548
+desired.
1549
+
1550
+**Status codes**:
1551
+
1552
+- **200** - success, returns archive of copied resource
1553
+- **400** - client error, bad parameter, details in JSON response body, one of:
1554
+    - must specify path parameter (**path** cannot be empty)
1555
+    - not a directory (**path** was asserted to be a directory but exists as a
1556
+      file)
1557
+- **404** - client error, resource not found, one of:
1558
+    – no such container (container `id` does not exist)
1559
+    - no such file or directory (**path** does not exist)
1560
+- **500** - server error
1561
+
1562
+### Extract an archive of files or folders to a directory in a container
1563
+
1564
+`PUT /containers/(id or name)/archive`
1565
+
1566
+Upload a tar archive to be extracted to a path in the filesystem of container
1567
+`id`.
1568
+
1569
+**Query parameters**:
1570
+
1571
+- **path** - path to a directory in the container
1572
+    to extract the archive's contents into. Required.
1573
+
1574
+    If not an absolute path, it is relative to the container's root directory.
1575
+    The **path** resource must exist.
1576
+- **noOverwriteDirNonDir** - If "1", "true", or "True" then it will be an error
1577
+    if unpacking the given content would cause an existing directory to be
1578
+    replaced with a non-directory and vice versa.
1579
+
1580
+**Example request**:
1581
+
1582
+    PUT /containers/8cce319429b2/archive?path=/vol1 HTTP/1.1
1583
+    Content-Type: application/x-tar
1584
+
1585
+    {% raw %}
1586
+    {{ TAR STREAM }}
1587
+    {% endraw %}
1588
+
1589
+**Example response**:
1590
+
1591
+    HTTP/1.1 200 OK
1592
+
1593
+**Status codes**:
1594
+
1595
+- **200** – the content was extracted successfully
1596
+- **400** - client error, bad parameter, details in JSON response body, one of:
1597
+    - must specify path parameter (**path** cannot be empty)
1598
+    - not a directory (**path** should be a directory but exists as a file)
1599
+    - unable to overwrite existing directory with non-directory
1600
+      (if **noOverwriteDirNonDir**)
1601
+    - unable to overwrite existing non-directory with directory
1602
+      (if **noOverwriteDirNonDir**)
1603
+- **403** - client error, permission denied, the volume
1604
+    or container rootfs is marked as read-only.
1605
+- **404** - client error, resource not found, one of:
1606
+    – no such container (container `id` does not exist)
1607
+    - no such file or directory (**path** resource does not exist)
1608
+- **500** – server error
1609
+
1610
+
1611
+### Prune stopped containers
1612
+
1613
+`POST /containers/prune`
1614
+
1615
+Delete stopped containers
1616
+
1617
+**Example request**:
1618
+
1619
+    POST /v1.26/containers/prune HTTP/1.1
1620
+    Content-Type: application/json
1621
+
1622
+    {
1623
+    }
1624
+
1625
+**Example response**:
1626
+
1627
+    HTTP/1.1 200 OK
1628
+    Content-Type: application/json
1629
+
1630
+    {
1631
+        "ContainersDeleted": [
1632
+            "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148"
1633
+        ],
1634
+        "SpaceReclaimed": 109
1635
+    }
1636
+
1637
+**Status codes**:
1638
+
1639
+-   **200** – no error
1640
+-   **500** – server error
1641
+
1642
+## 3.2 Images
1643
+
1644
+### List Images
1645
+
1646
+`GET /images/json`
1647
+
1648
+**Example request**:
1649
+
1650
+    GET /v1.26/images/json?all=0 HTTP/1.1
1651
+
1652
+**Example response**:
1653
+
1654
+    HTTP/1.1 200 OK
1655
+    Content-Type: application/json
1656
+
1657
+    [
1658
+      {
1659
+         "RepoTags": [
1660
+           "ubuntu:12.04",
1661
+           "ubuntu:precise",
1662
+           "ubuntu:latest"
1663
+         ],
1664
+         "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c",
1665
+         "Created": 1365714795,
1666
+         "Size": 131506275,
1667
+         "VirtualSize": 131506275,
1668
+         "Labels": {}
1669
+      },
1670
+      {
1671
+         "RepoTags": [
1672
+           "ubuntu:12.10",
1673
+           "ubuntu:quantal"
1674
+         ],
1675
+         "ParentId": "27cf784147099545",
1676
+         "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc",
1677
+         "Created": 1364102658,
1678
+         "Size": 24653,
1679
+         "VirtualSize": 180116135,
1680
+         "Labels": {
1681
+            "com.example.version": "v1"
1682
+         }
1683
+      }
1684
+    ]
1685
+
1686
+**Example request, with digest information**:
1687
+
1688
+    GET /v1.26/images/json?digests=1 HTTP/1.1
1689
+
1690
+**Example response, with digest information**:
1691
+
1692
+    HTTP/1.1 200 OK
1693
+    Content-Type: application/json
1694
+
1695
+    [
1696
+      {
1697
+        "Created": 1420064636,
1698
+        "Id": "4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125",
1699
+        "ParentId": "ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2",
1700
+        "RepoDigests": [
1701
+          "localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf"
1702
+        ],
1703
+        "RepoTags": [
1704
+          "localhost:5000/test/busybox:latest",
1705
+          "playdate:latest"
1706
+        ],
1707
+        "Size": 0,
1708
+        "VirtualSize": 2429728,
1709
+        "Labels": {}
1710
+      }
1711
+    ]
1712
+
1713
+The response shows a single image `Id` associated with two repositories
1714
+(`RepoTags`): `localhost:5000/test/busybox`: and `playdate`. A caller can use
1715
+either of the `RepoTags` values `localhost:5000/test/busybox:latest` or
1716
+`playdate:latest` to reference the image.
1717
+
1718
+You can also use `RepoDigests` values to reference an image. In this response,
1719
+the array has only one reference and that is to the
1720
+`localhost:5000/test/busybox` repository; the `playdate` repository has no
1721
+digest. You can reference this digest using the value:
1722
+`localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d...`
1723
+
1724
+See the `docker run` and `docker build` commands for examples of digest and tag
1725
+references on the command line.
1726
+
1727
+**Query parameters**:
1728
+
1729
+-   **all** – 1/True/true or 0/False/false, default false
1730
+-   **filters** – a JSON encoded value of the filters (a map[string][]string) to process on the images list. Available filters:
1731
+  -   `dangling=true`
1732
+  -   `label=key` or `label="key=value"` of an image label
1733
+  -   `before`=(`<image-name>[:<tag>]`,  `<image id>` or `<image@digest>`)
1734
+  -   `since`=(`<image-name>[:<tag>]`,  `<image id>` or `<image@digest>`)
1735
+  -   `reference`=(`<image-name>[:<tag>]`)
1736
+
1737
+### Build image from a Dockerfile
1738
+
1739
+`POST /build`
1740
+
1741
+Build an image from a Dockerfile
1742
+
1743
+**Example request**:
1744
+
1745
+    POST /v1.26/build HTTP/1.1
1746
+
1747
+    {% raw %}
1748
+    {{ TAR STREAM }}
1749
+    {% endraw %}
1750
+
1751
+**Example response**:
1752
+
1753
+    HTTP/1.1 200 OK
1754
+    Content-Type: application/json
1755
+
1756
+    {"stream": "Step 1/5..."}
1757
+    {"stream": "..."}
1758
+    {"error": "Error...", "errorDetail": {"code": 123, "message": "Error..."}}
1759
+
1760
+The input stream must be a `tar` archive compressed with one of the
1761
+following algorithms: `identity` (no compression), `gzip`, `bzip2`, `xz`.
1762
+
1763
+The archive must include a build instructions file, typically called
1764
+`Dockerfile` at the archive's root. The `dockerfile` parameter may be
1765
+used to specify a different build instructions file. To do this, its value must be
1766
+the path to the alternate build instructions file to use.
1767
+
1768
+The archive may include any number of other files,
1769
+which are accessible in the build context (See the [*ADD build
1770
+command*](../../reference/builder.md#add)).
1771
+
1772
+The Docker daemon performs a preliminary validation of the `Dockerfile` before
1773
+starting the build, and returns an error if the syntax is incorrect. After that,
1774
+each instruction is run one-by-one until the ID of the new image is output.
1775
+
1776
+The build is canceled if the client drops the connection by quitting
1777
+or being killed.
1778
+
1779
+**Query parameters**:
1780
+
1781
+-   **dockerfile** - Path within the build context to the `Dockerfile`. This is
1782
+        ignored if `remote` is specified and points to an external `Dockerfile`.
1783
+-   **t** – A name and optional tag to apply to the image in the `name:tag` format.
1784
+        If you omit the `tag` the default `latest` value is assumed.
1785
+        You can provide one or more `t` parameters.
1786
+-   **remote** – A Git repository URI or HTTP/HTTPS context URI. If the
1787
+        URI points to a single text file, the file's contents are placed into
1788
+        a file called `Dockerfile` and the image is built from that file. If
1789
+        the URI points to a tarball, the file is downloaded by the daemon and
1790
+        the contents therein used as the context for the build. If the URI
1791
+        points to a tarball and the `dockerfile` parameter is also specified,
1792
+        there must be a file with the corresponding path inside the tarball.
1793
+-   **q** – Suppress verbose build output.
1794
+-   **nocache** – Do not use the cache when building the image.
1795
+-   **cachefrom** - JSON array of images used for build cache resolution.
1796
+-   **pull** - Attempt to pull the image even if an older image exists locally.
1797
+-   **rm** - Remove intermediate containers after a successful build (default behavior).
1798
+-   **forcerm** - Always remove intermediate containers (includes `rm`).
1799
+-   **memory** - Set memory limit for build.
1800
+-   **memswap** - Total memory (memory + swap), `-1` to enable unlimited swap.
1801
+-   **cpushares** - CPU shares (relative weight).
1802
+-   **cpusetcpus** - CPUs in which to allow execution (e.g., `0-3`, `0,1`).
1803
+-   **cpuperiod** - The length of a CPU period in microseconds.
1804
+-   **cpuquota** - Microseconds of CPU time that the container can get in a CPU period.
1805
+-   **buildargs** – JSON map of string pairs for build-time variables. Users pass
1806
+        these values at build-time. Docker uses the `buildargs` as the environment
1807
+        context for command(s) run via the Dockerfile's `RUN` instruction or for
1808
+        variable expansion in other Dockerfile instructions. This is not meant for
1809
+        passing secret values. [Read more about the buildargs instruction](../../reference/builder.md#arg)
1810
+-   **shmsize** - Size of `/dev/shm` in bytes. The size must be greater than 0.  If omitted the system uses 64MB.
1811
+-   **squash** - squash the resulting images layers into a single layer (boolean) **Experimental Only**
1812
+-   **labels** – JSON map of string pairs for labels to set on the image.
1813
+-   **networkmode** - Sets the networking mode for the run commands during
1814
+        build. Supported standard values are: `bridge`, `host`, `none`, and
1815
+        `container:<name|id>`. Any other value is taken as a custom network's
1816
+        name to which this container should connect to.
1817
+
1818
+
1819
+**Request Headers**:
1820
+
1821
+-   **Content-type** – Set to `"application/tar"`.
1822
+-   **X-Registry-Config** – A base64-url-safe-encoded Registry Auth Config JSON
1823
+        object with the following structure:
1824
+
1825
+            {
1826
+                "docker.example.com": {
1827
+                    "username": "janedoe",
1828
+                    "password": "hunter2"
1829
+                },
1830
+                "https://index.docker.io/v1/": {
1831
+                    "username": "mobydock",
1832
+                    "password": "conta1n3rize14"
1833
+                }
1834
+            }
1835
+
1836
+    This object maps the hostname of a registry to an object containing the
1837
+    "username" and "password" for that registry. Multiple registries may
1838
+    be specified as the build may be based on an image requiring
1839
+    authentication to pull from any arbitrary registry. Only the registry
1840
+    domain name (and port if not the default "443") are required. However
1841
+    (for legacy reasons) the "official" Docker, Inc. hosted registry must
1842
+    be specified with both a "https://" prefix and a "/v1/" suffix even
1843
+    though Docker will prefer to use the v2 registry API.
1844
+
1845
+**Status codes**:
1846
+
1847
+-   **200** – no error
1848
+-   **500** – server error
1849
+
1850
+### Create an image
1851
+
1852
+`POST /images/create`
1853
+
1854
+Create an image either by pulling it from the registry or by importing it
1855
+
1856
+**Example request**:
1857
+
1858
+    POST /v1.26/images/create?fromImage=busybox&tag=latest HTTP/1.1
1859
+
1860
+**Example response**:
1861
+
1862
+    HTTP/1.1 200 OK
1863
+    Content-Type: application/json
1864
+
1865
+    {"status":"Pulling from library/busybox","id":"latest"}
1866
+    {"status":"Pulling fs layer","progressDetail":{},"id":"8ddc19f16526"}
1867
+    {"status":"Downloading","progressDetail":{"current":15881,"total":667590},"progress":"[=\u003e                                                 ] 15.88 kB/667.6 kB","id":"8ddc19f16526"}
1868
+    {"status":"Downloading","progressDetail":{"current":556269,"total":667590},"progress":"[=========================================\u003e         ] 556.3 kB/667.6 kB","id":"8ddc19f16526"}
1869
+    {"status":"Download complete","progressDetail":{},"id":"8ddc19f16526"}
1870
+    {"status":"Extracting","progressDetail":{"current":32768,"total":667590},"progress":"[==\u003e                                                ] 32.77 kB/667.6 kB","id":"8ddc19f16526"}
1871
+    {"status":"Extracting","progressDetail":{"current":491520,"total":667590},"progress":"[====================================\u003e              ] 491.5 kB/667.6 kB","id":"8ddc19f16526"}
1872
+    {"status":"Extracting","progressDetail":{"current":667590,"total":667590},"progress":"[==================================================\u003e] 667.6 kB/667.6 kB","id":"8ddc19f16526"}
1873
+    {"status":"Extracting","progressDetail":{"current":667590,"total":667590},"progress":"[==================================================\u003e] 667.6 kB/667.6 kB","id":"8ddc19f16526"}
1874
+    {"status":"Pull complete","progressDetail":{},"id":"8ddc19f16526"}
1875
+    {"status":"Digest: sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6"}
1876
+    {"status":"Status: Downloaded newer image for busybox:latest"}
1877
+    ...
1878
+
1879
+When using this endpoint to pull an image from the registry, the
1880
+`X-Registry-Auth` header can be used to include
1881
+a base64-encoded AuthConfig object.
1882
+
1883
+**Query parameters**:
1884
+
1885
+-   **fromImage** – Name of the image to pull. The name may include a tag or
1886
+        digest. This parameter may only be used when pulling an image.
1887
+        The pull is cancelled if the HTTP connection is closed.
1888
+-   **fromSrc** – Source to import.  The value may be a URL from which the image
1889
+        can be retrieved or `-` to read the image from the request body.
1890
+        This parameter may only be used when importing an image.
1891
+-   **repo** – Repository name given to an image when it is imported.
1892
+        The repo may include a tag. This parameter may only be used when importing
1893
+        an image.
1894
+-   **tag** – Tag or digest. If empty when pulling an image, this causes all tags
1895
+        for the given image to be pulled.
1896
+
1897
+**Request Headers**:
1898
+
1899
+-   **X-Registry-Auth** – base64-encoded AuthConfig object, containing either login information, or a token
1900
+    - Credential based login:
1901
+
1902
+        ```
1903
+    {
1904
+            "username": "jdoe",
1905
+            "password": "secret",
1906
+            "email": "jdoe@acme.com"
1907
+    }
1908
+        ```
1909
+
1910
+    - Token based login:
1911
+
1912
+        ```
1913
+    {
1914
+            "identitytoken": "9cbaf023786cd7..."
1915
+    }
1916
+        ```
1917
+
1918
+**Status codes**:
1919
+
1920
+-   **200** – no error
1921
+-   **500** – server error
1922
+
1923
+
1924
+
1925
+### Inspect an image
1926
+
1927
+`GET /images/(name)/json`
1928
+
1929
+Return low-level information on the image `name`
1930
+
1931
+**Example request**:
1932
+
1933
+    GET /v1.26/images/example/json HTTP/1.1
1934
+
1935
+**Example response (Linux daemon)**:
1936
+
1937
+    HTTP/1.1 200 OK
1938
+    Content-Type: application/json
1939
+
1940
+    {
1941
+       "Id" : "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c",
1942
+       "Container" : "cb91e48a60d01f1e27028b4fc6819f4f290b3cf12496c8176ec714d0d390984a",
1943
+       "Comment" : "",
1944
+       "Os" : "linux",
1945
+       "Architecture" : "amd64",
1946
+       "Parent" : "sha256:91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c",
1947
+       "ContainerConfig" : {
1948
+          "Tty" : false,
1949
+          "Hostname" : "e611e15f9c9d",
1950
+          "Volumes" : null,
1951
+          "Domainname" : "",
1952
+          "AttachStdout" : false,
1953
+          "PublishService" : "",
1954
+          "AttachStdin" : false,
1955
+          "OpenStdin" : false,
1956
+          "StdinOnce" : false,
1957
+          "NetworkDisabled" : false,
1958
+          "OnBuild" : [],
1959
+          "Image" : "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c",
1960
+          "User" : "",
1961
+          "WorkingDir" : "",
1962
+          "Entrypoint" : null,
1963
+          "MacAddress" : "",
1964
+          "AttachStderr" : false,
1965
+          "Labels" : {
1966
+             "com.example.license" : "GPL",
1967
+             "com.example.version" : "1.0",
1968
+             "com.example.vendor" : "Acme"
1969
+          },
1970
+          "Env" : [
1971
+             "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
1972
+          ],
1973
+          "ExposedPorts" : null,
1974
+          "Cmd" : [
1975
+             "/bin/sh",
1976
+             "-c",
1977
+             "#(nop) LABEL com.example.vendor=Acme com.example.license=GPL com.example.version=1.0"
1978
+          ]
1979
+       },
1980
+       "DockerVersion" : "1.9.0-dev",
1981
+       "VirtualSize" : 188359297,
1982
+       "Size" : 0,
1983
+       "Author" : "",
1984
+       "Created" : "2015-09-10T08:30:53.26995814Z",
1985
+       "GraphDriver" : {
1986
+          "Name" : "aufs",
1987
+          "Data" : null
1988
+       },
1989
+       "RepoDigests" : [
1990
+          "localhost:5000/test/busybox/example@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf"
1991
+       ],
1992
+       "RepoTags" : [
1993
+          "example:1.0",
1994
+          "example:latest",
1995
+          "example:stable"
1996
+       ],
1997
+       "Config" : {
1998
+          "Image" : "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c",
1999
+          "NetworkDisabled" : false,
2000
+          "OnBuild" : [],
2001
+          "StdinOnce" : false,
2002
+          "PublishService" : "",
2003
+          "AttachStdin" : false,
2004
+          "OpenStdin" : false,
2005
+          "Domainname" : "",
2006
+          "AttachStdout" : false,
2007
+          "Tty" : false,
2008
+          "Hostname" : "e611e15f9c9d",
2009
+          "Volumes" : null,
2010
+          "Cmd" : [
2011
+             "/bin/bash"
2012
+          ],
2013
+          "ExposedPorts" : null,
2014
+          "Env" : [
2015
+             "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
2016
+          ],
2017
+          "Labels" : {
2018
+             "com.example.vendor" : "Acme",
2019
+             "com.example.version" : "1.0",
2020
+             "com.example.license" : "GPL"
2021
+          },
2022
+          "Entrypoint" : null,
2023
+          "MacAddress" : "",
2024
+          "AttachStderr" : false,
2025
+          "WorkingDir" : "",
2026
+          "User" : ""
2027
+       },
2028
+       "RootFS": {
2029
+           "Type": "layers",
2030
+           "Layers": [
2031
+               "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6",
2032
+               "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef"
2033
+           ]
2034
+       }
2035
+    }
2036
+
2037
+**Example response (Windows daemon)**:
2038
+
2039
+    HTTP/1.1 200 OK
2040
+    Content-Type: application/json
2041
+
2042
+    [
2043
+        {
2044
+            "Id": "sha256:105d76d0f40e38427c63023ffe649bf36fa85058d3469551e43e4dcc2431fb31",
2045
+            "RepoTags": [
2046
+                "microsoft/nanoserver:latest"
2047
+            ],
2048
+            "RepoDigests": [
2049
+                "microsoft/nanoserver@sha256:aee7d4330fe3dc5987c808f647441c16ed2fa1c7d9c6ef49d6498e5c9860b50b"
2050
+            ],
2051
+            "Parent": "",
2052
+            "Comment": "",
2053
+            "Created": "2016-09-22T02:39:30.9154862-07:00",
2054
+            "Container": "",
2055
+            "ContainerConfig": {
2056
+                "Hostname": "",
2057
+                "Domainname": "",
2058
+                "User": "",
2059
+                "AttachStdin": false,
2060
+                "AttachStdout": false,
2061
+                "AttachStderr": false,
2062
+                "Tty": false,
2063
+                "OpenStdin": false,
2064
+                "StdinOnce": false,
2065
+                "Env": null,
2066
+                "Cmd": null,
2067
+                "Image": "",
2068
+                "Volumes": null,
2069
+                "WorkingDir": "",
2070
+                "Entrypoint": null,
2071
+                "OnBuild": null,
2072
+                "Labels": null
2073
+            },
2074
+            "DockerVersion": "",
2075
+            "Author": "",
2076
+            "Config": {
2077
+                "Hostname": "",
2078
+                "Domainname": "",
2079
+                "User": "",
2080
+                "AttachStdin": false,
2081
+                "AttachStdout": false,
2082
+                "AttachStderr": false,
2083
+                "Tty": false,
2084
+                "OpenStdin": false,
2085
+                "StdinOnce": false,
2086
+                "Env": null,
2087
+                "Cmd": [
2088
+                    "c:\\windows\\system32\\cmd.exe"
2089
+                ],
2090
+                "Image": "",
2091
+                "Volumes": null,
2092
+                "WorkingDir": "",
2093
+                "Entrypoint": null,
2094
+                "OnBuild": null,
2095
+                "Labels": null
2096
+            },
2097
+            "Architecture": "",
2098
+            "Os": "windows",
2099
+            "OsVersion": "10.0.14393",
2100
+            "Size": 651862727,
2101
+            "VirtualSize": 651862727,
2102
+            "GraphDriver": {
2103
+                "Name": "windowsfilter",
2104
+                "Data": {
2105
+                    "dir": "C:\\control\\windowsfilter\\6fe6a289b98276a6a5ca0345156ca61d7b38f3da6bb49ef95af1d0f1ac37e5bf"
2106
+                }
2107
+            },
2108
+            "RootFS": {
2109
+                "Type": "layers",
2110
+                "Layers": [
2111
+                    "sha256:342d4e407550c52261edd20cd901b5ce438f0b1e940336de3978210612365063"
2112
+                ]
2113
+            }
2114
+        }
2115
+    ]
2116
+
2117
+**Status codes**:
2118
+
2119
+-   **200** – no error
2120
+-   **404** – no such image
2121
+-   **500** – server error
2122
+
2123
+### Get the history of an image
2124
+
2125
+`GET /images/(name)/history`
2126
+
2127
+Return the history of the image `name`
2128
+
2129
+**Example request**:
2130
+
2131
+    GET /v1.26/images/ubuntu/history HTTP/1.1
2132
+
2133
+**Example response**:
2134
+
2135
+    HTTP/1.1 200 OK
2136
+    Content-Type: application/json
2137
+
2138
+    [
2139
+        {
2140
+            "Id": "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710",
2141
+            "Created": 1398108230,
2142
+            "CreatedBy": "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /",
2143
+            "Tags": [
2144
+                "ubuntu:lucid",
2145
+                "ubuntu:10.04"
2146
+            ],
2147
+            "Size": 182964289,
2148
+            "Comment": ""
2149
+        },
2150
+        {
2151
+            "Id": "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8",
2152
+            "Created": 1398108222,
2153
+            "CreatedBy": "/bin/sh -c #(nop) MAINTAINER Tianon Gravi <admwiggin@gmail.com> - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/",
2154
+            "Tags": null,
2155
+            "Size": 0,
2156
+            "Comment": ""
2157
+        },
2158
+        {
2159
+            "Id": "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158",
2160
+            "Created": 1371157430,
2161
+            "CreatedBy": "",
2162
+            "Tags": [
2163
+                "scratch12:latest",
2164
+                "scratch:latest"
2165
+            ],
2166
+            "Size": 0,
2167
+            "Comment": "Imported from -"
2168
+        }
2169
+    ]
2170
+
2171
+**Status codes**:
2172
+
2173
+-   **200** – no error
2174
+-   **404** – no such image
2175
+-   **500** – server error
2176
+
2177
+### Push an image on the registry
2178
+
2179
+`POST /images/(name)/push`
2180
+
2181
+Push the image `name` on the registry
2182
+
2183
+**Example request**:
2184
+
2185
+    POST /v1.26/images/test/push HTTP/1.1
2186
+
2187
+**Example response**:
2188
+
2189
+    HTTP/1.1 200 OK
2190
+    Content-Type: application/json
2191
+
2192
+    {"status": "Pushing..."}
2193
+    {"status": "Pushing", "progress": "1/? (n/a)", "progressDetail": {"current": 1}}}
2194
+    {"error": "Invalid..."}
2195
+    ...
2196
+
2197
+If you wish to push an image on to a private registry, that image must already have a tag
2198
+into a repository which references that registry `hostname` and `port`.  This repository name should
2199
+then be used in the URL. This duplicates the command line's flow.
2200
+
2201
+The push is cancelled if the HTTP connection is closed.
2202
+
2203
+**Example request**:
2204
+
2205
+    POST /v1.26/images/registry.acme.com:5000/test/push HTTP/1.1
2206
+
2207
+
2208
+**Query parameters**:
2209
+
2210
+-   **tag** – The tag to associate with the image on the registry. This is optional.
2211
+
2212
+**Request Headers**:
2213
+
2214
+-   **X-Registry-Auth** – base64-encoded AuthConfig object, containing either login information, or a token
2215
+    - Credential based login:
2216
+
2217
+        ```
2218
+    {
2219
+            "username": "jdoe",
2220
+            "password": "secret",
2221
+            "email": "jdoe@acme.com",
2222
+    }
2223
+        ```
2224
+
2225
+    - Identity token based login:
2226
+
2227
+        ```
2228
+    {
2229
+            "identitytoken": "9cbaf023786cd7..."
2230
+    }
2231
+        ```
2232
+
2233
+**Status codes**:
2234
+
2235
+-   **200** – no error
2236
+-   **404** – no such image
2237
+-   **500** – server error
2238
+
2239
+### Tag an image into a repository
2240
+
2241
+`POST /images/(name)/tag`
2242
+
2243
+Tag the image `name` into a repository
2244
+
2245
+**Example request**:
2246
+
2247
+    POST /v1.26/images/test/tag?repo=myrepo&tag=v42 HTTP/1.1
2248
+
2249
+**Example response**:
2250
+
2251
+    HTTP/1.1 201 Created
2252
+
2253
+**Query parameters**:
2254
+
2255
+-   **repo** – The repository to tag in
2256
+-   **tag** - The new tag name
2257
+
2258
+**Status codes**:
2259
+
2260
+-   **201** – no error
2261
+-   **400** – bad parameter
2262
+-   **404** – no such image
2263
+-   **409** – conflict
2264
+-   **500** – server error
2265
+
2266
+### Remove an image
2267
+
2268
+`DELETE /images/(name)`
2269
+
2270
+Remove the image `name` from the filesystem
2271
+
2272
+**Example request**:
2273
+
2274
+    DELETE /images/test HTTP/1.1
2275
+
2276
+**Example response**:
2277
+
2278
+    HTTP/1.1 200 OK
2279
+    Content-type: application/json
2280
+
2281
+    [
2282
+     {"Untagged": "3e2f21a89f"},
2283
+     {"Deleted": "3e2f21a89f"},
2284
+     {"Deleted": "53b4f83ac9"}
2285
+    ]
2286
+
2287
+**Query parameters**:
2288
+
2289
+-   **force** – 1/True/true or 0/False/false, default false
2290
+-   **noprune** – 1/True/true or 0/False/false, default false
2291
+
2292
+**Status codes**:
2293
+
2294
+-   **200** – no error
2295
+-   **404** – no such image
2296
+-   **409** – conflict
2297
+-   **500** – server error
2298
+
2299
+### Search images
2300
+
2301
+`GET /images/search`
2302
+
2303
+Search for an image on [Docker Hub](https://hub.docker.com).
2304
+
2305
+> **Note**:
2306
+> The response keys have changed from API v1.6 to reflect the JSON
2307
+> sent by the registry server to the docker daemon's request.
2308
+
2309
+**Example request**:
2310
+
2311
+    GET /v1.26/images/search?term=sshd HTTP/1.1
2312
+
2313
+**Example response**:
2314
+
2315
+    HTTP/1.1 200 OK
2316
+    Content-Type: application/json
2317
+
2318
+    [
2319
+            {
2320
+                "description": "",
2321
+                "is_official": false,
2322
+                "is_automated": false,
2323
+                "name": "wma55/u1210sshd",
2324
+                "star_count": 0
2325
+            },
2326
+            {
2327
+                "description": "",
2328
+                "is_official": false,
2329
+                "is_automated": false,
2330
+                "name": "jdswinbank/sshd",
2331
+                "star_count": 0
2332
+            },
2333
+            {
2334
+                "description": "",
2335
+                "is_official": false,
2336
+                "is_automated": false,
2337
+                "name": "vgauthier/sshd",
2338
+                "star_count": 0
2339
+            }
2340
+    ...
2341
+    ]
2342
+
2343
+**Query parameters**:
2344
+
2345
+-   **term** – term to search
2346
+-   **limit** – maximum returned search results
2347
+-   **filters** – a JSON encoded value of the filters (a map[string][]string) to process on the images list. Available filters:
2348
+  -   `stars=<number>`
2349
+  -   `is-automated=(true|false)`
2350
+  -   `is-official=(true|false)`
2351
+
2352
+**Status codes**:
2353
+
2354
+-   **200** – no error
2355
+-   **500** – server error
2356
+
2357
+### Prune unused images
2358
+
2359
+`POST /images/prune`
2360
+
2361
+Delete unused images
2362
+
2363
+**Example request**:
2364
+
2365
+    POST /v1.26/images/prune HTTP/1.1
2366
+    Content-Type: application/json
2367
+
2368
+    {
2369
+        "DanglingOnly": false
2370
+    }
2371
+
2372
+**Example response**:
2373
+
2374
+    HTTP/1.1 200 OK
2375
+    Content-Type: application/json
2376
+
2377
+    {
2378
+        "ImagesDeleted": [
2379
+            {
2380
+                "Untagged": "busybox:latest"
2381
+            },
2382
+            {
2383
+                "Untagged": "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6"
2384
+            },
2385
+            {
2386
+                "Deleted": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749"
2387
+            },
2388
+            {
2389
+                "Deleted": "sha256:8ac8bfaff55af948c796026ee867448c5b5b5d9dd3549f4006d9759b25d4a893"
2390
+            }
2391
+        ],
2392
+        "SpaceReclaimed": 1092588
2393
+    }
2394
+
2395
+**JSON parameters**:
2396
+
2397
+- **DanglingOnly**: if `true` only delete unused *and* untagged images. Default to `false` if omitted
2398
+
2399
+**Status codes**:
2400
+
2401
+-   **200** – no error
2402
+-   **500** – server error
2403
+
2404
+
2405
+## 3.3 Misc
2406
+
2407
+### Check auth configuration
2408
+
2409
+`POST /auth`
2410
+
2411
+Validate credentials for a registry and get identity token,
2412
+if available, for accessing the registry without password.
2413
+
2414
+**Example request**:
2415
+
2416
+    POST /v1.26/auth HTTP/1.1
2417
+    Content-Type: application/json
2418
+
2419
+    {
2420
+         "username": "hannibal",
2421
+         "password": "xxxx",
2422
+         "serveraddress": "https://index.docker.io/v1/"
2423
+    }
2424
+
2425
+**Example response**:
2426
+
2427
+    HTTP/1.1 200 OK
2428
+
2429
+    {
2430
+         "Status": "Login Succeeded",
2431
+         "IdentityToken": "9cbaf023786cd7..."
2432
+    }
2433
+
2434
+**Status codes**:
2435
+
2436
+-   **200** – no error
2437
+-   **204** – no error
2438
+-   **500** – server error
2439
+
2440
+### Display system-wide information
2441
+
2442
+`GET /info`
2443
+
2444
+Display system-wide information
2445
+
2446
+**Example request**:
2447
+
2448
+    GET /v1.26/info HTTP/1.1
2449
+
2450
+**Example response (Linux)**:
2451
+
2452
+    HTTP/1.1 200 OK
2453
+    Content-Type: application/json
2454
+
2455
+    {
2456
+        "Architecture": "x86_64",
2457
+        "ClusterStore": "etcd://localhost:2379",
2458
+        "CgroupDriver": "cgroupfs",
2459
+        "Containers": 11,
2460
+        "ContainersRunning": 7,
2461
+        "ContainersStopped": 3,
2462
+        "ContainersPaused": 1,
2463
+        "CpuCfsPeriod": true,
2464
+        "CpuCfsQuota": true,
2465
+        "Debug": false,
2466
+        "DockerRootDir": "/var/lib/docker",
2467
+        "Driver": "btrfs",
2468
+        "DriverStatus": [[""]],
2469
+        "ExperimentalBuild": false,
2470
+        "HttpProxy": "http://test:test@localhost:8080",
2471
+        "HttpsProxy": "https://test:test@localhost:8080",
2472
+        "ID": "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS",
2473
+        "IPv4Forwarding": true,
2474
+        "Images": 16,
2475
+        "IndexServerAddress": "https://index.docker.io/v1/",
2476
+        "InitPath": "/usr/bin/docker",
2477
+        "InitSha1": "",
2478
+        "KernelMemory": true,
2479
+        "KernelVersion": "3.12.0-1-amd64",
2480
+        "Labels": [
2481
+            "storage=ssd"
2482
+        ],
2483
+        "MemTotal": 2099236864,
2484
+        "MemoryLimit": true,
2485
+        "NCPU": 1,
2486
+        "NEventsListener": 0,
2487
+        "NFd": 11,
2488
+        "NGoroutines": 21,
2489
+        "Name": "prod-server-42",
2490
+        "NoProxy": "9.81.1.160",
2491
+        "OomKillDisable": true,
2492
+        "OSType": "linux",
2493
+        "OperatingSystem": "Boot2Docker",
2494
+        "Plugins": {
2495
+            "Volume": [
2496
+                "local"
2497
+            ],
2498
+            "Network": [
2499
+                "null",
2500
+                "host",
2501
+                "bridge"
2502
+            ]
2503
+        },
2504
+        "RegistryConfig": {
2505
+            "IndexConfigs": {
2506
+                "docker.io": {
2507
+                    "Mirrors": null,
2508
+                    "Name": "docker.io",
2509
+                    "Official": true,
2510
+                    "Secure": true
2511
+                }
2512
+            },
2513
+            "InsecureRegistryCIDRs": [
2514
+                "127.0.0.0/8"
2515
+            ]
2516
+        },
2517
+        "SecurityOptions": [
2518
+            {
2519
+                "Key": "Name",
2520
+                "Value": "seccomp"
2521
+            },
2522
+            {
2523
+                "Key": "Profile",
2524
+                "Value": "default"
2525
+            },
2526
+            {
2527
+                "Key": "Name",
2528
+                "Value": "apparmor"
2529
+            },
2530
+            {
2531
+                "Key": "Name",
2532
+                "Value": "selinux"
2533
+            },
2534
+            {
2535
+                "Key": "Name",
2536
+                "Value": "userns"
2537
+            }
2538
+        ],
2539
+        "ServerVersion": "1.9.0",
2540
+        "SwapLimit": false,
2541
+        "SystemStatus": [["State", "Healthy"]],
2542
+        "SystemTime": "2015-03-10T11:11:23.730591467-07:00"
2543
+    }
2544
+
2545
+
2546
+**Example response (Windows)**:
2547
+
2548
+    HTTP/1.1 200 OK
2549
+    Content-Type: application/json
2550
+
2551
+    {
2552
+        "ID": "NYMS:B5VK:UMSL:FVDZ:EWB5:FKVK:LPFL:FJMQ:H6FT:BZJ6:L2TD:XH62",
2553
+        "Containers": 1,
2554
+        "ContainersRunning": 0,
2555
+        "ContainersPaused": 0,
2556
+        "ContainersStopped": 1,
2557
+        "Images": 17,
2558
+        "Driver": "windowsfilter",
2559
+        "DriverStatus": [
2560
+            ["Windows", ""]
2561
+        ],
2562
+        "SystemStatus": null,
2563
+            "Plugins": {
2564
+                "Volume": ["local"],
2565
+                "Network": ["nat", "null", "overlay"],
2566
+                "Authorization": null
2567
+            },
2568
+        "MemoryLimit": false,
2569
+        "SwapLimit": false,
2570
+        "KernelMemory": false,
2571
+        "CpuCfsPeriod": false,
2572
+        "CpuCfsQuota": false,
2573
+        "CPUShares": false,
2574
+        "CPUSet": false,
2575
+        "IPv4Forwarding": true,
2576
+        "BridgeNfIptables": true,
2577
+        "BridgeNfIp6tables": true,
2578
+        "Debug": false,
2579
+        "NFd": -1,
2580
+        "OomKillDisable": false,
2581
+        "NGoroutines": 11,
2582
+        "SystemTime": "2016-09-23T11:59:58.9843533-07:00",
2583
+        "LoggingDriver": "json-file",
2584
+        "CgroupDriver": "",
2585
+        "NEventsListener": 0,
2586
+        "KernelVersion": "10.0 14393 (14393.206.amd64fre.rs1_release.160912-1937)",
2587
+        "OperatingSystem": "Windows Server 2016 Datacenter",
2588
+        "OSType": "windows",
2589
+        "Architecture": "x86_64",
2590
+        "IndexServerAddress": "https://index.docker.io/v1/",
2591
+        "RegistryConfig": {
2592
+                "InsecureRegistryCIDRs": ["127.0.0.0/8"],
2593
+                "IndexConfigs": {
2594
+                    "docker.io": {
2595
+                        "Name": "docker.io",
2596
+                        "Mirrors": null,
2597
+                        "Secure": true,
2598
+                        "Official": true
2599
+                    }
2600
+                },
2601
+                "Mirrors": null
2602
+        },
2603
+        "NCPU": 8,
2604
+        "MemTotal": 4293828608,
2605
+        "DockerRootDir": "C:\\control",
2606
+        "HttpProxy": "",
2607
+        "HttpsProxy": "",
2608
+        "NoProxy": "",
2609
+        "Name": "WIN-V0V70C0LU5P",
2610
+        "Labels": null,
2611
+        "ExperimentalBuild": false,
2612
+        "ServerVersion": "1.14.0-dev",
2613
+        "ClusterStore": "",
2614
+        "ClusterAdvertise": "",
2615
+        "SecurityOptions": null,
2616
+        "Runtimes": null,
2617
+        "DefaultRuntime": "",
2618
+        "Swarm": {
2619
+            "NodeID": "",
2620
+            "NodeAddr": "",
2621
+            "LocalNodeState": "inactive",
2622
+            "ControlAvailable": false,
2623
+            "Error": "",
2624
+            "RemoteManagers": null,
2625
+            "Nodes": 0,
2626
+            "Managers": 0,
2627
+            "Cluster": {
2628
+                "ID": "",
2629
+                "Version": {},
2630
+                "CreatedAt": "0001-01-01T00:00:00Z",
2631
+                "UpdatedAt": "0001-01-01T00:00:00Z",
2632
+                "Spec": {
2633
+                    "Orchestration": {},
2634
+                    "Raft": {
2635
+                        "ElectionTick": 0,
2636
+                        "HeartbeatTick": 0
2637
+                    },
2638
+                    "Dispatcher": {},
2639
+                    "CAConfig": {},
2640
+                    "TaskDefaults": {}
2641
+                }
2642
+            }
2643
+        },
2644
+        "LiveRestoreEnabled": false,
2645
+        "Isolation": "process"
2646
+    }
2647
+
2648
+**Status codes**:
2649
+
2650
+-   **200** – no error
2651
+-   **500** – server error
2652
+
2653
+### Show docker data usage information
2654
+
2655
+`GET /system/df`
2656
+
2657
+Return docker data usage information
2658
+
2659
+**Example request**:
2660
+
2661
+    GET /v1.26/system/df HTTP/1.1
2662
+
2663
+**Example response**:
2664
+
2665
+    {
2666
+        "LayersSize": 1092588,
2667
+        "Images": [
2668
+            {
2669
+                "Id": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749",
2670
+                "ParentId": "",
2671
+                "RepoTags": [
2672
+                    "busybox:latest"
2673
+                ],
2674
+                "RepoDigests": [
2675
+                    "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6"
2676
+                ],
2677
+                "Created": 1466724217,
2678
+                "Size": 1092588,
2679
+                "SharedSize": 0,
2680
+                "VirtualSize": 1092588,
2681
+                "Labels": {},
2682
+                "Containers": 1
2683
+            }
2684
+        ],
2685
+        "Containers": [
2686
+            {
2687
+                "Id": "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148",
2688
+                "Names": [
2689
+                    "/top"
2690
+                ],
2691
+                "Image": "busybox",
2692
+                "ImageID": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749",
2693
+                "Command": "top",
2694
+                "Created": 1472592424,
2695
+                "Ports": [],
2696
+                "SizeRootFs": 1092588,
2697
+                "Labels": {},
2698
+                "State": "exited",
2699
+                "Status": "Exited (0) 56 minutes ago",
2700
+                "HostConfig": {
2701
+                    "NetworkMode": "default"
2702
+                },
2703
+                "NetworkSettings": {
2704
+                    "Networks": {
2705
+                        "bridge": {
2706
+                            "IPAMConfig": null,
2707
+                            "Links": null,
2708
+                            "Aliases": null,
2709
+                            "NetworkID": "d687bc59335f0e5c9ee8193e5612e8aee000c8c62ea170cfb99c098f95899d92",
2710
+                            "EndpointID": "8ed5115aeaad9abb174f68dcf135b49f11daf597678315231a32ca28441dec6a",
2711
+                            "Gateway": "172.18.0.1",
2712
+                            "IPAddress": "172.18.0.2",
2713
+                            "IPPrefixLen": 16,
2714
+                            "IPv6Gateway": "",
2715
+                            "GlobalIPv6Address": "",
2716
+                            "GlobalIPv6PrefixLen": 0,
2717
+                            "MacAddress": "02:42:ac:12:00:02"
2718
+                        }
2719
+                    }
2720
+                },
2721
+                "Mounts": []
2722
+            }
2723
+        ],
2724
+        "Volumes": [
2725
+                {
2726
+                    "Name": "my-volume",
2727
+                    "Driver": "local",
2728
+                    "Mountpoint": "",
2729
+                    "Labels": null,
2730
+                    "Scope": "",
2731
+                    "Options": null
2732
+                    "UsageData": {
2733
+                        "Size": 0,
2734
+                        "RefCount": 0
2735
+                    }
2736
+                }
2737
+        ]
2738
+    }
2739
+
2740
+**Status codes**:
2741
+
2742
+-   **200** – no error
2743
+-   **500** – server error
2744
+
2745
+### Show the docker version information
2746
+
2747
+`GET /version`
2748
+
2749
+Show the docker version information
2750
+
2751
+**Example request**:
2752
+
2753
+    GET /v1.26/version HTTP/1.1
2754
+
2755
+**Example response**:
2756
+
2757
+    HTTP/1.1 200 OK
2758
+    Content-Type: application/json
2759
+
2760
+    {
2761
+         "Version": "1.14.0",
2762
+         "Os": "linux",
2763
+         "KernelVersion": "3.19.0-23-generic",
2764
+         "GoVersion": "go1.6.3",
2765
+         "GitCommit": "deadbee",
2766
+         "Arch": "amd64",
2767
+         "ApiVersion": "1.26",
2768
+         "MinAPIVersion": "1.12",
2769
+         "BuildTime": "2016-06-14T07:09:13.444803460+00:00",
2770
+         "Experimental": true
2771
+    }
2772
+
2773
+**Status codes**:
2774
+
2775
+-   **200** – no error
2776
+-   **500** – server error
2777
+
2778
+### Ping the docker server
2779
+
2780
+`GET /_ping`
2781
+
2782
+Ping the docker server
2783
+
2784
+**Example request**:
2785
+
2786
+    GET /v1.26/_ping HTTP/1.1
2787
+
2788
+**Example response**:
2789
+
2790
+    HTTP/1.1 200 OK
2791
+    Content-Type: text/plain
2792
+
2793
+    OK
2794
+
2795
+**Status codes**:
2796
+
2797
+-   **200** - no error
2798
+-   **500** - server error
2799
+
2800
+### Create a new image from a container's changes
2801
+
2802
+`POST /commit`
2803
+
2804
+Create a new image from a container's changes
2805
+
2806
+**Example request**:
2807
+
2808
+    POST /v1.26/commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1
2809
+    Content-Type: application/json
2810
+
2811
+    {
2812
+         "Hostname": "",
2813
+         "Domainname": "",
2814
+         "User": "",
2815
+         "AttachStdin": false,
2816
+         "AttachStdout": true,
2817
+         "AttachStderr": true,
2818
+         "Tty": false,
2819
+         "OpenStdin": false,
2820
+         "StdinOnce": false,
2821
+         "Env": null,
2822
+         "Cmd": [
2823
+                 "date"
2824
+         ],
2825
+         "Mounts": [
2826
+           {
2827
+             "Source": "/data",
2828
+             "Destination": "/data",
2829
+             "Mode": "ro,Z",
2830
+             "RW": false
2831
+           }
2832
+         ],
2833
+         "Labels": {
2834
+                 "key1": "value1",
2835
+                 "key2": "value2"
2836
+          },
2837
+         "WorkingDir": "",
2838
+         "NetworkDisabled": false,
2839
+         "ExposedPorts": {
2840
+                 "22/tcp": {}
2841
+         }
2842
+    }
2843
+
2844
+**Example response**:
2845
+
2846
+    HTTP/1.1 201 Created
2847
+    Content-Type: application/json
2848
+
2849
+    {"Id": "596069db4bf5"}
2850
+
2851
+**JSON parameters**:
2852
+
2853
+-  **config** - the container's configuration
2854
+
2855
+**Query parameters**:
2856
+
2857
+-   **container** – source container
2858
+-   **repo** – repository
2859
+-   **tag** – tag
2860
+-   **comment** – commit message
2861
+-   **author** – author (e.g., "John Hannibal Smith
2862
+    <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>")
2863
+-   **pause** – 1/True/true or 0/False/false, whether to pause the container before committing
2864
+-   **changes** – Dockerfile instructions to apply while committing
2865
+
2866
+**Status codes**:
2867
+
2868
+-   **201** – no error
2869
+-   **404** – no such container
2870
+-   **500** – server error
2871
+
2872
+### Monitor Docker's events
2873
+
2874
+`GET /events`
2875
+
2876
+Get container events from docker, in real time via streaming.
2877
+
2878
+Docker containers report the following events:
2879
+
2880
+    attach, commit, copy, create, destroy, detach, die, exec_create, exec_detach, exec_start, export, kill, oom, pause, rename, resize, restart, start, stop, top, unpause, update
2881
+
2882
+Docker images report the following events:
2883
+
2884
+    delete, import, load, pull, push, save, tag, untag
2885
+
2886
+Docker volumes report the following events:
2887
+
2888
+    create, mount, unmount, destroy
2889
+
2890
+Docker networks report the following events:
2891
+
2892
+    create, connect, disconnect, destroy
2893
+
2894
+Docker daemon report the following event:
2895
+
2896
+    reload
2897
+
2898
+**Example request**:
2899
+
2900
+    GET /events?since=1374067924
2901
+
2902
+**Example response**:
2903
+
2904
+    HTTP/1.1 200 OK
2905
+    Content-Type: application/json
2906
+    Server: Docker/1.11.0 (linux)
2907
+    Date: Fri, 29 Apr 2016 15:18:06 GMT
2908
+    Transfer-Encoding: chunked
2909
+
2910
+    {
2911
+      "status": "pull",
2912
+      "id": "alpine:latest",
2913
+      "Type": "image",
2914
+      "Action": "pull",
2915
+      "Actor": {
2916
+        "ID": "alpine:latest",
2917
+        "Attributes": {
2918
+          "name": "alpine"
2919
+        }
2920
+      },
2921
+      "time": 1461943101,
2922
+      "timeNano": 1461943101301854122
2923
+    }
2924
+    {
2925
+      "status": "create",
2926
+      "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
2927
+      "from": "alpine",
2928
+      "Type": "container",
2929
+      "Action": "create",
2930
+      "Actor": {
2931
+        "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
2932
+        "Attributes": {
2933
+          "com.example.some-label": "some-label-value",
2934
+          "image": "alpine",
2935
+          "name": "my-container"
2936
+        }
2937
+      },
2938
+      "time": 1461943101,
2939
+      "timeNano": 1461943101381709551
2940
+    }
2941
+    {
2942
+      "status": "attach",
2943
+      "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
2944
+      "from": "alpine",
2945
+      "Type": "container",
2946
+      "Action": "attach",
2947
+      "Actor": {
2948
+        "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
2949
+        "Attributes": {
2950
+          "com.example.some-label": "some-label-value",
2951
+          "image": "alpine",
2952
+          "name": "my-container"
2953
+        }
2954
+      },
2955
+      "time": 1461943101,
2956
+      "timeNano": 1461943101383858412
2957
+    }
2958
+    {
2959
+      "Type": "network",
2960
+      "Action": "connect",
2961
+      "Actor": {
2962
+        "ID": "7dc8ac97d5d29ef6c31b6052f3938c1e8f2749abbd17d1bd1febf2608db1b474",
2963
+        "Attributes": {
2964
+          "container": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
2965
+          "name": "bridge",
2966
+          "type": "bridge"
2967
+        }
2968
+      },
2969
+      "time": 1461943101,
2970
+      "timeNano": 1461943101394865557
2971
+    }
2972
+    {
2973
+      "status": "start",
2974
+      "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
2975
+      "from": "alpine",
2976
+      "Type": "container",
2977
+      "Action": "start",
2978
+      "Actor": {
2979
+        "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
2980
+        "Attributes": {
2981
+          "com.example.some-label": "some-label-value",
2982
+          "image": "alpine",
2983
+          "name": "my-container"
2984
+        }
2985
+      },
2986
+      "time": 1461943101,
2987
+      "timeNano": 1461943101607533796
2988
+    }
2989
+    {
2990
+      "status": "resize",
2991
+      "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
2992
+      "from": "alpine",
2993
+      "Type": "container",
2994
+      "Action": "resize",
2995
+      "Actor": {
2996
+        "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
2997
+        "Attributes": {
2998
+          "com.example.some-label": "some-label-value",
2999
+          "height": "46",
3000
+          "image": "alpine",
3001
+          "name": "my-container",
3002
+          "width": "204"
3003
+        }
3004
+      },
3005
+      "time": 1461943101,
3006
+      "timeNano": 1461943101610269268
3007
+    }
3008
+    {
3009
+      "status": "die",
3010
+      "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
3011
+      "from": "alpine",
3012
+      "Type": "container",
3013
+      "Action": "die",
3014
+      "Actor": {
3015
+        "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
3016
+        "Attributes": {
3017
+          "com.example.some-label": "some-label-value",
3018
+          "exitCode": "0",
3019
+          "image": "alpine",
3020
+          "name": "my-container"
3021
+        }
3022
+      },
3023
+      "time": 1461943105,
3024
+      "timeNano": 1461943105079144137
3025
+    }
3026
+    {
3027
+      "Type": "network",
3028
+      "Action": "disconnect",
3029
+      "Actor": {
3030
+        "ID": "7dc8ac97d5d29ef6c31b6052f3938c1e8f2749abbd17d1bd1febf2608db1b474",
3031
+        "Attributes": {
3032
+          "container": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
3033
+          "name": "bridge",
3034
+          "type": "bridge"
3035
+        }
3036
+      },
3037
+      "time": 1461943105,
3038
+      "timeNano": 1461943105230860245
3039
+    }
3040
+    {
3041
+      "status": "destroy",
3042
+      "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
3043
+      "from": "alpine",
3044
+      "Type": "container",
3045
+      "Action": "destroy",
3046
+      "Actor": {
3047
+        "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743",
3048
+        "Attributes": {
3049
+          "com.example.some-label": "some-label-value",
3050
+          "image": "alpine",
3051
+          "name": "my-container"
3052
+        }
3053
+      },
3054
+      "time": 1461943105,
3055
+      "timeNano": 1461943105338056026
3056
+    }
3057
+
3058
+**Query parameters**:
3059
+
3060
+-   **since** – Timestamp. Show all events created since timestamp and then stream
3061
+-   **until** – Timestamp. Show events created until given timestamp and stop streaming
3062
+-   **filters** – A json encoded value of the filters (a map[string][]string) to process on the event list. Available filters:
3063
+  -   `container=<string>`; -- container to filter
3064
+  -   `event=<string>`; -- event to filter
3065
+  -   `image=<string>`; -- image to filter
3066
+  -   `label=<string>`; -- image and container label to filter
3067
+  -   `type=<string>`; -- either `container` or `image` or `volume` or `network` or `daemon`
3068
+  -   `volume=<string>`; -- volume to filter
3069
+  -   `network=<string>`; -- network to filter
3070
+  -   `daemon=<string>`; -- daemon name or id to filter
3071
+
3072
+**Status codes**:
3073
+
3074
+-   **200** – no error
3075
+-   **500** – server error
3076
+
3077
+### Get a tarball containing all images in a repository
3078
+
3079
+`GET /images/(name)/get`
3080
+
3081
+Get a tarball containing all images and metadata for the repository specified
3082
+by `name`.
3083
+
3084
+If `name` is a specific name and tag (e.g. ubuntu:latest), then only that image
3085
+(and its parents) are returned. If `name` is an image ID, similarly only that
3086
+image (and its parents) are returned, but with the exclusion of the
3087
+'repositories' file in the tarball, as there were no image names referenced.
3088
+
3089
+See the [image tarball format](#image-tarball-format) for more details.
3090
+
3091
+**Example request**
3092
+
3093
+    GET /images/ubuntu/get
3094
+
3095
+**Example response**:
3096
+
3097
+    HTTP/1.1 200 OK
3098
+    Content-Type: application/x-tar
3099
+
3100
+    Binary data stream
3101
+
3102
+**Status codes**:
3103
+
3104
+-   **200** – no error
3105
+-   **500** – server error
3106
+
3107
+### Get a tarball containing all images
3108
+
3109
+`GET /images/get`
3110
+
3111
+Get a tarball containing all images and metadata for one or more repositories.
3112
+
3113
+For each value of the `names` parameter: if it is a specific name and tag (e.g.
3114
+`ubuntu:latest`), then only that image (and its parents) are returned; if it is
3115
+an image ID, similarly only that image (and its parents) are returned and there
3116
+would be no names referenced in the 'repositories' file for this image ID.
3117
+
3118
+See the [image tarball format](#image-tarball-format) for more details.
3119
+
3120
+**Example request**
3121
+
3122
+    GET /images/get?names=myname%2Fmyapp%3Alatest&names=busybox
3123
+
3124
+**Example response**:
3125
+
3126
+    HTTP/1.1 200 OK
3127
+    Content-Type: application/x-tar
3128
+
3129
+    Binary data stream
3130
+
3131
+**Status codes**:
3132
+
3133
+-   **200** – no error
3134
+-   **500** – server error
3135
+
3136
+### Load a tarball with a set of images and tags into docker
3137
+
3138
+`POST /images/load`
3139
+
3140
+Load a set of images and tags into a Docker repository.
3141
+See the [image tarball format](#image-tarball-format) for more details.
3142
+
3143
+**Example request**
3144
+
3145
+    POST /images/load
3146
+    Content-Type: application/x-tar
3147
+
3148
+    Tarball in body
3149
+
3150
+**Example response**:
3151
+
3152
+    HTTP/1.1 200 OK
3153
+    Content-Type: application/json
3154
+    Transfer-Encoding: chunked
3155
+
3156
+    {"status":"Loading layer","progressDetail":{"current":32768,"total":1292800},"progress":"[=                                                 ] 32.77 kB/1.293 MB","id":"8ac8bfaff55a"}
3157
+    {"status":"Loading layer","progressDetail":{"current":65536,"total":1292800},"progress":"[==                                                ] 65.54 kB/1.293 MB","id":"8ac8bfaff55a"}
3158
+    {"status":"Loading layer","progressDetail":{"current":98304,"total":1292800},"progress":"[===                                               ]  98.3 kB/1.293 MB","id":"8ac8bfaff55a"}
3159
+    {"status":"Loading layer","progressDetail":{"current":131072,"total":1292800},"progress":"[=====                                             ] 131.1 kB/1.293 MB","id":"8ac8bfaff55a"}
3160
+    ...
3161
+    {"stream":"Loaded image: busybox:latest\n"}
3162
+
3163
+**Example response**:
3164
+
3165
+If the "quiet" query parameter is set to `true` / `1` (`?quiet=1`), progress
3166
+details are suppressed, and only a confirmation message is returned once the
3167
+action completes.
3168
+
3169
+    HTTP/1.1 200 OK
3170
+    Content-Type: application/json
3171
+    Transfer-Encoding: chunked
3172
+
3173
+    {"stream":"Loaded image: busybox:latest\n"}
3174
+
3175
+**Query parameters**:
3176
+
3177
+-   **quiet** – Boolean value, suppress progress details during load. Defaults
3178
+      to `0` / `false` if omitted.
3179
+
3180
+**Status codes**:
3181
+
3182
+-   **200** – no error
3183
+-   **500** – server error
3184
+
3185
+### Image tarball format
3186
+
3187
+An image tarball contains one directory per image layer (named using its long ID),
3188
+each containing these files:
3189
+
3190
+- `VERSION`: currently `1.0` - the file format version
3191
+- `json`: detailed layer information, similar to `docker inspect layer_id`
3192
+- `layer.tar`: A tarfile containing the filesystem changes in this layer
3193
+
3194
+The `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories
3195
+for storing attribute changes and deletions.
3196
+
3197
+If the tarball defines a repository, the tarball should also include a `repositories` file at
3198
+the root that contains a list of repository and tag names mapped to layer IDs.
3199
+
3200
+```
3201
+{"hello-world":
3202
+    {"latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"}
3203
+}
3204
+```
3205
+
3206
+### Exec Create
3207
+
3208
+`POST /containers/(id or name)/exec`
3209
+
3210
+Sets up an exec instance in a running container `id`
3211
+
3212
+**Example request**:
3213
+
3214
+    POST /v1.26/containers/e90e34656806/exec HTTP/1.1
3215
+    Content-Type: application/json
3216
+
3217
+    {
3218
+      "AttachStdin": true,
3219
+      "AttachStdout": true,
3220
+      "AttachStderr": true,
3221
+      "Cmd": ["sh"],
3222
+      "DetachKeys": "ctrl-p,ctrl-q",
3223
+      "Env": [
3224
+        "FOO=bar",
3225
+        "BAZ=quux"
3226
+      ],
3227
+      "Privileged": true,
3228
+      "Tty": true,
3229
+      "User": "123:456"
3230
+    }
3231
+
3232
+**Example response**:
3233
+
3234
+    HTTP/1.1 201 Created
3235
+    Content-Type: application/json
3236
+
3237
+    {
3238
+         "Id": "f90e34656806",
3239
+         "Warnings":[]
3240
+    }
3241
+
3242
+**JSON parameters**:
3243
+
3244
+-   **AttachStdin** - Boolean value, attaches to `stdin` of the `exec` command.
3245
+-   **AttachStdout** - Boolean value, attaches to `stdout` of the `exec` command.
3246
+-   **AttachStderr** - Boolean value, attaches to `stderr` of the `exec` command.
3247
+-   **DetachKeys** – Override the key sequence for detaching a
3248
+        container. Format is a single character `[a-Z]` or `ctrl-<value>`
3249
+        where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`.
3250
+-   **Tty** - Boolean value to allocate a pseudo-TTY.
3251
+-   **Env** - A list of environment variables in the form of `["VAR=value", ...]`
3252
+-   **Cmd** - Command to run specified as a string or an array of strings.
3253
+-   **Privileged** - Boolean value, runs the exec process with extended privileges.
3254
+-   **User** - A string value specifying the user, and optionally, group to run
3255
+        the exec process inside the container. Format is one of: `"user"`,
3256
+        `"user:group"`, `"uid"`, or `"uid:gid"`.
3257
+
3258
+**Status codes**:
3259
+
3260
+-   **201** – no error
3261
+-   **404** – no such container
3262
+-   **409** - container is paused
3263
+-   **500** - server error
3264
+
3265
+### Exec Start
3266
+
3267
+`POST /exec/(id)/start`
3268
+
3269
+Starts a previously set up `exec` instance `id`. If `detach` is true, this API
3270
+returns after starting the `exec` command. Otherwise, this API sets up an
3271
+interactive session with the `exec` command.
3272
+
3273
+**Example request**:
3274
+
3275
+    POST /v1.26/exec/e90e34656806/start HTTP/1.1
3276
+    Content-Type: application/json
3277
+
3278
+    {
3279
+     "Detach": false,
3280
+     "Tty": false
3281
+    }
3282
+
3283
+**Example response**:
3284
+
3285
+    HTTP/1.1 200 OK
3286
+    Content-Type: application/vnd.docker.raw-stream
3287
+
3288
+    {% raw %}
3289
+    {{ STREAM }}
3290
+    {% endraw %}
3291
+
3292
+**JSON parameters**:
3293
+
3294
+-   **Detach** - Detach from the `exec` command.
3295
+-   **Tty** - Boolean value to allocate a pseudo-TTY.
3296
+
3297
+**Status codes**:
3298
+
3299
+-   **200** – no error
3300
+-   **404** – no such exec instance
3301
+-   **409** - container is paused
3302
+
3303
+**Stream details**:
3304
+
3305
+Similar to the stream behavior of `POST /containers/(id or name)/attach` API
3306
+
3307
+### Exec Resize
3308
+
3309
+`POST /exec/(id)/resize`
3310
+
3311
+Resizes the `tty` session used by the `exec` command `id`.  The unit is number of characters.
3312
+This API is valid only if `tty` was specified as part of creating and starting the `exec` command.
3313
+
3314
+**Example request**:
3315
+
3316
+    POST /v1.26/exec/e90e34656806/resize?h=40&w=80 HTTP/1.1
3317
+    Content-Type: text/plain
3318
+
3319
+**Example response**:
3320
+
3321
+    HTTP/1.1 201 Created
3322
+    Content-Type: text/plain
3323
+
3324
+**Query parameters**:
3325
+
3326
+-   **h** – height of `tty` session
3327
+-   **w** – width
3328
+
3329
+**Status codes**:
3330
+
3331
+-   **201** – no error
3332
+-   **404** – no such exec instance
3333
+
3334
+### Exec Inspect
3335
+
3336
+`GET /exec/(id)/json`
3337
+
3338
+Return low-level information about the `exec` command `id`.
3339
+
3340
+**Example request**:
3341
+
3342
+    GET /v1.26/exec/11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39/json HTTP/1.1
3343
+
3344
+**Example response**:
3345
+
3346
+    HTTP/1.1 200 OK
3347
+    Content-Type: application/json
3348
+
3349
+    {
3350
+      "CanRemove": false,
3351
+      "ContainerID": "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126",
3352
+      "DetachKeys": "",
3353
+      "ExitCode": 2,
3354
+      "ID": "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b",
3355
+      "OpenStderr": true,
3356
+      "OpenStdin": true,
3357
+      "OpenStdout": true,
3358
+      "ProcessConfig": {
3359
+        "arguments": [
3360
+          "-c",
3361
+          "exit 2"
3362
+        ],
3363
+        "entrypoint": "sh",
3364
+        "privileged": false,
3365
+        "tty": true,
3366
+        "user": "1000"
3367
+      },
3368
+      "Running": false,
3369
+      "Pid": "42000"
3370
+    }
3371
+
3372
+**Status codes**:
3373
+
3374
+-   **200** – no error
3375
+-   **404** – no such exec instance
3376
+-   **500** - server error
3377
+
3378
+## 3.4 Volumes
3379
+
3380
+### List volumes
3381
+
3382
+`GET /volumes`
3383
+
3384
+**Example request**:
3385
+
3386
+    GET /v1.26/volumes HTTP/1.1
3387
+
3388
+**Example response**:
3389
+
3390
+    HTTP/1.1 200 OK
3391
+    Content-Type: application/json
3392
+
3393
+    {
3394
+      "Volumes": [
3395
+        {
3396
+          "Name": "tardis",
3397
+          "Driver": "local",
3398
+          "Mountpoint": "/var/lib/docker/volumes/tardis",
3399
+          "Labels":{
3400
+            "com.example.some-label": "some-value",
3401
+            "com.example.some-other-label": "some-other-value"
3402
+          },
3403
+          "Scope": "local",
3404
+          "Options": {
3405
+            "device": "tmpfs",
3406
+            "o": "size=100m,uid=1000",
3407
+            "type": "tmpfs"
3408
+          }
3409
+        }
3410
+      ],
3411
+      "Warnings": []
3412
+    }
3413
+
3414
+**Query parameters**:
3415
+
3416
+- **filters** - JSON encoded value of the filters (a `map[string][]string`) to process on the volumes list. Available filters:
3417
+  -   `name=<volume-name>` Matches all or part of a volume name.
3418
+  -   `dangling=<boolean>` When set to `true` (or `1`), returns all volumes that are "dangling" (not in use by a container). When set to `false` (or `0`), only volumes that are in use by one or more containers are returned.
3419
+  -   `driver=<volume-driver-name>` Matches all or part of a volume driver name.
3420
+
3421
+**Status codes**:
3422
+
3423
+-   **200** - no error
3424
+-   **500** - server error
3425
+
3426
+### Create a volume
3427
+
3428
+`POST /volumes/create`
3429
+
3430
+Create a volume
3431
+
3432
+**Example request**:
3433
+
3434
+    POST /v1.26/volumes/create HTTP/1.1
3435
+    Content-Type: application/json
3436
+
3437
+    {
3438
+      "Name": "tardis",
3439
+      "Labels": {
3440
+        "com.example.some-label": "some-value",
3441
+        "com.example.some-other-label": "some-other-value"
3442
+      },
3443
+      "Driver": "custom"
3444
+    }
3445
+
3446
+**Example response**:
3447
+
3448
+    HTTP/1.1 201 Created
3449
+    Content-Type: application/json
3450
+
3451
+    {
3452
+      "Name": "tardis",
3453
+      "Driver": "custom",
3454
+      "Mountpoint": "/var/lib/docker/volumes/tardis",
3455
+      "Status": {
3456
+        "hello": "world"
3457
+      },
3458
+      "Labels": {
3459
+        "com.example.some-label": "some-value",
3460
+        "com.example.some-other-label": "some-other-value"
3461
+      },
3462
+      "Scope": "local",
3463
+      "Options": null
3464
+    }
3465
+
3466
+**Status codes**:
3467
+
3468
+- **201** - no error
3469
+- **500**  - server error
3470
+
3471
+**JSON parameters**:
3472
+
3473
+- **Name** - The new volume's name. If not specified, Docker generates a name.
3474
+- **Driver** - Name of the volume driver to use. Defaults to `local` for the name.
3475
+- **DriverOpts** - A mapping of driver options and values. These options are
3476
+    passed directly to the driver and are driver specific.
3477
+- **Labels** - Labels to set on the volume, specified as a map: `{"key":"value","key2":"value2"}`
3478
+
3479
+**JSON fields in response**:
3480
+
3481
+Refer to the [inspect a volume](#inspect-a-volume) section or details about the
3482
+JSON fields returned in the response.
3483
+
3484
+### Inspect a volume
3485
+
3486
+`GET /volumes/(name)`
3487
+
3488
+Return low-level information on the volume `name`
3489
+
3490
+**Example request**:
3491
+
3492
+    GET /volumes/tardis
3493
+
3494
+**Example response**:
3495
+
3496
+    HTTP/1.1 200 OK
3497
+    Content-Type: application/json
3498
+
3499
+    {
3500
+      "Name": "tardis",
3501
+      "Driver": "custom",
3502
+      "Mountpoint": "/var/lib/docker/volumes/tardis/_data",
3503
+      "Status": {
3504
+        "hello": "world"
3505
+      },
3506
+      "Labels": {
3507
+          "com.example.some-label": "some-value",
3508
+          "com.example.some-other-label": "some-other-value"
3509
+      },
3510
+      "Scope": "local",
3511
+      "Options": {
3512
+          "some-key": "some-value",
3513
+          "some-other-key": "some-other-value"
3514
+      },
3515
+    }
3516
+
3517
+**Status codes**:
3518
+
3519
+-   **200** - no error
3520
+-   **404** - no such volume
3521
+-   **500** - server error
3522
+
3523
+**JSON fields in response**:
3524
+
3525
+The following fields can be returned in the API response. Empty fields, or
3526
+fields that are not supported by the volume's driver may be omitted in the
3527
+response.
3528
+
3529
+- **Name** - Name of the volume.
3530
+- **Driver** - Name of the volume driver used by the volume.
3531
+- **Mountpoint** - Mount path of the volume on the host.
3532
+- **Status** - Low-level details about the volume, provided by the volume driver.
3533
+    Details are returned as a map with key/value pairs: `{"key":"value","key2":"value2"}`.
3534
+    The `Status` field is optional, and is omitted if the volume driver does not
3535
+    support this feature.
3536
+- **Labels** - Labels set on the volume, specified as a map: `{"key":"value","key2":"value2"}`.
3537
+- **Scope** - Scope describes the level at which the volume exists, can be one of
3538
+    `global` for cluster-wide or `local` for machine level. The default is `local`.
3539
+- **Options** - Options holds the driver specific options to use for when creating the volume.
3540
+
3541
+### Remove a volume
3542
+
3543
+`DELETE /volumes/(name)`
3544
+
3545
+Instruct the driver to remove the volume (`name`).
3546
+
3547
+**Example request**:
3548
+
3549
+    DELETE /volumes/tardis HTTP/1.1
3550
+
3551
+**Example response**:
3552
+
3553
+    HTTP/1.1 204 No Content
3554
+
3555
+**Query Parameters**:
3556
+
3557
+-   **force** - 1/True/true or 0/False/false, Force the removal of the volume.
3558
+        Default `false`.
3559
+
3560
+**Status codes**:
3561
+
3562
+-   **204** - no error
3563
+-   **404** - no such volume or volume driver
3564
+-   **409** - volume is in use and cannot be removed
3565
+-   **500** - server error
3566
+
3567
+### Prune unused volumes
3568
+
3569
+`POST /volumes/prune`
3570
+
3571
+Delete unused volumes
3572
+
3573
+**Example request**:
3574
+
3575
+    POST /v1.26/volumes/prune HTTP/1.1
3576
+    Content-Type: application/json
3577
+
3578
+    {
3579
+    }
3580
+
3581
+**Example response**:
3582
+
3583
+    HTTP/1.1 200 OK
3584
+    Content-Type: application/json
3585
+
3586
+    {
3587
+        "VolumesDeleted": [
3588
+            "my-volume"
3589
+        ],
3590
+        "SpaceReclaimed": 42
3591
+    }
3592
+
3593
+**Status codes**:
3594
+
3595
+-   **200** – no error
3596
+-   **500** – server error
3597
+
3598
+
3599
+## 3.5 Networks
3600
+
3601
+### List networks
3602
+
3603
+`GET /networks`
3604
+
3605
+**Example request**:
3606
+
3607
+    GET /v1.26/networks?filters={"type":{"custom":true}} HTTP/1.1
3608
+
3609
+**Example response**:
3610
+
3611
+```
3612
+HTTP/1.1 200 OK
3613
+Content-Type: application/json
3614
+
3615
+[
3616
+  {
3617
+    "Name": "bridge",
3618
+    "Id": "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566",
3619
+    "Created": "2016-10-19T06:21:00.416543526Z",
3620
+    "Scope": "local",
3621
+    "Driver": "bridge",
3622
+    "EnableIPv6": false,
3623
+    "Internal": false,
3624
+    "IPAM": {
3625
+      "Driver": "default",
3626
+      "Config": [
3627
+        {
3628
+          "Subnet": "172.17.0.0/16"
3629
+        }
3630
+      ]
3631
+    },
3632
+    "Containers": {
3633
+      "39b69226f9d79f5634485fb236a23b2fe4e96a0a94128390a7fbbcc167065867": {
3634
+        "EndpointID": "ed2419a97c1d9954d05b46e462e7002ea552f216e9b136b80a7db8d98b442eda",
3635
+        "MacAddress": "02:42:ac:11:00:02",
3636
+        "IPv4Address": "172.17.0.2/16",
3637
+        "IPv6Address": ""
3638
+      }
3639
+    },
3640
+    "Options": {
3641
+      "com.docker.network.bridge.default_bridge": "true",
3642
+      "com.docker.network.bridge.enable_icc": "true",
3643
+      "com.docker.network.bridge.enable_ip_masquerade": "true",
3644
+      "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
3645
+      "com.docker.network.bridge.name": "docker0",
3646
+      "com.docker.network.driver.mtu": "1500"
3647
+    }
3648
+  },
3649
+  {
3650
+    "Name": "none",
3651
+    "Id": "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794",
3652
+    "Created": "0001-01-01T00:00:00Z",
3653
+    "Scope": "local",
3654
+    "Driver": "null",
3655
+    "EnableIPv6": false,
3656
+    "Internal": false,
3657
+    "IPAM": {
3658
+      "Driver": "default",
3659
+      "Config": []
3660
+    },
3661
+    "Containers": {},
3662
+    "Options": {}
3663
+  },
3664
+  {
3665
+    "Name": "host",
3666
+    "Id": "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e",
3667
+    "Created": "0001-01-01T00:00:00Z",
3668
+    "Scope": "local",
3669
+    "Driver": "host",
3670
+    "EnableIPv6": false,
3671
+    "Internal": false,
3672
+    "IPAM": {
3673
+      "Driver": "default",
3674
+      "Config": []
3675
+    },
3676
+    "Containers": {},
3677
+    "Options": {}
3678
+  }
3679
+]
3680
+```
3681
+
3682
+**Query parameters**:
3683
+
3684
+- **filters** - JSON encoded network list filter. The filter value is one of:
3685
+  -   `driver=<driver-name>` Matches a network's driver.
3686
+  -   `id=<network-id>` Matches all or part of a network id.
3687
+  -   `label=<key>` or `label=<key>=<value>` of a network label.
3688
+  -   `name=<network-name>` Matches all or part of a network name.
3689
+  -   `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks.
3690
+
3691
+**Status codes**:
3692
+
3693
+-   **200** - no error
3694
+-   **500** - server error
3695
+
3696
+### Inspect network
3697
+
3698
+`GET /networks/<network-id>`
3699
+
3700
+**Example request**:
3701
+
3702
+    GET /v1.26/networks/7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99 HTTP/1.1
3703
+
3704
+**Example response**:
3705
+
3706
+```
3707
+HTTP/1.1 200 OK
3708
+Content-Type: application/json
3709
+
3710
+{
3711
+  "Name": "net01",
3712
+  "Id": "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99",
3713
+  "Created": "2016-10-19T04:33:30.360899459Z",
3714
+  "Scope": "local",
3715
+  "Driver": "bridge",
3716
+  "EnableIPv6": false,
3717
+  "IPAM": {
3718
+    "Driver": "default",
3719
+    "Config": [
3720
+      {
3721
+        "Subnet": "172.19.0.0/16",
3722
+        "Gateway": "172.19.0.1"
3723
+      }
3724
+    ],
3725
+    "Options": {
3726
+        "foo": "bar"
3727
+    }
3728
+  },
3729
+  "Internal": false,
3730
+  "Containers": {
3731
+    "19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c": {
3732
+      "Name": "test",
3733
+      "EndpointID": "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a",
3734
+      "MacAddress": "02:42:ac:13:00:02",
3735
+      "IPv4Address": "172.19.0.2/16",
3736
+      "IPv6Address": ""
3737
+    }
3738
+  },
3739
+  "Options": {
3740
+    "com.docker.network.bridge.default_bridge": "true",
3741
+    "com.docker.network.bridge.enable_icc": "true",
3742
+    "com.docker.network.bridge.enable_ip_masquerade": "true",
3743
+    "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
3744
+    "com.docker.network.bridge.name": "docker0",
3745
+    "com.docker.network.driver.mtu": "1500"
3746
+  },
3747
+  "Labels": {
3748
+    "com.example.some-label": "some-value",
3749
+    "com.example.some-other-label": "some-other-value"
3750
+  }
3751
+}
3752
+```
3753
+
3754
+**Status codes**:
3755
+
3756
+-   **200** - no error
3757
+-   **404** - network not found
3758
+
3759
+### Create a network
3760
+
3761
+`POST /networks/create`
3762
+
3763
+Create a network
3764
+
3765
+**Example request**:
3766
+
3767
+```
3768
+POST /v1.26/networks/create HTTP/1.1
3769
+Content-Type: application/json
3770
+
3771
+{
3772
+  "Name":"isolated_nw",
3773
+  "CheckDuplicate":true,
3774
+  "Driver":"bridge",
3775
+  "EnableIPv6": true,
3776
+  "IPAM":{
3777
+    "Driver": "default",
3778
+    "Config":[
3779
+      {
3780
+        "Subnet":"172.20.0.0/16",
3781
+        "IPRange":"172.20.10.0/24",
3782
+        "Gateway":"172.20.10.11"
3783
+      },
3784
+      {
3785
+        "Subnet":"2001:db8:abcd::/64",
3786
+        "Gateway":"2001:db8:abcd::1011"
3787
+      }
3788
+    ],
3789
+    "Options": {
3790
+      "foo": "bar"
3791
+    }
3792
+  },
3793
+  "Internal":true,
3794
+  "Options": {
3795
+    "com.docker.network.bridge.default_bridge": "true",
3796
+    "com.docker.network.bridge.enable_icc": "true",
3797
+    "com.docker.network.bridge.enable_ip_masquerade": "true",
3798
+    "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
3799
+    "com.docker.network.bridge.name": "docker0",
3800
+    "com.docker.network.driver.mtu": "1500"
3801
+  },
3802
+  "Labels": {
3803
+    "com.example.some-label": "some-value",
3804
+    "com.example.some-other-label": "some-other-value"
3805
+  }
3806
+}
3807
+```
3808
+
3809
+**Example response**:
3810
+
3811
+```
3812
+HTTP/1.1 201 Created
3813
+Content-Type: application/json
3814
+
3815
+{
3816
+  "Id": "22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30",
3817
+  "Warning": ""
3818
+}
3819
+```
3820
+
3821
+**Status codes**:
3822
+
3823
+- **201** - no error
3824
+- **404** - plugin not found
3825
+- **500** - server error
3826
+
3827
+**JSON parameters**:
3828
+
3829
+- **Name** - The new network's name. this is a mandatory field
3830
+- **CheckDuplicate** - Requests daemon to check for networks with same name. Defaults to `false`
3831
+- **Driver** - Name of the network driver plugin to use. Defaults to `bridge` driver
3832
+- **Internal** - Restrict external access to the network
3833
+- **IPAM** - Optional custom IP scheme for the network
3834
+  - **Driver** - Name of the IPAM driver to use. Defaults to `default` driver
3835
+  - **Config** - List of IPAM configuration options, specified as a map:
3836
+      `{"Subnet": <CIDR>, "IPRange": <CIDR>, "Gateway": <IP address>, "AuxAddress": <device_name:IP address>}`
3837
+  - **Options** - Driver-specific options, specified as a map: `{"option":"value" [,"option2":"value2"]}`
3838
+- **EnableIPv6** - Enable IPv6 on the network
3839
+- **Options** - Network specific options to be used by the drivers
3840
+- **Labels** - Labels to set on the network, specified as a map: `{"key":"value" [,"key2":"value2"]}`
3841
+
3842
+### Connect a container to a network
3843
+
3844
+`POST /networks/(id)/connect`
3845
+
3846
+Connect a container to a network
3847
+
3848
+**Example request**:
3849
+
3850
+```
3851
+POST /v1.26/networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30/connect HTTP/1.1
3852
+Content-Type: application/json
3853
+
3854
+{
3855
+  "Container":"3613f73ba0e4",
3856
+  "EndpointConfig": {
3857
+    "IPAMConfig": {
3858
+        "IPv4Address":"172.24.56.89",
3859
+        "IPv6Address":"2001:db8::5689"
3860
+    }
3861
+  }
3862
+}
3863
+```
3864
+
3865
+**Example response**:
3866
+
3867
+    HTTP/1.1 200 OK
3868
+
3869
+**Status codes**:
3870
+
3871
+- **200** - no error
3872
+- **403** - operation not supported for swarm scoped networks
3873
+- **404** - network or container is not found
3874
+- **500** - Internal Server Error
3875
+
3876
+**JSON parameters**:
3877
+
3878
+- **container** - container-id/name to be connected to the network
3879
+
3880
+### Disconnect a container from a network
3881
+
3882
+`POST /networks/(id)/disconnect`
3883
+
3884
+Disconnect a container from a network
3885
+
3886
+**Example request**:
3887
+
3888
+```
3889
+POST /v1.26/networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30/disconnect HTTP/1.1
3890
+Content-Type: application/json
3891
+
3892
+{
3893
+  "Container":"3613f73ba0e4",
3894
+  "Force":false
3895
+}
3896
+```
3897
+
3898
+**Example response**:
3899
+
3900
+    HTTP/1.1 200 OK
3901
+
3902
+**Status codes**:
3903
+
3904
+- **200** - no error
3905
+- **403** - operation not supported for swarm scoped networks
3906
+- **404** - network or container not found
3907
+- **500** - Internal Server Error
3908
+
3909
+**JSON parameters**:
3910
+
3911
+- **Container** - container-id/name to be disconnected from a network
3912
+- **Force** - Force the container to disconnect from a network
3913
+
3914
+### Remove a network
3915
+
3916
+`DELETE /networks/(id)`
3917
+
3918
+Instruct the driver to remove the network (`id`).
3919
+
3920
+**Example request**:
3921
+
3922
+    DELETE /networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30 HTTP/1.1
3923
+
3924
+**Example response**:
3925
+
3926
+    HTTP/1.1 204 No Content
3927
+
3928
+**Status codes**:
3929
+
3930
+-   **204** - no error
3931
+-   **404** - no such network
3932
+-   **500** - server error
3933
+
3934
+### Prune unused networks
3935
+
3936
+`POST /networks/prune`
3937
+
3938
+Delete unused networks
3939
+
3940
+**Example request**:
3941
+
3942
+    POST /v1.26/networks/prune HTTP/1.1
3943
+    Content-Type: application/json
3944
+
3945
+    {
3946
+    }
3947
+
3948
+**Example response**:
3949
+
3950
+    HTTP/1.1 200 OK
3951
+    Content-Type: application/json
3952
+
3953
+    {
3954
+        "NetworksDeleted": [
3955
+            "n1"
3956
+        ],
3957
+    }
3958
+
3959
+**Status codes**:
3960
+
3961
+-   **200** – no error
3962
+-   **500** – server error
3963
+
3964
+## 3.6 Plugins
3965
+
3966
+### List plugins
3967
+
3968
+`GET /plugins`
3969
+
3970
+Returns information about installed plugins.
3971
+
3972
+**Example request**:
3973
+
3974
+    GET /v1.26/plugins HTTP/1.1
3975
+
3976
+**Example response**:
3977
+
3978
+```
3979
+HTTP/1.1 200 OK
3980
+Content-Type: application/json
3981
+
3982
+[
3983
+  {
3984
+    "Id": "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078",
3985
+    "Name": "tiborvass/no-remove",
3986
+    "Tag": "latest",
3987
+    "Active": true,
3988
+    "Config": {
3989
+      "Mounts": [
3990
+        {
3991
+          "Name": "",
3992
+          "Description": "",
3993
+          "Settable": null,
3994
+          "Source": "/data",
3995
+          "Destination": "/data",
3996
+          "Type": "bind",
3997
+          "Options": [
3998
+            "shared",
3999
+            "rbind"
4000
+          ]
4001
+        },
4002
+        {
4003
+          "Name": "",
4004
+          "Description": "",
4005
+          "Settable": null,
4006
+          "Source": null,
4007
+          "Destination": "/foobar",
4008
+          "Type": "tmpfs",
4009
+          "Options": null
4010
+        }
4011
+      ],
4012
+      "Env": [
4013
+        "DEBUG=1"
4014
+      ],
4015
+      "Args": null,
4016
+      "Devices": null
4017
+    },
4018
+    "Manifest": {
4019
+      "ManifestVersion": "v0",
4020
+      "Description": "A test plugin for Docker",
4021
+      "Documentation": "https://docs.docker.com/engine/extend/plugins/",
4022
+      "Interface": {
4023
+        "Types": [
4024
+          "docker.volumedriver/1.0"
4025
+        ],
4026
+        "Socket": "plugins.sock"
4027
+      },
4028
+      "Entrypoint": [
4029
+        "plugin-no-remove",
4030
+        "/data"
4031
+      ],
4032
+      "Workdir": "",
4033
+      "User": {
4034
+      },
4035
+      "Network": {
4036
+        "Type": "host"
4037
+      },
4038
+      "Capabilities": null,
4039
+      "Mounts": [
4040
+        {
4041
+          "Name": "",
4042
+          "Description": "",
4043
+          "Settable": null,
4044
+          "Source": "/data",
4045
+          "Destination": "/data",
4046
+          "Type": "bind",
4047
+          "Options": [
4048
+            "shared",
4049
+            "rbind"
4050
+          ]
4051
+        },
4052
+        {
4053
+          "Name": "",
4054
+          "Description": "",
4055
+          "Settable": null,
4056
+          "Source": null,
4057
+          "Destination": "/foobar",
4058
+          "Type": "tmpfs",
4059
+          "Options": null
4060
+        }
4061
+      ],
4062
+      "Devices": [
4063
+        {
4064
+          "Name": "device",
4065
+          "Description": "a host device to mount",
4066
+          "Settable": null,
4067
+          "Path": "/dev/cpu_dma_latency"
4068
+        }
4069
+      ],
4070
+      "Env": [
4071
+        {
4072
+          "Name": "DEBUG",
4073
+          "Description": "If set, prints debug messages",
4074
+          "Settable": null,
4075
+          "Value": "1"
4076
+        }
4077
+      ],
4078
+      "Args": {
4079
+        "Name": "args",
4080
+        "Description": "command line arguments",
4081
+        "Settable": null,
4082
+        "Value": [
4083
+
4084
+        ]
4085
+      }
4086
+    }
4087
+  }
4088
+]
4089
+```
4090
+
4091
+**Status codes**:
4092
+
4093
+-   **200** - no error
4094
+-   **500** - server error
4095
+
4096
+### Install a plugin
4097
+
4098
+`POST /plugins/pull?name=<plugin name>`
4099
+
4100
+Pulls and installs a plugin. After the plugin is installed, it can be enabled
4101
+using the [`POST /plugins/(plugin name)/enable` endpoint](#enable-a-plugin).
4102
+
4103
+**Example request**:
4104
+
4105
+```
4106
+POST /v1.26/plugins/pull?name=tiborvass/no-remove:latest HTTP/1.1
4107
+```
4108
+
4109
+The `:latest` tag is optional, and is used as default if omitted. When using
4110
+this endpoint to pull a plugin from the registry, the `X-Registry-Auth` header
4111
+can be used to include a base64-encoded AuthConfig object. Refer to the [create
4112
+an image](#create-an-image) section for more details.
4113
+
4114
+**Example response**:
4115
+
4116
+```
4117
+HTTP/1.1 200 OK
4118
+Content-Type: application/json
4119
+Content-Length: 175
4120
+
4121
+[
4122
+  {
4123
+    "Name": "network",
4124
+    "Description": "",
4125
+    "Value": [
4126
+      "host"
4127
+    ]
4128
+  },
4129
+  {
4130
+    "Name": "mount",
4131
+    "Description": "",
4132
+    "Value": [
4133
+      "/data"
4134
+    ]
4135
+  },
4136
+  {
4137
+    "Name": "device",
4138
+    "Description": "",
4139
+    "Value": [
4140
+      "/dev/cpu_dma_latency"
4141
+    ]
4142
+  }
4143
+]
4144
+```
4145
+
4146
+**Query parameters**:
4147
+
4148
+- **name** -  Name of the plugin to pull. The name may include a tag or digest.
4149
+    This parameter is required.
4150
+
4151
+**Status codes**:
4152
+
4153
+-   **200** - no error
4154
+-   **500** - error parsing reference / not a valid repository/tag: repository
4155
+      name must have at least one component
4156
+-   **500** - plugin already exists
4157
+
4158
+### Inspect a plugin
4159
+
4160
+`GET /plugins/(plugin name)`
4161
+
4162
+Returns detailed information about an installed plugin.
4163
+
4164
+**Example request**:
4165
+
4166
+```
4167
+GET /v1.26/plugins/tiborvass/no-remove:latest HTTP/1.1
4168
+```
4169
+
4170
+The `:latest` tag is optional, and is used as default if omitted.
4171
+
4172
+
4173
+**Example response**:
4174
+
4175
+```
4176
+HTTP/1.1 200 OK
4177
+Content-Type: application/json
4178
+
4179
+{
4180
+  "Id": "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078",
4181
+  "Name": "tiborvass/no-remove",
4182
+  "Tag": "latest",
4183
+  "Active": false,
4184
+  "Config": {
4185
+    "Mounts": [
4186
+      {
4187
+        "Name": "",
4188
+        "Description": "",
4189
+        "Settable": null,
4190
+        "Source": "/data",
4191
+        "Destination": "/data",
4192
+        "Type": "bind",
4193
+        "Options": [
4194
+          "shared",
4195
+          "rbind"
4196
+        ]
4197
+      },
4198
+      {
4199
+        "Name": "",
4200
+        "Description": "",
4201
+        "Settable": null,
4202
+        "Source": null,
4203
+        "Destination": "/foobar",
4204
+        "Type": "tmpfs",
4205
+        "Options": null
4206
+      }
4207
+    ],
4208
+    "Env": [
4209
+      "DEBUG=1"
4210
+    ],
4211
+    "Args": null,
4212
+    "Devices": null
4213
+  },
4214
+  "Manifest": {
4215
+    "ManifestVersion": "v0",
4216
+    "Description": "A test plugin for Docker",
4217
+    "Documentation": "https://docs.docker.com/engine/extend/plugins/",
4218
+    "Interface": {
4219
+      "Types": [
4220
+        "docker.volumedriver/1.0"
4221
+      ],
4222
+      "Socket": "plugins.sock"
4223
+    },
4224
+    "Entrypoint": [
4225
+      "plugin-no-remove",
4226
+      "/data"
4227
+    ],
4228
+    "Workdir": "",
4229
+    "User": {
4230
+    },
4231
+    "Network": {
4232
+      "Type": "host"
4233
+    },
4234
+    "Capabilities": null,
4235
+    "Mounts": [
4236
+      {
4237
+        "Name": "",
4238
+        "Description": "",
4239
+        "Settable": null,
4240
+        "Source": "/data",
4241
+        "Destination": "/data",
4242
+        "Type": "bind",
4243
+        "Options": [
4244
+          "shared",
4245
+          "rbind"
4246
+        ]
4247
+      },
4248
+      {
4249
+        "Name": "",
4250
+        "Description": "",
4251
+        "Settable": null,
4252
+        "Source": null,
4253
+        "Destination": "/foobar",
4254
+        "Type": "tmpfs",
4255
+        "Options": null
4256
+      }
4257
+    ],
4258
+    "Devices": [
4259
+      {
4260
+        "Name": "device",
4261
+        "Description": "a host device to mount",
4262
+        "Settable": null,
4263
+        "Path": "/dev/cpu_dma_latency"
4264
+      }
4265
+    ],
4266
+    "Env": [
4267
+      {
4268
+        "Name": "DEBUG",
4269
+        "Description": "If set, prints debug messages",
4270
+        "Settable": null,
4271
+        "Value": "1"
4272
+      }
4273
+    ],
4274
+    "Args": {
4275
+      "Name": "args",
4276
+      "Description": "command line arguments",
4277
+      "Settable": null,
4278
+      "Value": [
4279
+
4280
+      ]
4281
+    }
4282
+  }
4283
+}
4284
+```
4285
+
4286
+**Status codes**:
4287
+
4288
+-   **200** - no error
4289
+-   **404** - plugin not installed
4290
+
4291
+### Configure a plugin
4292
+
4293
+`POST /plugins/(plugin name)/set`
4294
+
4295
+**Example request**:
4296
+
4297
+
4298
+    POST /plugins/tiborvass/no-remove/set
4299
+    Content-Type: application/json
4300
+
4301
+    ["DEBUG=1"]
4302
+
4303
+**Example response**:
4304
+
4305
+    HTTP/1.1 204 No Content
4306
+
4307
+**Status codes**:
4308
+
4309
+-   **204** - no error
4310
+-   **404** - plugin not installed
4311
+
4312
+### Enable a plugin
4313
+
4314
+`POST /plugins/(plugin name)/enable`
4315
+
4316
+Enables a plugin
4317
+
4318
+**Example request**:
4319
+
4320
+```
4321
+POST /v1.26/plugins/tiborvass/no-remove:latest/enable HTTP/1.1
4322
+```
4323
+
4324
+The `:latest` tag is optional, and is used as default if omitted.
4325
+
4326
+
4327
+**Example response**:
4328
+
4329
+```
4330
+HTTP/1.1 200 OK
4331
+Content-Length: 0
4332
+Content-Type: text/plain; charset=utf-8
4333
+```
4334
+
4335
+**Status codes**:
4336
+
4337
+-   **200** - no error
4338
+-   **500** - plugin is already enabled
4339
+
4340
+### Disable a plugin
4341
+
4342
+`POST /plugins/(plugin name)/disable`
4343
+
4344
+Disables a plugin
4345
+
4346
+**Example request**:
4347
+
4348
+```
4349
+POST /v1.26/plugins/tiborvass/no-remove:latest/disable HTTP/1.1
4350
+```
4351
+
4352
+The `:latest` tag is optional, and is used as default if omitted.
4353
+
4354
+
4355
+**Example response**:
4356
+
4357
+```
4358
+HTTP/1.1 200 OK
4359
+Content-Length: 0
4360
+Content-Type: text/plain; charset=utf-8
4361
+```
4362
+
4363
+**Status codes**:
4364
+
4365
+-   **200** - no error
4366
+-   **500** - plugin is already disabled
4367
+
4368
+### Remove a plugin
4369
+
4370
+`DELETE /plugins/(plugin name)`
4371
+
4372
+Removes a plugin
4373
+
4374
+**Example request**:
4375
+
4376
+```
4377
+DELETE /plugins/tiborvass/no-remove:latest HTTP/1.1
4378
+```
4379
+
4380
+The `:latest` tag is optional, and is used as default if omitted.
4381
+
4382
+**Example response**:
4383
+
4384
+```
4385
+HTTP/1.1 200 OK
4386
+Content-Length: 0
4387
+Content-Type: text/plain; charset=utf-8
4388
+```
4389
+
4390
+**Query parameters**:
4391
+
4392
+- **force** - Boolean value, set to `1` / `True` / `true` to force removing the
4393
+    plugin. Forcing removal disables the plugin before removing, but may result
4394
+    in issues if the plugin is in use by a container.
4395
+
4396
+**Status codes**:
4397
+
4398
+-   **200** - no error
4399
+-   **404** - plugin not installed
4400
+-   **500** - plugin is active
4401
+
4402
+### Create a plugin
4403
+
4404
+`POST /v1.26/plugins/create?name=(plugin name)`
4405
+
4406
+Create a plugin
4407
+
4408
+**Example request**:
4409
+
4410
+To create a plugin named `plugin`
4411
+
4412
+```
4413
+POST /v1.26/plugins/create?name=plugin:latest HTTP/1.1
4414
+Content-Type: application/x-tar
4415
+
4416
+{% raw %}
4417
+{{ TAR STREAM }}
4418
+{% endraw %}
4419
+```
4420
+
4421
+The `:latest` tag is optional, and is used as default if omitted.
4422
+
4423
+**Example response**:
4424
+
4425
+```
4426
+HTTP/1.1 204 No Content
4427
+Content-Length: 0
4428
+Content-Type: text/plain; charset=utf-8
4429
+```
4430
+
4431
+**Query parameters**:
4432
+
4433
+- **name** - A name and optional tag to apply for the plugin in the `name:tag format`. If you omit the `tag` the default `:latest` value is assumed.
4434
+
4435
+**Status codes**:
4436
+
4437
+-   **204** - no error
4438
+-   **500** - server error
4439
+
4440
+### Push a plugin
4441
+
4442
+`POST /v1.26/plugins/(plugin name)/push`
4443
+
4444
+Pushes a plugin to the registry.
4445
+
4446
+**Example request**:
4447
+
4448
+```
4449
+POST /v1.26/plugins/tiborvass/no-remove:latest HTTP/1.1
4450
+```
4451
+
4452
+The `:latest` tag is optional, and is used as default if omitted. When using
4453
+this endpoint to push a plugin to the registry, the `X-Registry-Auth` header
4454
+can be used to include a base64-encoded AuthConfig object. Refer to the [create
4455
+an image](#create-an-image) section for more details.
4456
+
4457
+**Example response**:
4458
+
4459
+**Status codes**:
4460
+
4461
+-   **200** - no error
4462
+-   **404** - plugin not installed
4463
+
4464
+
4465
+## 3.7 Nodes
4466
+
4467
+**Note**: Node operations require the engine to be part of a swarm.
4468
+
4469
+### List nodes
4470
+
4471
+
4472
+`GET /nodes`
4473
+
4474
+List nodes
4475
+
4476
+**Example request**:
4477
+
4478
+    GET /v1.26/nodes HTTP/1.1
4479
+
4480
+**Example response**:
4481
+
4482
+    HTTP/1.1 200 OK
4483
+    Content-Type: application/json
4484
+
4485
+    [
4486
+      {
4487
+        "ID": "24ifsmvkjbyhk",
4488
+        "Version": {
4489
+          "Index": 8
4490
+        },
4491
+        "CreatedAt": "2016-06-07T20:31:11.853781916Z",
4492
+        "UpdatedAt": "2016-06-07T20:31:11.999868824Z",
4493
+        "Spec": {
4494
+          "Name": "my-node",
4495
+          "Role": "manager",
4496
+          "Availability": "active"
4497
+          "Labels": {
4498
+              "foo": "bar"
4499
+          }
4500
+        },
4501
+        "Description": {
4502
+          "Hostname": "bf3067039e47",
4503
+          "Platform": {
4504
+            "Architecture": "x86_64",
4505
+            "OS": "linux"
4506
+          },
4507
+          "Resources": {
4508
+            "NanoCPUs": 4000000000,
4509
+            "MemoryBytes": 8272408576
4510
+          },
4511
+          "Engine": {
4512
+            "EngineVersion": "1.12.0-dev",
4513
+            "Labels": {
4514
+                "foo": "bar",
4515
+            }
4516
+            "Plugins": [
4517
+              {
4518
+                "Type": "Volume",
4519
+                "Name": "local"
4520
+              },
4521
+              {
4522
+                "Type": "Network",
4523
+                "Name": "bridge"
4524
+              }
4525
+              {
4526
+                "Type": "Network",
4527
+                "Name": "null"
4528
+              }
4529
+              {
4530
+                "Type": "Network",
4531
+                "Name": "overlay"
4532
+              }
4533
+            ]
4534
+          }
4535
+        },
4536
+        "Status": {
4537
+          "State": "ready",
4538
+          "Addr": "172.17.0.2"
4539
+        },
4540
+        "ManagerStatus": {
4541
+          "Leader": true,
4542
+          "Reachability": "reachable",
4543
+          "Addr": "172.17.0.2:2377""
4544
+        }
4545
+      }
4546
+    ]
4547
+
4548
+**Query parameters**:
4549
+
4550
+- **filters** – a JSON encoded value of the filters (a `map[string][]string`) to process on the
4551
+  nodes list. Available filters:
4552
+  - `id=<node id>`
4553
+  - `label=<engine label>`
4554
+  - `membership=`(`accepted`|`pending`)`
4555
+  - `name=<node name>`
4556
+  - `role=`(`manager`|`worker`)`
4557
+
4558
+**Status codes**:
4559
+
4560
+- **200** – no error
4561
+- **500** – server error
4562
+
4563
+### Inspect a node
4564
+
4565
+
4566
+`GET /nodes/<id>`
4567
+
4568
+Return low-level information on the node `id`
4569
+
4570
+**Example request**:
4571
+
4572
+      GET /v1.26/nodes/24ifsmvkjbyhk HTTP/1.1
4573
+
4574
+**Example response**:
4575
+
4576
+    HTTP/1.1 200 OK
4577
+    Content-Type: application/json
4578
+
4579
+    {
4580
+      "ID": "24ifsmvkjbyhk",
4581
+      "Version": {
4582
+        "Index": 8
4583
+      },
4584
+      "CreatedAt": "2016-06-07T20:31:11.853781916Z",
4585
+      "UpdatedAt": "2016-06-07T20:31:11.999868824Z",
4586
+      "Spec": {
4587
+        "Name": "my-node",
4588
+        "Role": "manager",
4589
+        "Availability": "active"
4590
+        "Labels": {
4591
+            "foo": "bar"
4592
+        }
4593
+      },
4594
+      "Description": {
4595
+        "Hostname": "bf3067039e47",
4596
+        "Platform": {
4597
+          "Architecture": "x86_64",
4598
+          "OS": "linux"
4599
+        },
4600
+        "Resources": {
4601
+          "NanoCPUs": 4000000000,
4602
+          "MemoryBytes": 8272408576
4603
+        },
4604
+        "Engine": {
4605
+          "EngineVersion": "1.12.0-dev",
4606
+          "Labels": {
4607
+              "foo": "bar",
4608
+          }
4609
+          "Plugins": [
4610
+            {
4611
+              "Type": "Volume",
4612
+              "Name": "local"
4613
+            },
4614
+            {
4615
+              "Type": "Network",
4616
+              "Name": "bridge"
4617
+            }
4618
+            {
4619
+              "Type": "Network",
4620
+              "Name": "null"
4621
+            }
4622
+            {
4623
+              "Type": "Network",
4624
+              "Name": "overlay"
4625
+            }
4626
+          ]
4627
+        }
4628
+      },
4629
+      "Status": {
4630
+        "State": "ready",
4631
+        "Addr": "172.17.0.2"
4632
+      },
4633
+      "ManagerStatus": {
4634
+        "Leader": true,
4635
+        "Reachability": "reachable",
4636
+        "Addr": "172.17.0.2:2377""
4637
+      }
4638
+    }
4639
+
4640
+**Status codes**:
4641
+
4642
+-   **200** – no error
4643
+-   **404** – no such node
4644
+-   **500** – server error
4645
+
4646
+### Remove a node
4647
+
4648
+
4649
+`DELETE /nodes/(id)`
4650
+
4651
+Remove a node [`id`] from the swarm.
4652
+
4653
+**Example request**:
4654
+
4655
+    DELETE /nodes/24ifsmvkjbyhk HTTP/1.1
4656
+
4657
+**Example response**:
4658
+
4659
+    HTTP/1.1 200 OK
4660
+    Content-Length: 0
4661
+    Content-Type: text/plain; charset=utf-8
4662
+
4663
+**Query parameters**:
4664
+
4665
+-   **force** - 1/True/true or 0/False/false, Force remove a node from the swarm.
4666
+        Default `false`.
4667
+
4668
+**Status codes**:
4669
+
4670
+-   **200** – no error
4671
+-   **404** – no such node
4672
+-   **500** – server error
4673
+
4674
+### Update a node
4675
+
4676
+
4677
+`POST /nodes/(id)/update`
4678
+
4679
+Update the node `id`.
4680
+
4681
+The payload of the `POST` request is the new `NodeSpec` and
4682
+overrides the current `NodeSpec` for the specified node.
4683
+
4684
+If `Availability` or `Role` are omitted, this returns an
4685
+error. Any other field omitted resets the current value to either
4686
+an empty value or the default cluster-wide value.
4687
+
4688
+**Example Request**
4689
+
4690
+    POST /v1.26/nodes/24ifsmvkjbyhk/update?version=8 HTTP/1.1
4691
+    Content-Type: application/json
4692
+
4693
+    {
4694
+      "Availability": "active",
4695
+      "Name": "node-name",
4696
+      "Role": "manager",
4697
+      "Labels": {
4698
+        "foo": "bar"
4699
+      }
4700
+    }
4701
+
4702
+**Example response**:
4703
+
4704
+    HTTP/1.1 200 OK
4705
+    Content-Length: 0
4706
+    Content-Type: text/plain; charset=utf-8
4707
+
4708
+**Query parameters**:
4709
+
4710
+- **version** – The version number of the node object being updated. This is
4711
+  required to avoid conflicting writes.
4712
+
4713
+JSON Parameters:
4714
+
4715
+- **Annotations** – Optional medata to associate with the service.
4716
+    - **Name** – User-defined name for the service.
4717
+    - **Labels** – A map of labels to associate with the service (e.g.,
4718
+      `{"key":"value", "key2":"value2"}`).
4719
+- **Role** - Role of the node (worker/manager).
4720
+- **Availability** - Availability of the node (active/pause/drain).
4721
+
4722
+
4723
+**Status codes**:
4724
+
4725
+-   **200** – no error
4726
+-   **404** – no such node
4727
+-   **500** – server error
4728
+
4729
+## 3.8 Swarm
4730
+
4731
+### Inspect swarm
4732
+
4733
+
4734
+`GET /swarm`
4735
+
4736
+Inspect swarm
4737
+
4738
+**Example response**:
4739
+
4740
+    HTTP/1.1 200 OK
4741
+    Content-Type: application/json
4742
+
4743
+    {
4744
+      "CreatedAt" : "2016-08-15T16:00:20.349727406Z",
4745
+      "Spec" : {
4746
+        "Dispatcher" : {
4747
+          "HeartbeatPeriod" : 5000000000
4748
+        },
4749
+        "Orchestration" : {
4750
+         "TaskHistoryRetentionLimit" : 10
4751
+        },
4752
+        "CAConfig" : {
4753
+          "NodeCertExpiry" : 7776000000000000
4754
+        },
4755
+        "Raft" : {
4756
+          "LogEntriesForSlowFollowers" : 500,
4757
+          "HeartbeatTick" : 1,
4758
+          "SnapshotInterval" : 10000,
4759
+          "ElectionTick" : 3
4760
+        },
4761
+        "TaskDefaults" : {},
4762
+        "EncryptionConfig" : {
4763
+          "AutoLockManagers": false
4764
+        },
4765
+        "Name" : "default"
4766
+      },
4767
+      "JoinTokens" : {
4768
+        "Worker" : "SWMTKN-1-1h8aps2yszaiqmz2l3oc5392pgk8e49qhx2aj3nyv0ui0hez2a-6qmn92w6bu3jdvnglku58u11a",
4769
+        "Manager" : "SWMTKN-1-1h8aps2yszaiqmz2l3oc5392pgk8e49qhx2aj3nyv0ui0hez2a-8llk83c4wm9lwioey2s316r9l"
4770
+      },
4771
+      "ID" : "70ilmkj2f6sp2137c753w2nmt",
4772
+      "UpdatedAt" : "2016-08-15T16:32:09.623207604Z",
4773
+      "Version" : {
4774
+        "Index" : 51
4775
+      }
4776
+    }
4777
+
4778
+**Status codes**:
4779
+
4780
+- **200** - no error
4781
+
4782
+### Initialize a new swarm
4783
+
4784
+
4785
+`POST /swarm/init`
4786
+
4787
+Initialize a new swarm. The body of the HTTP response includes the node ID.
4788
+
4789
+**Example request**:
4790
+
4791
+    POST /v1.26/swarm/init HTTP/1.1
4792
+    Content-Type: application/json
4793
+
4794
+    {
4795
+      "ListenAddr": "0.0.0.0:2377",
4796
+      "AdvertiseAddr": "192.168.1.1:2377",
4797
+      "ForceNewCluster": false,
4798
+      "Spec": {
4799
+        "Orchestration": {},
4800
+        "Raft": {},
4801
+        "Dispatcher": {},
4802
+        "CAConfig": {},
4803
+        "EncryptionConfig" : {
4804
+          "AutoLockManagers": false
4805
+        }
4806
+      }
4807
+    }
4808
+
4809
+**Example response**:
4810
+
4811
+    HTTP/1.1 200 OK
4812
+    Content-Length: 28
4813
+    Content-Type: application/json
4814
+    Date: Thu, 01 Sep 2016 21:49:13 GMT
4815
+    Server: Docker/1.12.0 (linux)
4816
+
4817
+    "7v2t30z9blmxuhnyo6s4cpenp"
4818
+
4819
+**Status codes**:
4820
+
4821
+- **200** – no error
4822
+- **400** – bad parameter
4823
+- **406** – node is already part of a swarm
4824
+
4825
+JSON Parameters:
4826
+
4827
+- **ListenAddr** – Listen address used for inter-manager communication, as well as determining
4828
+  the networking interface used for the VXLAN Tunnel Endpoint (VTEP). This can either be an
4829
+  address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port
4830
+  number, like `eth0:4567`. If the port number is omitted, the default swarm listening port is
4831
+  used.
4832
+- **AdvertiseAddr** – Externally reachable address advertised to other nodes. This can either be
4833
+  an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port
4834
+  number, like `eth0:4567`. If the port number is omitted, the port number from the listen
4835
+  address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when
4836
+  possible.
4837
+- **ForceNewCluster** – Force creation of a new swarm.
4838
+- **Spec** – Configuration settings for the new swarm.
4839
+    - **Orchestration** – Configuration settings for the orchestration aspects of the swarm.
4840
+        - **TaskHistoryRetentionLimit** – Maximum number of tasks history stored.
4841
+    - **Raft** – Raft related configuration.
4842
+        - **SnapshotInterval** – Number of logs entries between snapshot.
4843
+        - **KeepOldSnapshots** – Number of snapshots to keep beyond the current snapshot.
4844
+        - **LogEntriesForSlowFollowers** – Number of log entries to keep around to sync up slow
4845
+          followers after a snapshot is created.
4846
+        - **HeartbeatTick** – Amount of ticks (in seconds) between each heartbeat.
4847
+        - **ElectionTick** – Amount of ticks (in seconds) needed without a leader to trigger a new
4848
+          election.
4849
+    - **Dispatcher** – Configuration settings for the task dispatcher.
4850
+        - **HeartbeatPeriod** – The delay for an agent to send a heartbeat to the dispatcher.
4851
+    - **CAConfig** – Certificate authority configuration.
4852
+        - **NodeCertExpiry** – Automatic expiry for nodes certificates.
4853
+        - **ExternalCA** - Configuration for forwarding signing requests to an external
4854
+          certificate authority.
4855
+            - **Protocol** - Protocol for communication with the external CA
4856
+              (currently only "cfssl" is supported).
4857
+            - **URL** - URL where certificate signing requests should be sent.
4858
+            - **Options** - An object with key/value pairs that are interpreted
4859
+              as protocol-specific options for the external CA driver.
4860
+    - **EncryptionConfig** – Parameters related to encryption-at-rest.
4861
+        - **AutoLockManagers**: If set, generate a key and use it to lock data stored on the
4862
+          managers.
4863
+
4864
+### Join an existing swarm
4865
+
4866
+`POST /swarm/join`
4867
+
4868
+Join an existing swarm
4869
+
4870
+**Example request**:
4871
+
4872
+    POST /v1.26/swarm/join HTTP/1.1
4873
+    Content-Type: application/json
4874
+
4875
+    {
4876
+      "ListenAddr": "0.0.0.0:2377",
4877
+      "AdvertiseAddr": "192.168.1.1:2377",
4878
+      "RemoteAddrs": ["node1:2377"],
4879
+      "JoinToken": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2"
4880
+    }
4881
+
4882
+**Example response**:
4883
+
4884
+    HTTP/1.1 200 OK
4885
+    Content-Length: 0
4886
+    Content-Type: text/plain; charset=utf-8
4887
+
4888
+**Status codes**:
4889
+
4890
+- **200** – no error
4891
+- **400** – bad parameter
4892
+- **406** – node is already part of a swarm
4893
+
4894
+JSON Parameters:
4895
+
4896
+- **ListenAddr** – Listen address used for inter-manager communication if the node gets promoted to
4897
+  manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP).
4898
+- **AdvertiseAddr** – Externally reachable address advertised to other nodes. This can either be
4899
+  an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port
4900
+  number, like `eth0:4567`. If the port number is omitted, the port number from the listen
4901
+  address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when
4902
+  possible.
4903
+- **RemoteAddr** – Address of any manager node already participating in the swarm.
4904
+- **JoinToken** – Secret token for joining this swarm.
4905
+
4906
+### Leave a swarm
4907
+
4908
+
4909
+`POST /swarm/leave`
4910
+
4911
+Leave a swarm
4912
+
4913
+**Example request**:
4914
+
4915
+    POST /v1.26/swarm/leave HTTP/1.1
4916
+
4917
+**Example response**:
4918
+
4919
+    HTTP/1.1 200 OK
4920
+    Content-Length: 0
4921
+    Content-Type: text/plain; charset=utf-8
4922
+
4923
+**Query parameters**:
4924
+
4925
+- **force** - Boolean (0/1, false/true). Force leave swarm, even if this is the last manager or that it will break the cluster.
4926
+
4927
+**Status codes**:
4928
+
4929
+- **200** – no error
4930
+- **406** – node is not part of a swarm
4931
+
4932
+### Retrieve the swarm's unlock key
4933
+
4934
+`GET /swarm/unlockkey`
4935
+
4936
+Get unlock key
4937
+
4938
+**Example response**:
4939
+
4940
+    HTTP/1.1 200 OK
4941
+    Content-Type: application/json
4942
+
4943
+    {
4944
+      "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8"
4945
+    }
4946
+
4947
+**Status codes**:
4948
+
4949
+- **200** - no error
4950
+
4951
+### Unlock a locked manager
4952
+
4953
+`POST /swarm/unlock`
4954
+
4955
+Unlock a manager
4956
+
4957
+**Example request**:
4958
+
4959
+    POST /v1.26/swarm/unlock HTTP/1.1
4960
+    Content-Type: application/json
4961
+
4962
+    {
4963
+      "UnlockKey": "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8"
4964
+    }
4965
+
4966
+**Status codes**:
4967
+
4968
+- **200** - no error
4969
+
4970
+### Update a swarm
4971
+
4972
+
4973
+`POST /swarm/update`
4974
+
4975
+Update a swarm
4976
+
4977
+**Example request**:
4978
+
4979
+    POST /v1.26/swarm/update HTTP/1.1
4980
+
4981
+    {
4982
+      "Name": "default",
4983
+      "Orchestration": {
4984
+        "TaskHistoryRetentionLimit": 10
4985
+      },
4986
+      "Raft": {
4987
+        "SnapshotInterval": 10000,
4988
+        "LogEntriesForSlowFollowers": 500,
4989
+        "HeartbeatTick": 1,
4990
+        "ElectionTick": 3
4991
+      },
4992
+      "Dispatcher": {
4993
+        "HeartbeatPeriod": 5000000000
4994
+      },
4995
+      "CAConfig": {
4996
+        "NodeCertExpiry": 7776000000000000
4997
+      },
4998
+      "JoinTokens": {
4999
+        "Worker": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx",
5000
+        "Manager": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2"
5001
+      },
5002
+      "EncryptionConfig": {
5003
+        "AutoLockManagers": false
5004
+      }
5005
+    }
5006
+
5007
+
5008
+**Example response**:
5009
+
5010
+    HTTP/1.1 200 OK
5011
+    Content-Length: 0
5012
+    Content-Type: text/plain; charset=utf-8
5013
+
5014
+**Query parameters**:
5015
+
5016
+- **version** – The version number of the swarm object being updated. This is
5017
+  required to avoid conflicting writes.
5018
+- **rotateWorkerToken** - Set to `true` (or `1`) to rotate the worker join token.
5019
+- **rotateManagerToken** - Set to `true` (or `1`) to rotate the manager join token.
5020
+- **rotateManagerUnlockKey** - Set to `true` (or `1`) to rotate the manager unlock key.
5021
+
5022
+**Status codes**:
5023
+
5024
+- **200** – no error
5025
+- **400** – bad parameter
5026
+- **406** – node is not part of a swarm
5027
+
5028
+JSON Parameters:
5029
+
5030
+- **Orchestration** – Configuration settings for the orchestration aspects of the swarm.
5031
+    - **TaskHistoryRetentionLimit** – Maximum number of tasks history stored.
5032
+- **Raft** – Raft related configuration.
5033
+    - **SnapshotInterval** – Number of logs entries between snapshot.
5034
+    - **KeepOldSnapshots** – Number of snapshots to keep beyond the current snapshot.
5035
+    - **LogEntriesForSlowFollowers** – Number of log entries to keep around to sync up slow
5036
+      followers after a snapshot is created.
5037
+    - **HeartbeatTick** – Amount of ticks (in seconds) between each heartbeat.
5038
+    - **ElectionTick** – Amount of ticks (in seconds) needed without a leader to trigger a new
5039
+      election.
5040
+- **Dispatcher** – Configuration settings for the task dispatcher.
5041
+    - **HeartbeatPeriod** – The delay for an agent to send a heartbeat to the dispatcher.
5042
+- **CAConfig** – CA configuration.
5043
+    - **NodeCertExpiry** – Automatic expiry for nodes certificates.
5044
+    - **ExternalCA** - Configuration for forwarding signing requests to an external
5045
+      certificate authority.
5046
+        - **Protocol** - Protocol for communication with the external CA
5047
+          (currently only "cfssl" is supported).
5048
+        - **URL** - URL where certificate signing requests should be sent.
5049
+        - **Options** - An object with key/value pairs that are interpreted
5050
+          as protocol-specific options for the external CA driver.
5051
+- **JoinTokens** - Tokens that can be used by other nodes to join the swarm.
5052
+    - **Worker** - Token to use for joining as a worker.
5053
+    - **Manager** - Token to use for joining as a manager.
5054
+- **EncryptionConfig** – Parameters related to encryption-at-rest.
5055
+    - **AutoLockManagers**: If set, generate a key and use it to lock data stored on the
5056
+      managers.
5057
+
5058
+## 3.9 Services
5059
+
5060
+**Note**: Service operations require to first be part of a swarm.
5061
+
5062
+### List services
5063
+
5064
+
5065
+`GET /services`
5066
+
5067
+List services
5068
+
5069
+**Example request**:
5070
+
5071
+    GET /v1.26/services HTTP/1.1
5072
+
5073
+**Example response**:
5074
+
5075
+    HTTP/1.1 200 OK
5076
+    Content-Type: application/json
5077
+
5078
+    [
5079
+      {
5080
+        "ID": "9mnpnzenvg8p8tdbtq4wvbkcz",
5081
+        "Version": {
5082
+          "Index": 19
5083
+        },
5084
+        "CreatedAt": "2016-06-07T21:05:51.880065305Z",
5085
+        "UpdatedAt": "2016-06-07T21:07:29.962229872Z",
5086
+        "Spec": {
5087
+          "Name": "hopeful_cori",
5088
+          "TaskTemplate": {
5089
+            "ContainerSpec": {
5090
+              "Image": "redis"
5091
+            },
5092
+            "Resources": {
5093
+              "Limits": {},
5094
+              "Reservations": {}
5095
+            },
5096
+            "RestartPolicy": {
5097
+              "Condition": "any",
5098
+              "MaxAttempts": 0
5099
+            },
5100
+            "Placement": {},
5101
+            "ForceUpdate": 0
5102
+          },
5103
+          "Mode": {
5104
+            "Replicated": {
5105
+              "Replicas": 1
5106
+            }
5107
+          },
5108
+          "UpdateConfig": {
5109
+            "Parallelism": 1,
5110
+            "FailureAction": "pause",
5111
+            "Monitor": 15000000000,
5112
+            "MaxFailureRatio": 0.15
5113
+          },
5114
+          "EndpointSpec": {
5115
+            "Mode": "vip",
5116
+            "Ports": [
5117
+              {
5118
+                "Protocol": "tcp",
5119
+                "TargetPort": 6379,
5120
+                "PublishedPort": 30001
5121
+              }
5122
+            ]
5123
+          }
5124
+        },
5125
+        "Endpoint": {
5126
+          "Spec": {
5127
+            "Mode": "vip",
5128
+            "Ports": [
5129
+              {
5130
+                "Protocol": "tcp",
5131
+                "TargetPort": 6379,
5132
+                "PublishedPort": 30001
5133
+              }
5134
+            ]
5135
+          },
5136
+          "Ports": [
5137
+            {
5138
+              "Protocol": "tcp",
5139
+              "TargetPort": 6379,
5140
+              "PublishedPort": 30001
5141
+            }
5142
+          ],
5143
+          "VirtualIPs": [
5144
+            {
5145
+              "NetworkID": "4qvuz4ko70xaltuqbt8956gd1",
5146
+              "Addr": "10.255.0.2/16"
5147
+            },
5148
+            {
5149
+              "NetworkID": "4qvuz4ko70xaltuqbt8956gd1",
5150
+              "Addr": "10.255.0.3/16"
5151
+            }
5152
+          ]
5153
+        }
5154
+      }
5155
+    ]
5156
+
5157
+**Query parameters**:
5158
+
5159
+- **filters** – a JSON encoded value of the filters (a `map[string][]string`) to process on the
5160
+  services list. Available filters:
5161
+  - `id=<service id>`
5162
+  - `label=<service label>`
5163
+  - `name=<service name>`
5164
+
5165
+**Status codes**:
5166
+
5167
+- **200** – no error
5168
+- **500** – server error
5169
+
5170
+### Create a service
5171
+
5172
+`POST /services/create`
5173
+
5174
+Create a service. When using this endpoint to create a service using a private
5175
+repository from the registry, the `X-Registry-Auth` header must be used to
5176
+include a base64-encoded AuthConfig object. Refer to the [create an
5177
+image](#create-an-image) section for more details.
5178
+
5179
+**Example request**:
5180
+
5181
+    POST /v1.26/services/create HTTP/1.1
5182
+    Content-Type: application/json
5183
+
5184
+    {
5185
+      "Name": "web",
5186
+      "TaskTemplate": {
5187
+        "ContainerSpec": {
5188
+          "Image": "nginx:alpine",
5189
+          "Mounts": [
5190
+            {
5191
+              "ReadOnly": true,
5192
+              "Source": "web-data",
5193
+              "Target": "/usr/share/nginx/html",
5194
+              "Type": "volume",
5195
+              "VolumeOptions": {
5196
+                "DriverConfig": {
5197
+                },
5198
+                "Labels": {
5199
+                  "com.example.something": "something-value"
5200
+                }
5201
+              }
5202
+            }
5203
+          ],
5204
+          "User": "33",
5205
+          "TTY": false,
5206
+          "DNSConfig": {
5207
+            "Nameservers": ["8.8.8.8"],
5208
+            "Search": ["example.org"],
5209
+            "Options": ["timeout:3"]
5210
+          }
5211
+        },
5212
+        "LogDriver": {
5213
+          "Name": "json-file",
5214
+          "Options": {
5215
+            "max-file": "3",
5216
+            "max-size": "10M"
5217
+          }
5218
+        },
5219
+        "Placement": {},
5220
+        "Resources": {
5221
+          "Limits": {
5222
+            "MemoryBytes": 104857600.0
5223
+          },
5224
+          "Reservations": {
5225
+          }
5226
+        },
5227
+        "RestartPolicy": {
5228
+          "Condition": "on-failure",
5229
+          "Delay": 10000000000.0,
5230
+          "MaxAttempts": 10
5231
+        },
5232
+        "ForceUpdate": 0
5233
+      },
5234
+      "Mode": {
5235
+        "Replicated": {
5236
+          "Replicas": 4
5237
+        }
5238
+      },
5239
+      "UpdateConfig": {
5240
+        "Delay": 30000000000.0,
5241
+        "Parallelism": 2,
5242
+        "FailureAction": "pause"
5243
+      },
5244
+      "EndpointSpec": {
5245
+        "Ports": [
5246
+          {
5247
+            "Protocol": "tcp",
5248
+            "PublishedPort": 8080,
5249
+            "TargetPort": 80
5250
+          }
5251
+        ]
5252
+      },
5253
+      "Labels": {
5254
+        "foo": "bar"
5255
+      }
5256
+    }
5257
+
5258
+**Example response**:
5259
+
5260
+    HTTP/1.1 201 Created
5261
+    Content-Type: application/json
5262
+
5263
+    {
5264
+      "ID":"ak7w3gjqoa3kuz8xcpnyy0pvl"
5265
+    }
5266
+
5267
+**Status codes**:
5268
+
5269
+- **201** – no error
5270
+- **406** – server error or node is not part of a swarm
5271
+- **409** – name conflicts with an existing object
5272
+
5273
+**JSON Parameters**:
5274
+
5275
+- **Name** – User-defined name for the service.
5276
+- **Labels** – A map of labels to associate with the service (e.g., `{"key":"value", "key2":"value2"}`).
5277
+- **TaskTemplate** – Specification of the tasks to start as part of the new service.
5278
+    - **ContainerSpec** - Container settings for containers started as part of this task.
5279
+        - **Image** – A string specifying the image name to use for the container.
5280
+        - **Command** – The command to be run in the image.
5281
+        - **Args** – Arguments to the command.
5282
+        - **Env** – A list of environment variables in the form of `["VAR=value"[,"VAR2=value2"]]`.
5283
+        - **Dir** – A string specifying the working directory for commands to run in.
5284
+        - **User** – A string value specifying the user inside the container.
5285
+        - **Labels** – A map of labels to associate with the service (e.g.,
5286
+          `{"key":"value", "key2":"value2"}`).
5287
+        - **TTY** – A boolean indicating whether a pseudo-TTY should be allocated.
5288
+        - **Mounts** – Specification for mounts to be added to containers
5289
+          created as part of the service.
5290
+            - **Target** – Container path.
5291
+            - **Source** – Mount source (e.g. a volume name, a host path).
5292
+            - **Type** – The mount type (`bind`, or `volume`).
5293
+            - **ReadOnly** – A boolean indicating whether the mount should be read-only.
5294
+            - **BindOptions** - Optional configuration for the `bind` type.
5295
+              - **Propagation** – A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`.
5296
+            - **VolumeOptions** – Optional configuration for the `volume` type.
5297
+                - **NoCopy** – A boolean indicating if volume should be
5298
+                  populated with the data from the target. (Default false)
5299
+                - **Labels** – User-defined name and labels for the volume.
5300
+                - **DriverConfig** – Map of driver-specific options.
5301
+                  - **Name** - Name of the driver to use to create the volume.
5302
+                  - **Options** - key/value map of driver specific options.
5303
+        - **StopGracePeriod** – Amount of time to wait for the container to terminate before
5304
+          forcefully killing it.
5305
+        - **DNSConfig** – Specification for DNS related configurations in
5306
+          resolver configuration file (resolv.conf).
5307
+            - **Nameservers** – A list of the IP addresses of the name servers.
5308
+            - **Search** – A search list for host-name lookup.
5309
+            - **Options** – A list of internal resolver variables to be modified (e.g., `debug`, `ndots:3`, etc.).
5310
+    - **LogDriver** - Log configuration for containers created as part of the
5311
+      service.
5312
+        - **Name** - Name of the logging driver to use (`json-file`, `syslog`,
5313
+          `journald`, `gelf`, `fluentd`, `awslogs`, `splunk`, `etwlogs`, `none`).
5314
+        - **Options** - Driver-specific options.
5315
+    - **Resources** – Resource requirements which apply to each individual container created as part
5316
+      of the service.
5317
+        - **Limits** – Define resources limits.
5318
+            - **NanoCPUs** – CPU limit in units of 10<sup>-9</sup> CPU shares.
5319
+            - **MemoryBytes** – Memory limit in Bytes.
5320
+        - **Reservation** – Define resources reservation.
5321
+            - **NanoCPUs** – CPU reservation in units of 10<sup>-9</sup> CPU shares.
5322
+            - **MemoryBytes** – Memory reservation in Bytes.
5323
+    - **RestartPolicy** – Specification for the restart policy which applies to containers created
5324
+      as part of this service.
5325
+        - **Condition** – Condition for restart (`none`, `on-failure`, or `any`).
5326
+        - **Delay** – Delay between restart attempts, in nanoseconds.
5327
+        - **MaxAttempts** – Maximum attempts to restart a given container before giving up (default value
5328
+          is 0, which is ignored).
5329
+        - **Window** – Windows is the time window used to evaluate the restart policy (default value is
5330
+          0, which is unbounded).
5331
+    - **Placement** – An array of constraints.
5332
+    - **ForceUpdate**: A counter that triggers an update even if no relevant parameters have been changed.
5333
+- **Mode** – Scheduling mode for the service (`replicated` or `global`, defaults to `replicated`).
5334
+- **UpdateConfig** – Specification for the update strategy of the service.
5335
+    - **Parallelism** – Maximum number of tasks to be updated in one iteration (0 means unlimited
5336
+      parallelism).
5337
+    - **Delay** – Amount of time between updates, in nanoseconds.
5338
+    - **FailureAction** - Action to take if an updated task fails to run, or stops running during the
5339
+      update. Values are `continue` and `pause`.
5340
+    - **Monitor** - Amount of time to monitor each updated task for failures, in nanoseconds.
5341
+    - **MaxFailureRatio** - The fraction of tasks that may fail during an update before the
5342
+      failure action is invoked, specified as a floating point number between 0 and 1. The default is 0.
5343
+- **Networks** – Array of network names or IDs to attach the service to.
5344
+- **EndpointSpec** – Properties that can be configured to access and load balance a service.
5345
+    - **Mode** – The mode of resolution to use for internal load balancing
5346
+      between tasks (`vip` or `dnsrr`). Defaults to `vip` if not provided.
5347
+    - **Ports** – List of exposed ports that this service is accessible on from
5348
+      the outside, in the form of:
5349
+      `{"Protocol": <"tcp"|"udp">, "PublishedPort": <port>, "TargetPort": <port>}`.
5350
+      Ports can only be provided if `vip` resolution mode is used.
5351
+
5352
+**Request Headers**:
5353
+
5354
+- **Content-type** – Set to `"application/json"`.
5355
+- **X-Registry-Auth** – base64-encoded AuthConfig object, containing either
5356
+  login information, or a token. Refer to the [create an image](#create-an-image)
5357
+  section for more details.
5358
+
5359
+
5360
+### Remove a service
5361
+
5362
+
5363
+`DELETE /services/(id or name)`
5364
+
5365
+Stop and remove the service `id`
5366
+
5367
+**Example request**:
5368
+
5369
+    DELETE /services/16253994b7c4 HTTP/1.1
5370
+
5371
+**Example response**:
5372
+
5373
+    HTTP/1.1 200 OK
5374
+    Content-Length: 0
5375
+    Content-Type: text/plain; charset=utf-8
5376
+
5377
+**Status codes**:
5378
+
5379
+-   **200** – no error
5380
+-   **404** – no such service
5381
+-   **500** – server error
5382
+
5383
+### Inspect one or more services
5384
+
5385
+
5386
+`GET /services/(id or name)`
5387
+
5388
+Return information on the service `id`.
5389
+
5390
+**Example request**:
5391
+
5392
+    GET /v1.26/services/1cb4dnqcyx6m66g2t538x3rxha HTTP/1.1
5393
+
5394
+**Example response**:
5395
+
5396
+    {
5397
+      "ID": "ak7w3gjqoa3kuz8xcpnyy0pvl",
5398
+      "Version": {
5399
+        "Index": 95
5400
+      },
5401
+      "CreatedAt": "2016-06-07T21:10:20.269723157Z",
5402
+      "UpdatedAt": "2016-06-07T21:10:20.276301259Z",
5403
+      "Spec": {
5404
+        "Name": "redis",
5405
+        "TaskTemplate": {
5406
+          "ContainerSpec": {
5407
+            "Image": "redis"
5408
+          },
5409
+          "Resources": {
5410
+            "Limits": {},
5411
+            "Reservations": {}
5412
+          },
5413
+          "RestartPolicy": {
5414
+            "Condition": "any",
5415
+            "MaxAttempts": 0
5416
+          },
5417
+          "Placement": {}
5418
+        },
5419
+        "Mode": {
5420
+          "Replicated": {
5421
+            "Replicas": 1
5422
+          }
5423
+        },
5424
+        "UpdateConfig": {
5425
+          "Parallelism": 1,
5426
+          "FailureAction": "pause"
5427
+        },
5428
+        "EndpointSpec": {
5429
+          "Mode": "vip",
5430
+          "Ports": [
5431
+            {
5432
+              "Protocol": "tcp",
5433
+              "TargetPort": 6379,
5434
+              "PublishedPort": 30001
5435
+            }
5436
+          ]
5437
+        }
5438
+      },
5439
+      "Endpoint": {
5440
+        "Spec": {
5441
+          "Mode": "vip",
5442
+          "Ports": [
5443
+            {
5444
+              "Protocol": "tcp",
5445
+              "TargetPort": 6379,
5446
+              "PublishedPort": 30001
5447
+            }
5448
+          ]
5449
+        },
5450
+        "Ports": [
5451
+          {
5452
+            "Protocol": "tcp",
5453
+            "TargetPort": 6379,
5454
+            "PublishedPort": 30001
5455
+          }
5456
+        ],
5457
+        "VirtualIPs": [
5458
+          {
5459
+            "NetworkID": "4qvuz4ko70xaltuqbt8956gd1",
5460
+            "Addr": "10.255.0.4/16"
5461
+          }
5462
+        ]
5463
+      }
5464
+    }
5465
+
5466
+**Status codes**:
5467
+
5468
+-   **200** – no error
5469
+-   **404** – no such service
5470
+-   **500** – server error
5471
+
5472
+### Update a service
5473
+
5474
+`POST /services/(id or name)/update`
5475
+
5476
+Update a service. When using this endpoint to create a service using a
5477
+private repository from the registry, the `X-Registry-Auth` header can be used
5478
+to update the authentication information for that is stored for the service.
5479
+The header contains a base64-encoded AuthConfig object. Refer to the [create an
5480
+image](#create-an-image) section for more details.
5481
+
5482
+**Example request**:
5483
+
5484
+    POST /v1.26/services/1cb4dnqcyx6m66g2t538x3rxha/update?version=23 HTTP/1.1
5485
+    Content-Type: application/json
5486
+
5487
+    {
5488
+      "Name": "top",
5489
+      "TaskTemplate": {
5490
+        "ContainerSpec": {
5491
+          "Image": "busybox",
5492
+          "Args": [
5493
+            "top"
5494
+          ],
5495
+          "TTY": true,
5496
+          "DNSConfig": {
5497
+            "Nameservers": ["8.8.8.8"],
5498
+            "Search": ["example.org"],
5499
+            "Options": ["timeout:3"]
5500
+          }
5501
+        },
5502
+        "Resources": {
5503
+          "Limits": {},
5504
+          "Reservations": {}
5505
+        },
5506
+        "RestartPolicy": {
5507
+          "Condition": "any",
5508
+          "MaxAttempts": 0
5509
+        },
5510
+        "Placement": {},
5511
+        "ForceUpdate": 0
5512
+      },
5513
+      "Mode": {
5514
+        "Replicated": {
5515
+          "Replicas": 1
5516
+        }
5517
+      },
5518
+      "UpdateConfig": {
5519
+        "Parallelism": 1,
5520
+        "Monitor": 15000000000,
5521
+        "MaxFailureRatio": 0.15
5522
+      },
5523
+      "EndpointSpec": {
5524
+        "Mode": "vip"
5525
+      }
5526
+    }
5527
+
5528
+**Example response**:
5529
+
5530
+    HTTP/1.1 200 OK
5531
+    Content-Length: 0
5532
+    Content-Type: text/plain; charset=utf-8
5533
+
5534
+**JSON Parameters**:
5535
+
5536
+- **Name** – User-defined name for the service. Note that renaming services is not supported.
5537
+- **Labels** – A map of labels to associate with the service (e.g., `{"key":"value", "key2":"value2"}`).
5538
+- **TaskTemplate** – Specification of the tasks to start as part of the new service.
5539
+    - **ContainerSpec** - Container settings for containers started as part of this task.
5540
+        - **Image** – A string specifying the image name to use for the container.
5541
+        - **Command** – The command to be run in the image.
5542
+        - **Args** – Arguments to the command.
5543
+        - **Env** – A list of environment variables in the form of `["VAR=value"[,"VAR2=value2"]]`.
5544
+        - **Dir** – A string specifying the working directory for commands to run in.
5545
+        - **User** – A string value specifying the user inside the container.
5546
+        - **Labels** – A map of labels to associate with the service (e.g.,
5547
+          `{"key":"value", "key2":"value2"}`).
5548
+        - **TTY** – A boolean indicating whether a pseudo-TTY should be allocated.
5549
+        - **Mounts** – Specification for mounts to be added to containers created as part of the new
5550
+          service.
5551
+            - **Target** – Container path.
5552
+            - **Source** – Mount source (e.g. a volume name, a host path).
5553
+            - **Type** – The mount type (`bind`, or `volume`).
5554
+            - **ReadOnly** – A boolean indicating whether the mount should be read-only.
5555
+            - **BindOptions** - Optional configuration for the `bind` type
5556
+              - **Propagation** – A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`.
5557
+            - **VolumeOptions** – Optional configuration for the `volume` type.
5558
+                - **NoCopy** – A boolean indicating if volume should be
5559
+                  populated with the data from the target. (Default false)
5560
+                - **Labels** – User-defined name and labels for the volume.
5561
+                - **DriverConfig** – Map of driver-specific options.
5562
+                  - **Name** - Name of the driver to use to create the volume
5563
+                  - **Options** - key/value map of driver specific options
5564
+        - **StopGracePeriod** – Amount of time to wait for the container to terminate before
5565
+          forcefully killing it.
5566
+        - **DNSConfig** – Specification for DNS related configurations in
5567
+          resolver configuration file (resolv.conf).
5568
+            - **Nameservers** – A list of the IP addresses of the name servers.
5569
+            - **Search** – A search list for host-name lookup.
5570
+            - **Options** – A list of internal resolver variables to be modified (e.g., `debug`, `ndots:3`, etc.).
5571
+    - **Resources** – Resource requirements which apply to each individual container created as part
5572
+      of the service.
5573
+        - **Limits** – Define resources limits.
5574
+            - **CPU** – CPU limit
5575
+            - **Memory** – Memory limit
5576
+        - **Reservation** – Define resources reservation.
5577
+            - **CPU** – CPU reservation
5578
+            - **Memory** – Memory reservation
5579
+    - **RestartPolicy** – Specification for the restart policy which applies to containers created
5580
+      as part of this service.
5581
+        - **Condition** – Condition for restart (`none`, `on-failure`, or `any`).
5582
+        - **Delay** – Delay between restart attempts, in nanoseconds.
5583
+        - **MaxAttempts** – Maximum attempts to restart a given container before giving up (default value
5584
+          is 0, which is ignored).
5585
+        - **Window** – Windows is the time window used to evaluate the restart policy (default value is
5586
+          0, which is unbounded).
5587
+    - **Placement** – An array of constraints.
5588
+    - **ForceUpdate**: A counter that triggers an update even if no relevant parameters have been changed.
5589
+- **Mode** – Scheduling mode for the service (`replicated` or `global`, defaults to `replicated`).
5590
+- **UpdateConfig** – Specification for the update strategy of the service.
5591
+    - **Parallelism** – Maximum number of tasks to be updated in one iteration (0 means unlimited
5592
+      parallelism).
5593
+    - **Delay** – Amount of time between updates, in nanoseconds.
5594
+    - **FailureAction** - Action to take if an updated task fails to run, or stops running during the
5595
+      update. Values are `continue` and `pause`.
5596
+    - **Monitor** - Amount of time to monitor each updated task for failures, in nanoseconds.
5597
+    - **MaxFailureRatio** - The fraction of tasks that may fail during an update before the
5598
+      failure action is invoked, specified as a floating point number between 0 and 1. The default is 0.
5599
+- **Networks** – Array of network names or IDs to attach the service to.
5600
+- **EndpointSpec** – Properties that can be configured to access and load balance a service.
5601
+    - **Mode** – The mode of resolution to use for internal load balancing
5602
+      between tasks (`vip` or `dnsrr`). Defaults to `vip` if not provided.
5603
+    - **Ports** – List of exposed ports that this service is accessible on from
5604
+      the outside, in the form of:
5605
+      `{"Protocol": <"tcp"|"udp">, "PublishedPort": <port>, "TargetPort": <port>}`.
5606
+      Ports can only be provided if `vip` resolution mode is used.
5607
+
5608
+**Query parameters**:
5609
+
5610
+- **version** – The version number of the service object being updated. This is
5611
+  required to avoid conflicting writes.
5612
+- **registryAuthFrom** - If the X-Registry-Auth header is not specified, this
5613
+  parameter indicates where to find registry authorization credentials. The
5614
+  valid values are `spec` and `previous-spec`. If unspecified, the default is
5615
+  `spec`.
5616
+
5617
+**Request Headers**:
5618
+
5619
+- **Content-type** – Set to `"application/json"`.
5620
+- **X-Registry-Auth** – base64-encoded AuthConfig object, containing either
5621
+  login information, or a token. Refer to the [create an image](#create-an-image)
5622
+  section for more details.
5623
+
5624
+**Status codes**:
5625
+
5626
+-   **200** – no error
5627
+-   **404** – no such service
5628
+-   **500** – server error
5629
+
5630
+### Get service logs
5631
+
5632
+`GET /services/(id or name)/logs`
5633
+
5634
+Get `stdout` and `stderr` logs from the service ``id``
5635
+
5636
+> **Note**:
5637
+> This endpoint works only for services with the `json-file` or `journald` logging drivers.
5638
+
5639
+**Example request**:
5640
+
5641
+     GET /services/4fa6e0f0c678/logs?stderr=1&stdout=1&timestamps=1&follow=1&tail=10&since=1428990821 HTTP/1.1
5642
+
5643
+**Example response**:
5644
+
5645
+     HTTP/1.1 101 UPGRADED
5646
+     Content-Type: application/vnd.docker.raw-stream
5647
+     Connection: Upgrade
5648
+     Upgrade: tcp
5649
+
5650
+     {% raw %}
5651
+     {{ STREAM }}
5652
+     {% endraw %}
5653
+
5654
+**Query parameters**:
5655
+
5656
+-   **details** - 1/True/true or 0/False/flase, Show extra details provided to logs. Default `false`.
5657
+-   **follow** – 1/True/true or 0/False/false, return stream. Default `false`.
5658
+-   **stdout** – 1/True/true or 0/False/false, show `stdout` log. Default `false`.
5659
+-   **stderr** – 1/True/true or 0/False/false, show `stderr` log. Default `false`.
5660
+-   **since** – UNIX timestamp (integer) to filter logs. Specifying a timestamp
5661
+    will only output log-entries since that timestamp. Default: 0 (unfiltered)
5662
+-   **timestamps** – 1/True/true or 0/False/false, print timestamps for
5663
+        every log line. Default `false`.
5664
+-   **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all.
5665
+
5666
+**Status codes**:
5667
+
5668
+-   **101** – no error, hints proxy about hijacking
5669
+-   **200** – no error, no upgrade header found
5670
+-   **404** – no such service
5671
+-   **500** – server error
5672
+
5673
+## 3.10 Tasks
5674
+
5675
+**Note**: Task operations require the engine to be part of a swarm.
5676
+
5677
+### List tasks
5678
+
5679
+
5680
+`GET /tasks`
5681
+
5682
+List tasks
5683
+
5684
+**Example request**:
5685
+
5686
+    GET /v1.26/tasks HTTP/1.1
5687
+
5688
+**Example response**:
5689
+
5690
+    [
5691
+      {
5692
+        "ID": "0kzzo1i0y4jz6027t0k7aezc7",
5693
+        "Version": {
5694
+          "Index": 71
5695
+        },
5696
+        "CreatedAt": "2016-06-07T21:07:31.171892745Z",
5697
+        "UpdatedAt": "2016-06-07T21:07:31.376370513Z",
5698
+        "Spec": {
5699
+          "ContainerSpec": {
5700
+            "Image": "redis"
5701
+          },
5702
+          "Resources": {
5703
+            "Limits": {},
5704
+            "Reservations": {}
5705
+          },
5706
+          "RestartPolicy": {
5707
+            "Condition": "any",
5708
+            "MaxAttempts": 0
5709
+          },
5710
+          "Placement": {}
5711
+        },
5712
+        "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz",
5713
+        "Slot": 1,
5714
+        "NodeID": "60gvrl6tm78dmak4yl7srz94v",
5715
+        "Status": {
5716
+          "Timestamp": "2016-06-07T21:07:31.290032978Z",
5717
+          "State": "running",
5718
+          "Message": "started",
5719
+          "ContainerStatus": {
5720
+            "ContainerID": "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035",
5721
+            "PID": 677
5722
+          }
5723
+        },
5724
+        "DesiredState": "running",
5725
+        "NetworksAttachments": [
5726
+          {
5727
+            "Network": {
5728
+              "ID": "4qvuz4ko70xaltuqbt8956gd1",
5729
+              "Version": {
5730
+                "Index": 18
5731
+              },
5732
+              "CreatedAt": "2016-06-07T20:31:11.912919752Z",
5733
+              "UpdatedAt": "2016-06-07T21:07:29.955277358Z",
5734
+              "Spec": {
5735
+                "Name": "ingress",
5736
+                "Labels": {
5737
+                  "com.docker.swarm.internal": "true"
5738
+                },
5739
+                "DriverConfiguration": {},
5740
+                "IPAMOptions": {
5741
+                  "Driver": {},
5742
+                  "Configs": [
5743
+                    {
5744
+                      "Subnet": "10.255.0.0/16",
5745
+                      "Gateway": "10.255.0.1"
5746
+                    }
5747
+                  ]
5748
+                }
5749
+              },
5750
+              "DriverState": {
5751
+                "Name": "overlay",
5752
+                "Options": {
5753
+                  "com.docker.network.driver.overlay.vxlanid_list": "256"
5754
+                }
5755
+              },
5756
+              "IPAMOptions": {
5757
+                "Driver": {
5758
+                  "Name": "default"
5759
+                },
5760
+                "Configs": [
5761
+                  {
5762
+                    "Subnet": "10.255.0.0/16",
5763
+                    "Gateway": "10.255.0.1"
5764
+                  }
5765
+                ]
5766
+              }
5767
+            },
5768
+            "Addresses": [
5769
+              "10.255.0.10/16"
5770
+            ]
5771
+          }
5772
+        ],
5773
+      },
5774
+      {
5775
+        "ID": "1yljwbmlr8er2waf8orvqpwms",
5776
+        "Version": {
5777
+          "Index": 30
5778
+        },
5779
+        "CreatedAt": "2016-06-07T21:07:30.019104782Z",
5780
+        "UpdatedAt": "2016-06-07T21:07:30.231958098Z",
5781
+        "Name": "hopeful_cori",
5782
+        "Spec": {
5783
+          "ContainerSpec": {
5784
+            "Image": "redis"
5785
+          },
5786
+          "Resources": {
5787
+            "Limits": {},
5788
+            "Reservations": {}
5789
+          },
5790
+          "RestartPolicy": {
5791
+            "Condition": "any",
5792
+            "MaxAttempts": 0
5793
+          },
5794
+          "Placement": {}
5795
+        },
5796
+        "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz",
5797
+        "Slot": 1,
5798
+        "NodeID": "60gvrl6tm78dmak4yl7srz94v",
5799
+        "Status": {
5800
+          "Timestamp": "2016-06-07T21:07:30.202183143Z",
5801
+          "State": "shutdown",
5802
+          "Message": "shutdown",
5803
+          "ContainerStatus": {
5804
+            "ContainerID": "1cf8d63d18e79668b0004a4be4c6ee58cddfad2dae29506d8781581d0688a213"
5805
+          }
5806
+        },
5807
+        "DesiredState": "shutdown",
5808
+        "NetworksAttachments": [
5809
+          {
5810
+            "Network": {
5811
+              "ID": "4qvuz4ko70xaltuqbt8956gd1",
5812
+              "Version": {
5813
+                "Index": 18
5814
+              },
5815
+              "CreatedAt": "2016-06-07T20:31:11.912919752Z",
5816
+              "UpdatedAt": "2016-06-07T21:07:29.955277358Z",
5817
+              "Spec": {
5818
+                "Name": "ingress",
5819
+                "Labels": {
5820
+                  "com.docker.swarm.internal": "true"
5821
+                },
5822
+                "DriverConfiguration": {},
5823
+                "IPAMOptions": {
5824
+                  "Driver": {},
5825
+                  "Configs": [
5826
+                    {
5827
+                      "Subnet": "10.255.0.0/16",
5828
+                      "Gateway": "10.255.0.1"
5829
+                    }
5830
+                  ]
5831
+                }
5832
+              },
5833
+              "DriverState": {
5834
+                "Name": "overlay",
5835
+                "Options": {
5836
+                  "com.docker.network.driver.overlay.vxlanid_list": "256"
5837
+                }
5838
+              },
5839
+              "IPAMOptions": {
5840
+                "Driver": {
5841
+                  "Name": "default"
5842
+                },
5843
+                "Configs": [
5844
+                  {
5845
+                    "Subnet": "10.255.0.0/16",
5846
+                    "Gateway": "10.255.0.1"
5847
+                  }
5848
+                ]
5849
+              }
5850
+            },
5851
+            "Addresses": [
5852
+              "10.255.0.5/16"
5853
+            ]
5854
+          }
5855
+        ]
5856
+      }
5857
+    ]
5858
+
5859
+**Query parameters**:
5860
+
5861
+- **filters** – a JSON encoded value of the filters (a `map[string][]string`) to process on the
5862
+  services list. Available filters:
5863
+  - `id=<task id>`
5864
+  - `name=<task name>`
5865
+  - `service=<service name>`
5866
+  - `node=<node id or name>`
5867
+  - `label=key` or `label="key=value"`
5868
+  - `desired-state=(running | shutdown | accepted)`
5869
+
5870
+**Status codes**:
5871
+
5872
+- **200** – no error
5873
+- **500** – server error
5874
+
5875
+### Inspect a task
5876
+
5877
+
5878
+`GET /tasks/(task id)`
5879
+
5880
+Get details on a task
5881
+
5882
+**Example request**:
5883
+
5884
+    GET /v1.26/tasks/0kzzo1i0y4jz6027t0k7aezc7 HTTP/1.1
5885
+
5886
+**Example response**:
5887
+
5888
+    {
5889
+      "ID": "0kzzo1i0y4jz6027t0k7aezc7",
5890
+      "Version": {
5891
+        "Index": 71
5892
+      },
5893
+      "CreatedAt": "2016-06-07T21:07:31.171892745Z",
5894
+      "UpdatedAt": "2016-06-07T21:07:31.376370513Z",
5895
+      "Spec": {
5896
+        "ContainerSpec": {
5897
+          "Image": "redis"
5898
+        },
5899
+        "Resources": {
5900
+          "Limits": {},
5901
+          "Reservations": {}
5902
+        },
5903
+        "RestartPolicy": {
5904
+          "Condition": "any",
5905
+          "MaxAttempts": 0
5906
+        },
5907
+        "Placement": {}
5908
+      },
5909
+      "ServiceID": "9mnpnzenvg8p8tdbtq4wvbkcz",
5910
+      "Slot": 1,
5911
+      "NodeID": "60gvrl6tm78dmak4yl7srz94v",
5912
+      "Status": {
5913
+        "Timestamp": "2016-06-07T21:07:31.290032978Z",
5914
+        "State": "running",
5915
+        "Message": "started",
5916
+        "ContainerStatus": {
5917
+          "ContainerID": "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035",
5918
+          "PID": 677
5919
+        }
5920
+      },
5921
+      "DesiredState": "running",
5922
+      "NetworksAttachments": [
5923
+        {
5924
+          "Network": {
5925
+            "ID": "4qvuz4ko70xaltuqbt8956gd1",
5926
+            "Version": {
5927
+              "Index": 18
5928
+            },
5929
+            "CreatedAt": "2016-06-07T20:31:11.912919752Z",
5930
+            "UpdatedAt": "2016-06-07T21:07:29.955277358Z",
5931
+            "Spec": {
5932
+              "Name": "ingress",
5933
+              "Labels": {
5934
+                "com.docker.swarm.internal": "true"
5935
+              },
5936
+              "DriverConfiguration": {},
5937
+              "IPAMOptions": {
5938
+                "Driver": {},
5939
+                "Configs": [
5940
+                  {
5941
+                    "Subnet": "10.255.0.0/16",
5942
+                    "Gateway": "10.255.0.1"
5943
+                  }
5944
+                ]
5945
+              }
5946
+            },
5947
+            "DriverState": {
5948
+              "Name": "overlay",
5949
+              "Options": {
5950
+                "com.docker.network.driver.overlay.vxlanid_list": "256"
5951
+              }
5952
+            },
5953
+            "IPAMOptions": {
5954
+              "Driver": {
5955
+                "Name": "default"
5956
+              },
5957
+              "Configs": [
5958
+                {
5959
+                  "Subnet": "10.255.0.0/16",
5960
+                  "Gateway": "10.255.0.1"
5961
+                }
5962
+              ]
5963
+            }
5964
+          },
5965
+          "Addresses": [
5966
+            "10.255.0.10/16"
5967
+          ]
5968
+        }
5969
+      ]
5970
+    }
5971
+
5972
+**Status codes**:
5973
+
5974
+- **200** – no error
5975
+- **404** – unknown task
5976
+- **500** – server error
5977
+
5978
+## 3.11 Secrets
5979
+
5980
+**Note**: Secret operations require the engine to be part of a swarm.
5981
+
5982
+### List secrets
5983
+
5984
+`GET /secrets`
5985
+
5986
+List secrets
5987
+
5988
+**Example request**:
5989
+
5990
+    GET /secrets HTTP/1.1
5991
+
5992
+**Example response**:
5993
+
5994
+    [
5995
+      {
5996
+        "ID": "ktnbjxoalbkvbvedmg1urrz8h",
5997
+        "Version": {
5998
+          "Index": 11
5999
+        },
6000
+        "CreatedAt": "2016-11-05T01:20:17.327670065Z",
6001
+        "UpdatedAt": "2016-11-05T01:20:17.327670065Z",
6002
+        "Spec": {
6003
+          "Name": "app-dev.crt"
6004
+        },
6005
+        "Digest": "sha256:11d7c6f38253b73e608153c9f662a191ae605e1a3d9b756b0b3426388f91d3fa",
6006
+        "SecretSize": 31
6007
+      }
6008
+    ]
6009
+
6010
+
6011
+**Query parameters**:
6012
+
6013
+-   **filters** - a JSON encoded value of the filters (a `map[string][]string`) to process on the secrets list. Available filters:
6014
+  -   `names=<secret name>`
6015
+
6016
+**Status codes**:
6017
+
6018
+-   **200** – no error
6019
+
6020
+### Create a secret
6021
+
6022
+`POST /secrets/create`
6023
+
6024
+Create a secret
6025
+
6026
+**Example request**:
6027
+
6028
+    POST /secrets/create HTTP/1.1
6029
+    Content-Type: application/json
6030
+
6031
+    {
6032
+      "Name": "app-key.crt",
6033
+      "Labels": {
6034
+        "foo": "bar"
6035
+      },
6036
+      "Data": "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg=="
6037
+    }
6038
+
6039
+**Example response**:
6040
+
6041
+    HTTP/1.1 201 Created
6042
+    Content-Type: application/json
6043
+
6044
+    {
6045
+      "ID": "ktnbjxoalbkvbvedmg1urrz8h"
6046
+    }
6047
+
6048
+**Status codes**:
6049
+
6050
+- **201** – no error
6051
+- **406** – server error or node is not part of a swarm
6052
+- **409** – name conflicts with an existing object
6053
+
6054
+**JSON Parameters**:
6055
+
6056
+- **Name** – User-defined name for the secret.
6057
+- **Labels** – A map of labels to associate with the secret (e.g., `{"key":"value", "key2":"value2"}`).
6058
+- **Data** – Base64-url-safe-encoded secret data
6059
+
6060
+### Inspect a secret
6061
+
6062
+`GET /secrets/(secret id)`
6063
+
6064
+Get details on a secret
6065
+
6066
+**Example request**:
6067
+
6068
+    GET /secrets/ktnbjxoalbkvbvedmg1urrz8h HTTP/1.1
6069
+
6070
+**Example response**:
6071
+
6072
+    {
6073
+      "ID": "ktnbjxoalbkvbvedmg1urrz8h",
6074
+      "Version": {
6075
+        "Index": 11
6076
+      },
6077
+      "CreatedAt": "2016-11-05T01:20:17.327670065Z",
6078
+      "UpdatedAt": "2016-11-05T01:20:17.327670065Z",
6079
+      "Spec": {
6080
+        "Name": "app-dev.crt"
6081
+      },
6082
+      "Digest": "sha256:11d7c6f38253b73e608153c9f662a191ae605e1a3d9b756b0b3426388f91d3fa",
6083
+      "SecretSize": 31
6084
+    }
6085
+
6086
+**Status codes**:
6087
+
6088
+- **200** – no error
6089
+- **404** – unknown secret
6090
+- **500** – server error
6091
+
6092
+### Remove a secret
6093
+
6094
+`DELETE /secrets/(id)`
6095
+
6096
+Remove the secret `id` from the secret store
6097
+
6098
+**Example request**:
6099
+
6100
+    DELETE /secrets/ktnbjxoalbkvbvedmg1urrz8h HTTP/1.1
6101
+
6102
+**Example response**:
6103
+
6104
+    HTTP/1.1 204 No Content
6105
+
6106
+# 4. Going further
6107
+
6108
+## 4.1 Inside `docker run`
6109
+
6110
+As an example, the `docker run` command line makes the following API calls:
6111
+
6112
+- Create the container
6113
+
6114
+- If the status code is 404, it means the image doesn't exist:
6115
+    - Try to pull it.
6116
+    - Then, retry to create the container.
6117
+
6118
+- Start the container.
6119
+
6120
+- If you are not in detached mode:
6121
+- Attach to the container, using `logs=1` (to have `stdout` and
6122
+      `stderr` from the container's start) and `stream=1`
6123
+
6124
+- If in detached mode or only `stdin` is attached, display the container's id.
6125
+
6126
+## 4.2 Hijacking
6127
+
6128
+In this version of the API, `/attach`, uses hijacking to transport `stdin`,
6129
+`stdout`, and `stderr` on the same socket.
6130
+
6131
+To hint potential proxies about connection hijacking, Docker client sends
6132
+connection upgrade headers similarly to websocket.
6133
+
6134
+    Upgrade: tcp
6135
+    Connection: Upgrade
6136
+
6137
+When Docker daemon detects the `Upgrade` header, it switches its status code
6138
+from **200 OK** to **101 UPGRADED** and resends the same headers.
6139
+
6140
+
6141
+## 4.3 CORS Requests
6142
+
6143
+To set cross origin requests to the remote api please give values to
6144
+`--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all,
6145
+default or blank means CORS disabled
6146
+
6147
+    $ dockerd -H="192.168.1.9:2375" --api-cors-header="http://foo.bar"