mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
doc: Try to standardise JSON examples
Fixed: * Invalid JSON * Inconsistent spacing at colon Expression for binary data streams (line 468 vs. 1474) remain inconsistent. Could fix that too, if you like. Signed-off-by: Lorenz Leutgeb <lorenz.leutgeb@gmail.com>
This commit is contained in:
parent
b2ab733c99
commit
e583cc1eb4
1 changed files with 143 additions and 144 deletions
|
@ -40,9 +40,9 @@ List containers
|
|||
"Command": "echo 1",
|
||||
"Created": 1367854155,
|
||||
"Status": "Exit 0",
|
||||
"Ports":[{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}],
|
||||
"SizeRw":12288,
|
||||
"SizeRootFs":0
|
||||
"Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}],
|
||||
"SizeRw": 12288,
|
||||
"SizeRootFs": 0
|
||||
},
|
||||
{
|
||||
"Id": "9cd87474be90",
|
||||
|
@ -50,9 +50,9 @@ List containers
|
|||
"Command": "echo 222222",
|
||||
"Created": 1367854155,
|
||||
"Status": "Exit 0",
|
||||
"Ports":[],
|
||||
"SizeRw":12288,
|
||||
"SizeRootFs":0
|
||||
"Ports": [],
|
||||
"SizeRw": 12288,
|
||||
"SizeRootFs": 0
|
||||
},
|
||||
{
|
||||
"Id": "3176a2479c92",
|
||||
|
@ -70,9 +70,9 @@ List containers
|
|||
"Command": "echo 444444444444444444444444444444444",
|
||||
"Created": 1367854152,
|
||||
"Status": "Exit 0",
|
||||
"Ports":[],
|
||||
"SizeRw":12288,
|
||||
"SizeRootFs":0
|
||||
"Ports": [],
|
||||
"SizeRw": 12288,
|
||||
"SizeRootFs": 0
|
||||
}
|
||||
]
|
||||
|
||||
|
@ -110,42 +110,42 @@ Create a container
|
|||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"Hostname":"",
|
||||
"Hostname": "",
|
||||
"Domainname": "",
|
||||
"User":"",
|
||||
"Memory":0,
|
||||
"MemorySwap":0,
|
||||
"User": "",
|
||||
"Memory": 0,
|
||||
"MemorySwap": 0,
|
||||
"CpuShares": 512,
|
||||
"Cpuset": "0,1",
|
||||
"AttachStdin":false,
|
||||
"AttachStdout":true,
|
||||
"AttachStderr":true,
|
||||
"Tty":false,
|
||||
"OpenStdin":false,
|
||||
"StdinOnce":false,
|
||||
"Env":null,
|
||||
"Cmd":[
|
||||
"AttachStdin": false,
|
||||
"AttachStdout": true,
|
||||
"AttachStderr": true,
|
||||
"Tty": false,
|
||||
"OpenStdin": false,
|
||||
"StdinOnce": false,
|
||||
"Env": null,
|
||||
"Cmd": [
|
||||
"date"
|
||||
],
|
||||
"Entrypoint": "",
|
||||
"Image":"base",
|
||||
"Volumes":{
|
||||
"Image": "base",
|
||||
"Volumes": {
|
||||
"/tmp": {}
|
||||
},
|
||||
"WorkingDir":"",
|
||||
"WorkingDir": "",
|
||||
"NetworkDisabled": false,
|
||||
"MacAddress":"12:34:56:78:9a:bc",
|
||||
"ExposedPorts":{
|
||||
"MacAddress": "12:34:56:78:9a:bc",
|
||||
"ExposedPorts": {
|
||||
"22/tcp": {}
|
||||
},
|
||||
"SecurityOpts": [""],
|
||||
"HostConfig": {
|
||||
"Binds":["/tmp:/tmp"],
|
||||
"Links":["redis3:redis"],
|
||||
"LxcConf":{"lxc.utsname":"docker"},
|
||||
"PortBindings":{ "22/tcp": [{ "HostPort": "11022" }] },
|
||||
"PublishAllPorts":false,
|
||||
"Privileged":false,
|
||||
"Binds": ["/tmp:/tmp"],
|
||||
"Links": ["redis3:redis"],
|
||||
"LxcConf": {"lxc.utsname":"docker"},
|
||||
"PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
|
||||
"PublishAllPorts": false,
|
||||
"Privileged": false,
|
||||
"Dns": ["8.8.8.8"],
|
||||
"DnsSearch": [""],
|
||||
"VolumesFrom": ["parent", "other:ro"],
|
||||
|
@ -163,8 +163,8 @@ Create a container
|
|||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"Id":"f91ddc4b01e079c4481a8340bbbeca4dbd33d6e4a10662e499f8eacbb5bf252b"
|
||||
"Warnings":[]
|
||||
"Id": "f91ddc4b01e079c4481a8340bbbeca4dbd33d6e4a10662e499f8eacbb5bf252b"
|
||||
"Warnings": []
|
||||
}
|
||||
|
||||
Json Parameters:
|
||||
|
@ -291,8 +291,7 @@ Return low-level information on the container `id`
|
|||
"Image": "base",
|
||||
"Volumes": {},
|
||||
"VolumesFrom": "",
|
||||
"WorkingDir":""
|
||||
|
||||
"WorkingDir": ""
|
||||
},
|
||||
"State": {
|
||||
"Running": false,
|
||||
|
@ -327,8 +326,8 @@ Return low-level information on the container `id`
|
|||
},
|
||||
"Links": ["/name:alias"],
|
||||
"PublishAllPorts": false,
|
||||
"CapAdd: ["NET_ADMIN"],
|
||||
"CapDrop: ["MKNOD"]
|
||||
"CapAdd": ["NET_ADMIN"],
|
||||
"CapDrop": ["MKNOD"]
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -354,7 +353,7 @@ List processes running inside the container `id`
|
|||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"Titles":[
|
||||
"Titles": [
|
||||
"USER",
|
||||
"PID",
|
||||
"%CPU",
|
||||
|
@ -367,7 +366,7 @@ List processes running inside the container `id`
|
|||
"TIME",
|
||||
"COMMAND"
|
||||
],
|
||||
"Processes":[
|
||||
"Processes": [
|
||||
["root","20147","0.0","0.1","18060","1864","pts/4","S","10:06","0:00","bash"],
|
||||
["root","20271","0.0","0.0","4312","352","pts/4","S+","10:07","0:00","sleep","10"]
|
||||
]
|
||||
|
@ -432,16 +431,16 @@ Inspect changes on container `id`'s filesystem
|
|||
|
||||
[
|
||||
{
|
||||
"Path":"/dev",
|
||||
"Kind":0
|
||||
"Path": "/dev",
|
||||
"Kind": 0
|
||||
},
|
||||
{
|
||||
"Path":"/dev/kmsg",
|
||||
"Kind":1
|
||||
"Path": "/dev/kmsg",
|
||||
"Kind": 1
|
||||
},
|
||||
{
|
||||
"Path":"/test",
|
||||
"Kind":1
|
||||
"Path": "/test",
|
||||
"Kind": 1
|
||||
}
|
||||
]
|
||||
|
||||
|
@ -508,12 +507,12 @@ Start the container `id`
|
|||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"Binds":["/tmp:/tmp"],
|
||||
"Links":["redis3:redis"],
|
||||
"LxcConf":{"lxc.utsname":"docker"},
|
||||
"PortBindings":{ "22/tcp": [{ "HostPort": "11022" }] },
|
||||
"PublishAllPorts":false,
|
||||
"Privileged":false,
|
||||
"Binds": ["/tmp:/tmp"],
|
||||
"Links": ["redis3:redis"],
|
||||
"LxcConf": {"lxc.utsname":"docker"},
|
||||
"PortBindings": { "22/tcp": [{ "HostPort": "11022" }] },
|
||||
"PublishAllPorts": false,
|
||||
"Privileged": false,
|
||||
"Dns": ["8.8.8.8"],
|
||||
"DnsSearch": [""],
|
||||
"VolumesFrom": ["parent", "other:ro"],
|
||||
|
@ -783,7 +782,7 @@ Block until container `id` stops, then returns the exit code
|
|||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{"StatusCode":0}
|
||||
{"StatusCode": 0}
|
||||
|
||||
Status Codes:
|
||||
|
||||
|
@ -831,7 +830,7 @@ Copy files or folders of container `id`
|
|||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"Resource":"test.txt"
|
||||
"Resource": "test.txt"
|
||||
}
|
||||
|
||||
**Example response**:
|
||||
|
@ -909,9 +908,9 @@ Create an image, either by pulling it from the registry or by importing it
|
|||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{"status":"Pulling..."}
|
||||
{"status":"Pulling", "progress":"1 B/ 100 B", "progressDetail":{"current":1, "total":100}}
|
||||
{"error":"Invalid..."}
|
||||
{"status": "Pulling..."}
|
||||
{"status": "Pulling", "progress": "1 B/ 100 B", "progressDetail": {"current": 1, "total": 100}}
|
||||
{"error": "Invalid..."}
|
||||
...
|
||||
|
||||
When using this endpoint to pull an image from the registry, the
|
||||
|
@ -954,31 +953,31 @@ Return low-level information on the image `name`
|
|||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"Created":"2013-03-23T22:24:18.818426-07:00",
|
||||
"Container":"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0",
|
||||
"Created": "2013-03-23T22:24:18.818426-07:00",
|
||||
"Container": "3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0",
|
||||
"ContainerConfig":
|
||||
{
|
||||
"Hostname":"",
|
||||
"User":"",
|
||||
"Memory":0,
|
||||
"MemorySwap":0,
|
||||
"AttachStdin":false,
|
||||
"AttachStdout":false,
|
||||
"AttachStderr":false,
|
||||
"PortSpecs":null,
|
||||
"Tty":true,
|
||||
"OpenStdin":true,
|
||||
"StdinOnce":false,
|
||||
"Env":null,
|
||||
"Hostname": "",
|
||||
"User": "",
|
||||
"Memory": 0,
|
||||
"MemorySwap": 0,
|
||||
"AttachStdin": false,
|
||||
"AttachStdout": false,
|
||||
"AttachStderr": false,
|
||||
"PortSpecs": null,
|
||||
"Tty": true,
|
||||
"OpenStdin": true,
|
||||
"StdinOnce": false,
|
||||
"Env": null,
|
||||
"Cmd": ["/bin/bash"],
|
||||
"Dns":null,
|
||||
"Image":"base",
|
||||
"Volumes":null,
|
||||
"VolumesFrom":"",
|
||||
"WorkingDir":""
|
||||
"Dns": null,
|
||||
"Image": "base",
|
||||
"Volumes": null,
|
||||
"VolumesFrom": "",
|
||||
"WorkingDir": ""
|
||||
},
|
||||
"Id":"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc",
|
||||
"Parent":"27cf784147099545",
|
||||
"Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc",
|
||||
"Parent": "27cf784147099545",
|
||||
"Size": 6824592
|
||||
}
|
||||
|
||||
|
@ -1005,14 +1004,14 @@ Return the history of the image `name`
|
|||
|
||||
[
|
||||
{
|
||||
"Id":"b750fe79269d",
|
||||
"Created":1364102658,
|
||||
"CreatedBy":"/bin/bash"
|
||||
"Id": "b750fe79269d",
|
||||
"Created": 1364102658,
|
||||
"CreatedBy": "/bin/bash"
|
||||
},
|
||||
{
|
||||
"Id":"27cf78414709",
|
||||
"Created":1364068391,
|
||||
"CreatedBy":""
|
||||
"Id": "27cf78414709",
|
||||
"Created": 1364068391,
|
||||
"CreatedBy": ""
|
||||
}
|
||||
]
|
||||
|
||||
|
@ -1037,9 +1036,9 @@ Push the image `name` on the registry
|
|||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{"status":"Pushing..."}
|
||||
{"status":"Pushing", "progress":"1/? (n/a)", "progressDetail":{"current":1}}}
|
||||
{"error":"Invalid..."}
|
||||
{"status": "Pushing..."}
|
||||
{"status": "Pushing", "progress": "1/? (n/a)", "progressDetail": {"current": 1}}}
|
||||
{"error": "Invalid..."}
|
||||
...
|
||||
|
||||
If you wish to push an image on to a private registry, that image must already have been tagged
|
||||
|
@ -1110,9 +1109,9 @@ Remove the image `name` from the filesystem
|
|||
Content-type: application/json
|
||||
|
||||
[
|
||||
{"Untagged":"3e2f21a89f"},
|
||||
{"Deleted":"3e2f21a89f"},
|
||||
{"Deleted":"53b4f83ac9"}
|
||||
{"Untagged": "3e2f21a89f"},
|
||||
{"Deleted": "3e2f21a89f"},
|
||||
{"Deleted": "53b4f83ac9"}
|
||||
]
|
||||
|
||||
Query Parameters:
|
||||
|
@ -1199,9 +1198,9 @@ Build an image from Dockerfile via stdin
|
|||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{"stream":"Step 1..."}
|
||||
{"stream":"..."}
|
||||
{"error":"Error...", "errorDetail":{"code": 123, "message": "Error..."}}
|
||||
{"stream": "Step 1..."}
|
||||
{"stream": "..."}
|
||||
{"error": "Error...", "errorDetail": {"code": 123, "message": "Error..."}}
|
||||
|
||||
The stream must be a tar archive compressed with one of the
|
||||
following algorithms: identity (no compression), gzip, bzip2, xz.
|
||||
|
@ -1242,10 +1241,10 @@ Get the default username and email
|
|||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"username":"hannibal",
|
||||
"password:"xxxx",
|
||||
"email":"hannibal@a-team.com",
|
||||
"serveraddress":"https://index.docker.io/v1/"
|
||||
"username":" hannibal",
|
||||
"password: "xxxx",
|
||||
"email": "hannibal@a-team.com",
|
||||
"serveraddress": "https://index.docker.io/v1/"
|
||||
}
|
||||
|
||||
**Example response**:
|
||||
|
@ -1274,20 +1273,20 @@ Display system-wide information
|
|||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"Containers":11,
|
||||
"Images":16,
|
||||
"Driver":"btrfs",
|
||||
"ExecutionDriver":"native-0.1",
|
||||
"KernelVersion":"3.12.0-1-amd64"
|
||||
"Debug":false,
|
||||
"Containers": 11,
|
||||
"Images": 16,
|
||||
"Driver": "btrfs",
|
||||
"ExecutionDriver": "native-0.1",
|
||||
"KernelVersion": "3.12.0-1-amd64"
|
||||
"Debug": false,
|
||||
"NFd": 11,
|
||||
"NGoroutines":21,
|
||||
"NEventsListener":0,
|
||||
"InitPath":"/usr/bin/docker",
|
||||
"IndexServerAddress":["https://index.docker.io/v1/"],
|
||||
"MemoryLimit":true,
|
||||
"SwapLimit":false,
|
||||
"IPv4Forwarding":true
|
||||
"NGoroutines": 21,
|
||||
"NEventsListener": 0,
|
||||
"InitPath": "/usr/bin/docker",
|
||||
"IndexServerAddress": ["https://index.docker.io/v1/"],
|
||||
"MemoryLimit": true,
|
||||
"SwapLimit": false,
|
||||
"IPv4Forwarding": true
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
|
@ -1311,10 +1310,10 @@ Show the docker version information
|
|||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"ApiVersion":"1.12",
|
||||
"Version":"0.2.2",
|
||||
"GitCommit":"5a2a5cc+CHANGES",
|
||||
"GoVersion":"go1.0.3"
|
||||
"ApiVersion": "1.12",
|
||||
"Version": "0.2.2",
|
||||
"GitCommit": "5a2a5cc+CHANGES",
|
||||
"GoVersion": "go1.0.3"
|
||||
}
|
||||
|
||||
Status Codes:
|
||||
|
@ -1356,30 +1355,30 @@ Create a new image from a container's changes
|
|||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"Hostname":"",
|
||||
"Hostname": "",
|
||||
"Domainname": "",
|
||||
"User":"",
|
||||
"Memory":0,
|
||||
"MemorySwap":0,
|
||||
"User": "",
|
||||
"Memory": 0,
|
||||
"MemorySwap": 0,
|
||||
"CpuShares": 512,
|
||||
"Cpuset": "0,1",
|
||||
"AttachStdin":false,
|
||||
"AttachStdout":true,
|
||||
"AttachStderr":true,
|
||||
"PortSpecs":null,
|
||||
"Tty":false,
|
||||
"OpenStdin":false,
|
||||
"StdinOnce":false,
|
||||
"Env":null,
|
||||
"Cmd":[
|
||||
"AttachStdin": false,
|
||||
"AttachStdout": true,
|
||||
"AttachStderr": true,
|
||||
"PortSpecs": null,
|
||||
"Tty": false,
|
||||
"OpenStdin": false,
|
||||
"StdinOnce": false,
|
||||
"Env": null,
|
||||
"Cmd": [
|
||||
"date"
|
||||
],
|
||||
"Volumes":{
|
||||
"Volumes": {
|
||||
"/tmp": {}
|
||||
},
|
||||
"WorkingDir":"",
|
||||
"WorkingDir": "",
|
||||
"NetworkDisabled": false,
|
||||
"ExposedPorts":{
|
||||
"ExposedPorts": {
|
||||
"22/tcp": {}
|
||||
}
|
||||
}
|
||||
|
@ -1389,7 +1388,7 @@ Create a new image from a container's changes
|
|||
HTTP/1.1 201 Created
|
||||
Content-Type: application/vnd.docker.raw-stream
|
||||
|
||||
{"Id":"596069db4bf5"}
|
||||
{"Id": "596069db4bf5"}
|
||||
|
||||
Json Parameters:
|
||||
|
||||
|
@ -1434,10 +1433,10 @@ and Docker images will report:
|
|||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{"status":"create","id":"dfdf82bd3881","from":"base:latest","time":1374067924}
|
||||
{"status":"start","id":"dfdf82bd3881","from":"base:latest","time":1374067924}
|
||||
{"status":"stop","id":"dfdf82bd3881","from":"base:latest","time":1374067966}
|
||||
{"status":"destroy","id":"dfdf82bd3881","from":"base:latest","time":1374067970}
|
||||
{"status": "create", "id": "dfdf82bd3881","from": "base:latest", "time":1374067924}
|
||||
{"status": "start", "id": "dfdf82bd3881","from": "base:latest", "time":1374067924}
|
||||
{"status": "stop", "id": "dfdf82bd3881","from": "base:latest", "time":1374067966}
|
||||
{"status": "destroy", "id": "dfdf82bd3881","from": "base:latest", "time":1374067970}
|
||||
|
||||
Query Parameters:
|
||||
|
||||
|
@ -1547,7 +1546,7 @@ the root that contains a list of repository and tag names mapped to layer IDs.
|
|||
|
||||
```
|
||||
{"hello-world":
|
||||
{"latest":"565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"}
|
||||
{"latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"}
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -1563,11 +1562,11 @@ Sets up an exec instance in a running container `id`
|
|||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"AttachStdin":false,
|
||||
"AttachStdout":true,
|
||||
"AttachStderr":true,
|
||||
"Tty":false,
|
||||
"Cmd":[
|
||||
"AttachStdin": false,
|
||||
"AttachStdout": true,
|
||||
"AttachStderr": true,
|
||||
"Tty": false,
|
||||
"Cmd": [
|
||||
"date"
|
||||
],
|
||||
}
|
||||
|
@ -1578,7 +1577,7 @@ Sets up an exec instance in a running container `id`
|
|||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"Id":"f90e34656806"
|
||||
"Id": "f90e34656806"
|
||||
}
|
||||
|
||||
Json Parameters:
|
||||
|
@ -1609,8 +1608,8 @@ interactive session with the `exec` command.
|
|||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"Detach":false,
|
||||
"Tty":false,
|
||||
"Detach": false,
|
||||
"Tty": false,
|
||||
}
|
||||
|
||||
**Example response**:
|
||||
|
|
Loading…
Add table
Reference in a new issue