|
@@ -23,6 +23,8 @@ redirect_from:
|
|
- The API tends to be REST. However, for some complex commands, like `attach`
|
|
- The API tends to be REST. However, for some complex commands, like `attach`
|
|
or `pull`, the HTTP connection is hijacked to transport `stdout`,
|
|
or `pull`, the HTTP connection is hijacked to transport `stdout`,
|
|
`stdin` and `stderr`.
|
|
`stdin` and `stderr`.
|
|
|
|
+ - A `Content-Length` header should be present in `POST` requests to endpoints
|
|
|
|
+ that expect a body.
|
|
|
|
|
|
## 2. Errors
|
|
## 2. Errors
|
|
|
|
|
|
@@ -253,6 +255,7 @@ Create a container
|
|
|
|
|
|
POST /v1.24/containers/create HTTP/1.1
|
|
POST /v1.24/containers/create HTTP/1.1
|
|
Content-Type: application/json
|
|
Content-Type: application/json
|
|
|
|
+ Content-Length: 12345
|
|
|
|
|
|
{
|
|
{
|
|
"Hostname": "",
|
|
"Hostname": "",
|
|
@@ -1172,6 +1175,7 @@ Update configuration of one or more containers.
|
|
|
|
|
|
POST /v1.24/containers/e90e34656806/update HTTP/1.1
|
|
POST /v1.24/containers/e90e34656806/update HTTP/1.1
|
|
Content-Type: application/json
|
|
Content-Type: application/json
|
|
|
|
+ Content-Length: 12345
|
|
|
|
|
|
{
|
|
{
|
|
"BlkioWeight": 300,
|
|
"BlkioWeight": 300,
|
|
@@ -2208,6 +2212,7 @@ if available, for accessing the registry without password.
|
|
|
|
|
|
POST /v1.24/auth HTTP/1.1
|
|
POST /v1.24/auth HTTP/1.1
|
|
Content-Type: application/json
|
|
Content-Type: application/json
|
|
|
|
+ Content-Length: 12345
|
|
|
|
|
|
{
|
|
{
|
|
"username": "hannibal",
|
|
"username": "hannibal",
|
|
@@ -2387,6 +2392,7 @@ Create a new image from a container's changes
|
|
|
|
|
|
POST /v1.24/commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1
|
|
POST /v1.24/commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1
|
|
Content-Type: application/json
|
|
Content-Type: application/json
|
|
|
|
+ Content-Length: 12345
|
|
|
|
|
|
{
|
|
{
|
|
"Hostname": "",
|
|
"Hostname": "",
|
|
@@ -2725,6 +2731,7 @@ See the [image tarball format](#image-tarball-format) for more details.
|
|
|
|
|
|
POST /v1.24/images/load
|
|
POST /v1.24/images/load
|
|
Content-Type: application/x-tar
|
|
Content-Type: application/x-tar
|
|
|
|
+ Content-Length: 12345
|
|
|
|
|
|
Tarball in body
|
|
Tarball in body
|
|
|
|
|
|
@@ -2794,6 +2801,7 @@ Sets up an exec instance in a running container `id`
|
|
|
|
|
|
POST /v1.24/containers/e90e34656806/exec HTTP/1.1
|
|
POST /v1.24/containers/e90e34656806/exec HTTP/1.1
|
|
Content-Type: application/json
|
|
Content-Type: application/json
|
|
|
|
+ Content-Length: 12345
|
|
|
|
|
|
{
|
|
{
|
|
"AttachStdin": true,
|
|
"AttachStdin": true,
|
|
@@ -2850,6 +2858,7 @@ interactive session with the `exec` command.
|
|
|
|
|
|
POST /v1.24/exec/e90e34656806/start HTTP/1.1
|
|
POST /v1.24/exec/e90e34656806/start HTTP/1.1
|
|
Content-Type: application/json
|
|
Content-Type: application/json
|
|
|
|
+ Content-Length: 12345
|
|
|
|
|
|
{
|
|
{
|
|
"Detach": false,
|
|
"Detach": false,
|
|
@@ -3000,6 +3009,7 @@ Create a volume
|
|
|
|
|
|
POST /v1.24/volumes/create HTTP/1.1
|
|
POST /v1.24/volumes/create HTTP/1.1
|
|
Content-Type: application/json
|
|
Content-Type: application/json
|
|
|
|
+ Content-Length: 12345
|
|
|
|
|
|
{
|
|
{
|
|
"Name": "tardis",
|
|
"Name": "tardis",
|
|
@@ -3290,6 +3300,7 @@ Create a network
|
|
```
|
|
```
|
|
POST /v1.24/networks/create HTTP/1.1
|
|
POST /v1.24/networks/create HTTP/1.1
|
|
Content-Type: application/json
|
|
Content-Type: application/json
|
|
|
|
+Content-Length: 12345
|
|
|
|
|
|
{
|
|
{
|
|
"Name":"isolated_nw",
|
|
"Name":"isolated_nw",
|
|
@@ -3379,6 +3390,7 @@ Connect a container to a network
|
|
```
|
|
```
|
|
POST /v1.24/networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30/connect HTTP/1.1
|
|
POST /v1.24/networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30/connect HTTP/1.1
|
|
Content-Type: application/json
|
|
Content-Type: application/json
|
|
|
|
+Content-Length: 12345
|
|
|
|
|
|
{
|
|
{
|
|
"Container":"3613f73ba0e4",
|
|
"Container":"3613f73ba0e4",
|
|
@@ -3417,6 +3429,7 @@ Disconnect a container from a network
|
|
```
|
|
```
|
|
POST /v1.24/networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30/disconnect HTTP/1.1
|
|
POST /v1.24/networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30/disconnect HTTP/1.1
|
|
Content-Type: application/json
|
|
Content-Type: application/json
|
|
|
|
+Content-Length: 12345
|
|
|
|
|
|
{
|
|
{
|
|
"Container":"3613f73ba0e4",
|
|
"Container":"3613f73ba0e4",
|
|
@@ -4130,6 +4143,7 @@ an empty value or the default cluster-wide value.
|
|
|
|
|
|
POST /v1.24/nodes/24ifsmvkjbyhk/update?version=8 HTTP/1.1
|
|
POST /v1.24/nodes/24ifsmvkjbyhk/update?version=8 HTTP/1.1
|
|
Content-Type: application/json
|
|
Content-Type: application/json
|
|
|
|
+ Content-Length: 12345
|
|
|
|
|
|
{
|
|
{
|
|
"Availability": "active",
|
|
"Availability": "active",
|
|
@@ -4231,6 +4245,7 @@ Initialize a new swarm. The body of the HTTP response includes the node ID.
|
|
|
|
|
|
POST /v1.24/swarm/init HTTP/1.1
|
|
POST /v1.24/swarm/init HTTP/1.1
|
|
Content-Type: application/json
|
|
Content-Type: application/json
|
|
|
|
+ Content-Length: 12345
|
|
|
|
|
|
{
|
|
{
|
|
"ListenAddr": "0.0.0.0:2377",
|
|
"ListenAddr": "0.0.0.0:2377",
|
|
@@ -4377,6 +4392,7 @@ Update a swarm
|
|
**Example request**:
|
|
**Example request**:
|
|
|
|
|
|
POST /v1.24/swarm/update HTTP/1.1
|
|
POST /v1.24/swarm/update HTTP/1.1
|
|
|
|
+ Content-Length: 12345
|
|
|
|
|
|
{
|
|
{
|
|
"Name": "default",
|
|
"Name": "default",
|
|
@@ -4576,6 +4592,7 @@ image](#create-an-image) section for more details.
|
|
|
|
|
|
POST /v1.24/services/create HTTP/1.1
|
|
POST /v1.24/services/create HTTP/1.1
|
|
Content-Type: application/json
|
|
Content-Type: application/json
|
|
|
|
+ Content-Length: 12345
|
|
|
|
|
|
{
|
|
{
|
|
"Name": "web",
|
|
"Name": "web",
|
|
@@ -4876,6 +4893,7 @@ image](#create-an-image) section for more details.
|
|
|
|
|
|
POST /v1.24/services/1cb4dnqcyx6m66g2t538x3rxha/update?version=23 HTTP/1.1
|
|
POST /v1.24/services/1cb4dnqcyx6m66g2t538x3rxha/update?version=23 HTTP/1.1
|
|
Content-Type: application/json
|
|
Content-Type: application/json
|
|
|
|
+ Content-Length: 12345
|
|
|
|
|
|
{
|
|
{
|
|
"Name": "top",
|
|
"Name": "top",
|