Adding network filter to docker ps command

Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Upstream-commit: 912af1ae8f22c4d9d7e478d0985a40b41ded2027
Component: engine
This commit is contained in:
Sainath Grandhi
2016-06-07 16:43:11 +02:00
committed by Sebastiaan van Stijn
parent 4d60d70438
commit 4e024e3e7d
6 changed files with 66 additions and 1 deletions
@@ -117,6 +117,7 @@ This section lists each version from latest to oldest. Each listing includes a
* `POST /containers/create` now takes `StorageOpt` field.
* `GET /info` now returns `SecurityOptions` field, showing if `apparmor`, `seccomp`, or `selinux` is supported.
* `GET /networks` now supports filtering by `label` and `driver`.
* `GET /containers/json` now supports filtering containers by `network` name.
* `POST /containers/create` now takes `MaximumIOps` and `MaximumIOBps` fields. Windows daemon only.
* `POST /containers/create` now returns an HTTP 400 "bad parameter" message
if no command is specified (instead of an HTTP 500 "server error")
@@ -223,6 +223,7 @@ Query Parameters:
- `before`=(`<container id>` or `<container name>`)
- `since`=(`<container id>` or `<container name>`)
- `volume`=(`<volume name>` or `<mount point destination>`)
- `network`=(`<network name>`)
Status Codes:
@@ -62,7 +62,7 @@ The currently supported filters are:
* since (container's id or name) - filters containers created since given id or name
* isolation (default|process|hyperv) (Windows daemon only)
* volume (volume name or mount point) - filters containers that mount volumes.
* network (network name) - filters containers connected to the provided network name
#### Label
@@ -207,6 +207,17 @@ The `volume` filter shows only containers that mount a specific volume or have a
CONTAINER ID MOUNTS
9c3527ed70ce remote-volume
#### Network
The `network` filter shows only containers that has endpoints on the provided network name.
$docker run -d --net=net1 --name=test1 ubuntu top
$docker run -d --net=net2 --name=test2 ubuntu top
$docker ps --filter network=net1
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9d4893ed80fe ubuntu "top" 10 minutes ago Up 10 minutes test1
## Formatting