Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: auto generate pouch cli/api docs via code #882

Merged
merged 1 commit into from
Mar 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 72 additions & 1 deletion docs/api/HTTP_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,36 @@ POST /containers/{id}/update
* Container


<a name="containerupgrade"></a>
### Upgrade a container with new image and args
```
POST /containers/{id}/upgrade
```


#### Parameters

|Type|Name|Description|Schema|
|---|---|---|---|
|**Path**|**id** <br>*required*|ID or name of the container|string|
|**Body**|**upgradeConfig** <br>*optional*||[ContainerUpgradeConfig](#containerupgradeconfig)|


#### Responses

|HTTP Code|Description|Schema|
|---|---|---|
|**200**|no error|No Content|
|**400**|bad parameter|[Error](#error)|
|**404**|An unexpected 404 error occured.|[Error](#error)|
|**500**|An unexpected server error occured.|[Error](#error)|


#### Tags

* Container


<a name="execstart"></a>
### Start an exec instance
```
Expand Down Expand Up @@ -1388,6 +1418,47 @@ GET "/containers/{id}/json"
|**Status** <br>*optional*||[Status](#status)|


<a name="containerupgradeconfig"></a>
### ContainerUpgradeConfig
ContainerUpgradeConfig is used for API "POST /containers/upgrade".
It wraps all kinds of config used in container upgrade.
It can be used to encode client params in client and unmarshal request body in daemon side.

*Polymorphism* : Composition


|Name|Description|Schema|
|---|---|---|
|**ArgsEscaped** <br>*optional*|Command is already escaped (Windows only)|boolean|
|**AttachStderr** <br>*optional*|Whether to attach to `stderr`. <br>**Default** : `true`|boolean|
|**AttachStdin** <br>*optional*|Whether to attach to `stdin`.|boolean|
|**AttachStdout** <br>*optional*|Whether to attach to `stdout`. <br>**Default** : `true`|boolean|
|**Cmd** <br>*optional*|Command to run specified an array of strings.|< string > array|
|**Domainname** <br>*optional*|The domain name to use for the container.|string|
|**Entrypoint** <br>*optional*|The entry point for the container as a string or an array of strings.<br>If the array consists of exactly one empty string (`[""]`) then the entry point is reset to system default (i.e., the entry point used by pouch when there is no `ENTRYPOINT` instruction in the `Dockerfile`).|< string > array|
|**Env** <br>*optional*|A list of environment variables to set inside the container in the form `["VAR=value", ...]`. A variable without `=` is removed from the environment, rather than to have an empty value.|< string > array|
|**ExposedPorts** <br>*optional*|An object mapping ports to an empty object in the form:`{<port>/<tcp\|udp>: {}}`|< string, object > map|
|**HostConfig** <br>*optional*||[HostConfig](#hostconfig)|
|**Hostname** <br>*optional*|The hostname to use for the container, as a valid RFC 1123 hostname. <br>**Minimum length** : `1`|string (hostname)|
|**Image** <br>*required*|The name of the image to use when creating the container|string|
|**InitScript** <br>*optional*|Initial script executed in container. The script will be executed before entrypoint or command|string|
|**Labels** <br>*optional*|User-defined key/value metadata.|< string, string > map|
|**MacAddress** <br>*optional*|MAC address of the container.|string|
|**NetworkDisabled** <br>*optional*|Disable networking for the container.|boolean|
|**OnBuild** <br>*optional*|`ONBUILD` metadata that were defined in the image's `Dockerfile`.|< string > array|
|**OpenStdin** <br>*optional*|Open `stdin`|boolean|
|**Rich** <br>*optional*|Whether to start container in rich container mode. (default false)|boolean|
|**RichMode** <br>*optional*|Choose one rich container mode.(default dumb-init)|enum (dumb-init, sbin-init, systemd)|
|**Shell** <br>*optional*|Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell.|< string > array|
|**StdinOnce** <br>*optional*|Close `stdin` after one attached client disconnects|boolean|
|**StopSignal** <br>*optional*|Signal to stop a container as a string or unsigned integer. <br>**Default** : `"SIGTERM"`|string|
|**StopTimeout** <br>*optional*|Timeout to stop a container in seconds.|integer|
|**Tty** <br>*optional*|Attach standard streams to a TTY, including `stdin` if it is not closed.|boolean|
|**User** <br>*optional*|The user that commands are run as inside the container.|string|
|**Volumes** <br>*optional*|An object mapping mount point paths inside the container to empty objects.|< string, object > map|
|**WorkingDir** <br>*optional*|The working directory for commands to run in.|string|


<a name="devicemapping"></a>
### DeviceMapping
A device mapping between the host and container
Expand Down Expand Up @@ -1549,7 +1620,7 @@ Container configuration that depends on the host we are running on
|**OomScoreAdj** <br>*optional*|An integer value containing the score given to the container in order to tune OOM killer preferences. <br>**Example** : `500`|integer|
|**PidMode** <br>*optional*|Set the PID (Process) Namespace mode for the container. It can be either:<br>- `"container:<name\|id>"`: joins another container's PID namespace<br>- `"host"`: use the host's PID namespace inside the container|string|
|**PidsLimit** <br>*optional*|Tune a container's pids limit. Set -1 for unlimited. Only on Linux 4.4 does this paramter support.|integer (int64)|
|**PortBindings** <br>*optional*|A map of exposed container ports and the host port they should map to.|< string, [PortBinding](#portbinding) > map|
|**PortBindings** <br>*optional*|A map of exposed container ports and the host port they should map to.|[PortMap](#portmap)|
|**Privileged** <br>*optional*|Gives the container full access to the host.|boolean|
|**PublishAllPorts** <br>*optional*|Allocates a random host port for all of a container's exposed ports.|boolean|
|**ReadonlyRootfs** <br>*optional*|Mount the container's root filesystem as read only.|boolean|
Expand Down
1 change: 1 addition & 0 deletions docs/commandline/pouch.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ pouch is a client side tool pouch to interact with daemon side process pouchd. F
* [pouch stop](pouch_stop.md) - Stop a running container
* [pouch unpause](pouch_unpause.md) - Unpause a paused container
* [pouch update](pouch_update.md) - Update the configurations of a container
* [pouch upgrade](pouch_upgrade.md) - Upgrade a container with new image and args
* [pouch version](pouch_version.md) - Print versions about Pouch CLI and Pouchd
* [pouch volume](pouch_volume.md) - Manage pouch volumes

2 changes: 2 additions & 0 deletions docs/commandline/pouch_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ container ID: e1d541722d68dc5d133cca9e7bd8fd9338603e1763096c8e853522b60d11f7b9,
--enableLxcfs Enable lxcfs for the container, only effective when enable-lxcfs switched on in Pouchd
--entrypoint string Overwrite the default ENTRYPOINT of the image
-e, --env strings Set environment variables for container
--expose strings Set expose container's ports
-h, --help help for create
--hostname string Set container's hostname
--initscript string Initial script executed in container
Expand All @@ -51,6 +52,7 @@ container ID: e1d541722d68dc5d133cca9e7bd8fd9338603e1763096c8e853522b60d11f7b9,
--name string Specify name of container
--net strings Set networks to container
--pid string PID namespace to use
-p, --port strings Set container ports mapping
--privileged Give extended privileges to the container
--restart string Restart policy to apply when container exits
--rich Start container in rich container mode. (default false)
Expand Down
3 changes: 2 additions & 1 deletion docs/commandline/pouch_image_inspect.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ $ pouch image inspect docker.io/library/busybox
### Options

```
-h, --help help for inspect
-f, --format string Format the output using the given go template
-h, --help help for inspect
```

### Options inherited from parent commands
Expand Down
3 changes: 2 additions & 1 deletion docs/commandline/pouch_network_inspect.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Internal: false
### Options

```
-h, --help help for inspect
-f, --format string Format the output using the given go template
-h, --help help for inspect
```

### Options inherited from parent commands
Expand Down
2 changes: 2 additions & 0 deletions docs/commandline/pouch_run.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ crw-rw-rw- 1 root root 1, 3 Jan 8 09:40 /dev/testnull
--enableLxcfs Enable lxcfs for the container, only effective when enable-lxcfs switched on in Pouchd
--entrypoint string Overwrite the default ENTRYPOINT of the image
-e, --env strings Set environment variables for container
--expose strings Set expose container's ports
-h, --help help for run
--hostname string Set container's hostname
--initscript string Initial script executed in container
Expand All @@ -66,6 +67,7 @@ crw-rw-rw- 1 root root 1, 3 Jan 8 09:40 /dev/testnull
--name string Specify name of container
--net strings Set networks to container
--pid string PID namespace to use
-p, --port strings Set container ports mapping
--privileged Give extended privileges to the container
--restart string Restart policy to apply when container exits
--rich Start container in rich container mode. (default false)
Expand Down
15 changes: 14 additions & 1 deletion docs/commandline/pouch_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,25 @@ Update the configurations of a container

### Synopsis

Update the configurations of a container
Update a container's configurations, including memory, cpu and diskquota etc. You can update a container when it is running.

```
pouch update [OPTIONS] CONTAINER
```

### Examples

```
$ pouch run -d -m 20m --name test-update registry.hub.docker.com/library/busybox:latest
8649804cb63ff9713a2734d99728b9d6d5d1e4d2fbafb2b4dbdf79c6bbaef812
$ cat /sys/fs/cgroup/memory/8649804cb63ff9713a2734d99728b9d6d5d1e4d2fbafb2b4dbdf79c6bbaef812/memory.limit_in_bytes
20971520
$ pouch update -m 30m test-update
$ cat /sys/fs/cgroup/memory/8649804cb63ff9713a2734d99728b9d6d5d1e4d2fbafb2b4dbdf79c6bbaef812/memory.limit_in_bytes
31457280

```

### Options

```
Expand Down
77 changes: 77 additions & 0 deletions docs/commandline/pouch_upgrade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
## pouch upgrade

Upgrade a container with new image and args

### Synopsis

Upgrade a container with new image and args

```
pouch upgrade [OPTIONS] IMAGE [COMMAND] [ARG...]
```

### Options

```
--blkio-weight uint16 Block IO (relative weight), between 10 and 1000, or 0 to disable
--blkio-weight-device value Block IO weight (relative device weight) (default [])
--cap-add strings Add Linux capabilities
--cap-drop strings Drop Linux capabilities
--cgroup-parent string Optional parent cgroup for the container (default "default")
--cpu-share int CPU shares (relative weight)
--cpuset-cpus string CPUs in which to allow execution (0-3, 0,1)
--cpuset-mems string MEMs in which to allow execution (0-3, 0,1)
--device strings Add a host device to the container
--device-read-bps value Limit read rate (bytes per second) from a device (default [])
--device-read-iops value Limit read rate (IO per second) from a device (default [])
--device-write-bps value Limit write rate (bytes per second) from a device (default [])
--device-write-iops value Limit write rate (IO per second) from a device (default [])
--enableLxcfs Enable lxcfs for the container, only effective when enable-lxcfs switched on in Pouchd
--entrypoint string Overwrite the default ENTRYPOINT of the image
-e, --env strings Set environment variables for container
--expose strings Set expose container's ports
-h, --help help for upgrade
--hostname string Set container's hostname
--initscript string Initial script executed in container
--intel-rdt-l3-cbm string Limit container resource for Intel RDT/CAT which introduced in Linux 4.10 kernel
--ipc string IPC namespace to use
-l, --label strings Set labels for a container
-m, --memory string Memory limit
--memory-extra int Represent container's memory high water mark percentage, range in [0, 100]
--memory-force-empty-ctl int Whether to reclaim page cache when deleting the cgroup of container
--memory-swap string Swap limit equal to memory + swap, '-1' to enable unlimited swap
--memory-swappiness int Container memory swappiness [0, 100] (default -1)
--memory-wmark-ratio int Represent this container's memory low water mark percentage, range in [0, 100]. The value of memory low water mark is memory.limit_in_bytes * MemoryWmarkRatio
--name string Specify name of container
--net strings Set networks to container
--pid string PID namespace to use
-p, --port strings Set container ports mapping
--privileged Give extended privileges to the container
--restart string Restart policy to apply when container exits
--rich Start container in rich container mode. (default false)
--rich-mode string Choose one rich container mode. dumb-init(default), systemd, sbin-init
--runtime string OCI runtime to use for this container
--sche-lat-switch int Whether to enable scheduler latency count in cpuacct
--security-opt strings Security Options
--sysctl strings Sysctl options
-t, --tty Allocate a pseudo-TTY
-u, --user string UID
--uts string UTS namespace to use
-v, --volume strings Bind mount volumes to container
-w, --workdir string Set the working directory in a container
```

### Options inherited from parent commands

```
-H, --host string Specify connecting address of Pouch CLI (default "unix:///var/run/pouchd.sock")
--tlscacert string Specify CA file of TLS
--tlscert string Specify cert file of TLS
--tlskey string Specify key file of TLS
--tlsverify Use TLS and verify remote
```

### SEE ALSO

* [pouch](pouch.md) - An efficient container engine

3 changes: 2 additions & 1 deletion docs/commandline/pouch_volume_inspect.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ Driver: local
### Options

```
-h, --help help for inspect
-f, --format string Format the output using the given go template
-h, --help help for inspect
```

### Options inherited from parent commands
Expand Down