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/contributors docs via code #2888

Merged
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
172 changes: 172 additions & 0 deletions docs/api/HTTP_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,156 @@ DELETE /containers/{id}
* Container


<a name="containerarchive"></a>
### Get an archive of a filesystem resource in a container
```
GET /containers/{id}/archive
```


#### Description
Get a tar archive of a resource in the filesystem of container id.


#### Parameters

|Type|Name|Description|Schema|
|---|---|---|---|
|**Path**|**id** <br>*required*|ID or name of the container|string|
|**Query**|**path** <br>*required*|Resource in the container’s filesystem to archive.|string|


#### Responses

|HTTP Code|Description|Schema|
|---|---|---|
|**200**|no error|No Content|
|**400**|Bad parameter|[0ErrorResponse](#0errorresponse)|
|**404**|Container or path does not exist|[4ErrorResponse](#4errorresponse)|
|**500**|server error|[0ErrorResponse](#0errorresponse)|


#### Produces

* `application/x-tar`


#### Tags

* Copy


#### Example HTTP response

##### Response 404
```
json :
{
"message" : "No such container: c2ada9df5af8"
}
```


<a name="putcontainerarchive"></a>
### Extract an archive of files or folders to a directory in a container
```
PUT /containers/{id}/archive
```


#### Description
Upload a tar archive to be extracted to a path in the filesystem of container id.


#### Parameters

|Type|Name|Description|Schema|
|---|---|---|---|
|**Path**|**id** <br>*required*|ID or name of the container|string|
|**Query**|**copyUIDGID** <br>*optional*|If “1”, “true”, or “True” then it will copy UID/GID maps to dest file.|string|
|**Query**|**noOverwriteDirNonDir** <br>*optional*|If “1”, “true”, or “True” then it will be an error if unpacking the given content would cause an existing directory to be replaced with a non-directory and vice versa.|string|
|**Query**|**path** <br>*required*|Path to a directory in the container to extract the archive’s contents into.|string|
|**Body**|**inputStream** <br>*required*|The input stream must be a tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz.|string|


#### Responses

|HTTP Code|Description|Schema|
|---|---|---|
|**200**|The content was extracted successfully|No Content|
|**400**|Bad parameter|[0ErrorResponse](#0errorresponse)|
|**403**|Permission denied, the volume or container rootfs is marked as read-only.|[3ErrorResponse](#3errorresponse)|
|**404**|No such container or path does not exist inside the container|[4ErrorResponse](#4errorresponse)|
|**500**|Server error|[0ErrorResponse](#0errorresponse)|


#### Consumes

* `application/x-tar`
* `application/octet-stream`


#### Tags

* Copy


#### Example HTTP response

##### Response 404
```
json :
{
"message" : "No such container: c2ada9df5af8"
}
```


<a name="containerarchiveinfo"></a>
### Get information about files in a container
```
HEAD /containers/{id}/archive
```


#### Description
A response header `X-Docker-Container-Path-Stat` is return containing a base64 - encoded JSON object with some filesystem header information about the path.


#### Parameters

|Type|Name|Description|Schema|
|---|---|---|---|
|**Path**|**id** <br>*required*|ID or name of the container|string|
|**Query**|**path** <br>*required*|Resource in the container’s filesystem to archive.|string|


#### Responses

|HTTP Code|Description|Schema|
|---|---|---|
|**200**|no error <br>**Headers** : <br>`X-Docker-Container-Path-Stat` (string) : A base64 - encoded JSON object with some filesystem header information about the path.|No Content|
|**400**|Bad parameter|[0ErrorResponse](#0errorresponse)|
|**404**|Container or path does not exist|[4ErrorResponse](#4errorresponse)|
|**500**|Server error|[0ErrorResponse](#0errorresponse)|


#### Tags

* Copy


#### Example HTTP response

##### Response 404
```
json :
{
"message" : "No such container: c2ada9df5af8"
}
```


<a name="containerattach"></a>
### Attach to a container
```
Expand Down Expand Up @@ -1332,6 +1482,14 @@ GET /images/search
```


#### Parameters

|Type|Name|Description|Schema|
|---|---|---|---|
|**Query**|**registry** <br>*optional*|Search images from specified registry|string|
|**Query**|**term** <br>*required*|Term to search|string|


#### Responses

|HTTP Code|Description|Schema|
Expand Down Expand Up @@ -2327,6 +2485,20 @@ The parameters to filter the log.
|**Until** <br>*optional*|Only reture logs before this time, as a UNIX timestamp|string|


<a name="containerpathstat"></a>
### ContainerPathStat
ContainerPathStat is used to describe the stat of file


|Name|Description|Schema|
|---|---|---|
|**mode** <br>*optional*||integer (uint32)|
|**mtime** <br>*optional*|modification time.|string (date-time)|
|**name** <br>*optional*||string|
|**path** <br>*optional*||string|
|**size** <br>*optional*||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 @@ -23,6 +23,7 @@ pouch is a client side tool pouch to interact with daemon side process pouchd. F
* [pouch build](pouch_build.md) - Build an image from a Dockerfile
* [pouch checkpoint](pouch_checkpoint.md) - Manage checkpoint commands
* [pouch commit](pouch_commit.md) - Commit an image from a container
* [pouch cp](pouch_cp.md) - Copy files/folders between a container and the local filesystem
* [pouch create](pouch_create.md) - Create a new container with specified image
* [pouch events](pouch_events.md) - Get real time events from the daemon
* [pouch exec](pouch_exec.md) - Run a command in a running container
Expand All @@ -48,6 +49,7 @@ pouch is a client side tool pouch to interact with daemon side process pouchd. F
* [pouch rmi](pouch_rmi.md) - Remove one or more images by reference
* [pouch run](pouch_run.md) - Create a new container and start it
* [pouch save](pouch_save.md) - Save an image to a tar archive or STDOUT
* [pouch search](pouch_search.md) - Search the images from specific registry
* [pouch start](pouch_start.md) - Start one or more created or stopped containers
* [pouch stats](pouch_stats.md) - Display a live stream of container(s) resource usage statistics
* [pouch stop](pouch_stop.md) - Stop one or more running containers
Expand Down
46 changes: 46 additions & 0 deletions docs/commandline/pouch_cp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## pouch cp

Copy files/folders between a container and the local filesystem

### Synopsis

Copy files/folders between a container and the local filesystem

Use '-' as the source to read a tar archive from stdin
and extract it to a directory destination in a container.
Use '-' as the destination to stream a tar archive of a
container source to stdout.

```
pouch cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|-
pouch cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH
```

### Examples

```
$ pouch cp 8assd1234:/root/foo /home
$ pouch cp /home/bar 712yasbc:/root
```

### Options

```
-h, --help help for cp
```

### Options inherited from parent commands

```
-D, --debug Switch client log level to DEBUG mode
-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

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

Search the images from specific registry

### Synopsis


Search the images from specific registry.

```
pouch search [OPTIONS] TERM
```

### Examples

```
$ pouch search nginx
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
nginx Official build of Nginx. 11403 [OK]
jwilder/nginx-proxy Automated Nginx reverse proxy for docker con… 1600 [OK]
richarvey/nginx-php-fpm Container running Nginx + PHP-FPM capable of… 712 [OK]
jrcs/letsencrypt-nginx-proxy-companion LetsEncrypt container to use with nginx as p… 509 [OK]
webdevops/php-nginx Nginx with PHP-FPM 127 [OK]
zabbix/zabbix-web-nginx-mysql Zabbix frontend based on Nginx web-server wi… 101 [OK]
bitnami/nginx Bitnami nginx Docker Image 66 [OK]
linuxserver/nginx An Nginx container, brought to you by LinuxS… 61
1and1internet/ubuntu-16-nginx-php-phpmyadmin-mysql-5 ubuntu-16-nginx-php-phpmyadmin-mysql-5 50 [OK]
zabbix/zabbix-web-nginx-pgsql Zabbix frontend based on Nginx with PostgreS… 33 [OK]
tobi312/rpi-nginx NGINX on Raspberry Pi / ARM 26 [OK]
nginx/nginx-ingress NGINX Ingress Controller for Kubernetes 20
schmunk42/nginx-redirect A very simple container to redirect HTTP tra… 15 [OK]
nginxdemos/hello NGINX webserver that serves a simple page co… 14 [OK]
blacklabelops/nginx Dockerized Nginx Reverse Proxy Server. 12 [OK]
wodby/drupal-nginx Nginx for Drupal container image 12 [OK]
centos/nginx-18-centos7 Platform for running nginx 1.8 or building n… 10
centos/nginx-112-centos7 Platform for running nginx 1.12 or building … 9
nginxinc/nginx-unprivileged Unprivileged NGINX Dockerfiles 4
1science/nginx Nginx Docker images that include Consul Temp… 4 [OK]
nginx/nginx-prometheus-exporter NGINX Prometheus Exporter 4
mailu/nginx Mailu nginx frontend 3 [OK]
toccoag/openshift-nginx Nginx reverse proxy for Nice running on same… 1 [OK]
ansibleplaybookbundle/nginx-apb An APB to deploy NGINX 0 [OK]
wodby/nginx Generic nginx 0 [OK]

```

### Options

```
-h, --help help for search
-r, --registry string set registry name
```

### Options inherited from parent commands

```
-D, --debug Switch client log level to DEBUG mode
-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