Skip to content

Commit

Permalink
Merge pull request #905 from pouchrobot/auto-doc-2018-03-16
Browse files Browse the repository at this point in the history
docs: auto generate pouch cli/api docs via code
  • Loading branch information
Letty5411 authored Mar 16, 2018
2 parents 0dc6fa0 + cf17e92 commit 1ad0671
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 0 deletions.
59 changes: 59 additions & 0 deletions docs/api/HTTP_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,48 @@ Return low-level information about a container.
* Container


<a name="containerlogs"></a>
### Get container logs
```
GET /containers/{id}/logs
```


#### Description
Get `stdout` and `stderr` logs from a container.

Note: This endpoint works only for containers with the `json-file` or `journald` logging driver.


#### Parameters

|Type|Name|Description|Schema|Default|
|---|---|---|---|---|
|**Path**|**id** <br>*required*|ID or name of the container|string||
|**Query**|**follow** <br>*optional*|Return the logs as a stream.|boolean|`"false"`|
|**Query**|**since** <br>*optional*|Only return logs since this time, as a UNIX timestamp|integer|`0`|
|**Query**|**stderr** <br>*optional*|Return logs from `stderr`|boolean|`"false"`|
|**Query**|**stdout** <br>*optional*|Return logs from `stdout`|boolean|`"false"`|
|**Query**|**tail** <br>*optional*|Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines.|string|`"all"`|
|**Query**|**timestamps** <br>*optional*|Add timestamps to every log line|boolean|`"false"`|
|**Query**|**until** <br>*optional*|Only return logs before this time, as a UNIX timestamp|integer|`0`|


#### Responses

|HTTP Code|Description|Schema|
|---|---|---|
|**101**|logs returned as a stream|string (binary)|
|**200**|logs returned as a string in response body|string|
|**404**|An unexpected 404 error occured.|[Error](#error)|
|**500**|An unexpected server error occured.|[Error](#error)|


#### Tags

* Container


<a name="containerpause"></a>
### Pause a container
```
Expand Down Expand Up @@ -1442,6 +1484,23 @@ GET "/containers/{id}/json"
|**State** <br>*optional*|The state of the container.|[ContainerState](#containerstate)|


<a name="containerlogsoptions"></a>
### ContainerLogsOptions
The parameters to filter the log.


|Name|Description|Schema|
|---|---|---|
|**Details** <br>*optional*|Show extra details provided to logs|boolean|
|**Follow** <br>*optional*|Return logs as a stream|boolean|
|**ShowStderr** <br>*optional*|Return logs from `stderr`|boolean|
|**ShowStdout** <br>*optional*|Return logs from `stdout`|boolean|
|**Since** <br>*optional*|Only return logs after this time, as a UNIX timestamp|string|
|**Tail** <br>*optional*|Only reture this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines.|string|
|**Timestamps** <br>*optional*|Add timestamps to every log line|boolean|
|**Until** <br>*optional*|Only reture logs before this time, as a UNIX timestamp|string|


<a name="containerprocesslist"></a>
### ContainerProcessList
OK Response to ContainerTop operation
Expand Down
2 changes: 2 additions & 0 deletions docs/commandline/pouch.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ pouch is a client side tool pouch to interact with daemon side process pouchd. F
* [pouch inspect](pouch_inspect.md) - Get the detailed information of container
* [pouch login](pouch_login.md) - Login to a registry
* [pouch logout](pouch_logout.md) - Logout from a registry
* [pouch logs](pouch_logs.md) - Print a container's logs
* [pouch network](pouch_network.md) - Manage pouch networks
* [pouch pause](pouch_pause.md) - Pause a running container
* [pouch ps](pouch_ps.md) - List containers
Expand All @@ -38,6 +39,7 @@ pouch is a client side tool pouch to interact with daemon side process pouchd. F
* [pouch run](pouch_run.md) - Create a new container and start it
* [pouch start](pouch_start.md) - Start a created or stopped container
* [pouch stop](pouch_stop.md) - Stop a running container
* [pouch top](pouch_top.md) - Display the running processes of a 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
Expand Down
37 changes: 37 additions & 0 deletions docs/commandline/pouch_logs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## pouch logs

Print a container's logs

### Synopsis

Print a container's logs

```
pouch logs [OPTIONS] CONTAINER
```

### Options

```
--details Show extra provided to logs
-f, --follow Follow log output
-h, --help help for logs
--since string Show logs since timestamp
--tail string Number of lines to show from the end of the logs default "all" (default "all")
-t, --timestamps Show timestamps
```

### 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

41 changes: 41 additions & 0 deletions docs/commandline/pouch_top.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
## pouch top

Display the running processes of a container

### Synopsis

top comand is to display the running processes of a container.Your can add options just like using Linux ps command.

```
pouch top CONTAINER [ps OPTIONS]
```

### Examples

```
$ pouch top 44f675
UID PID PPID C STIME TTY TIME CMD
root 28725 28714 0 3月14 ? 00:00:00 sh
```

### Options

```
-h, --help help for top
```

### 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

0 comments on commit 1ad0671

Please sign in to comment.