add node/service/secret/config specific event filter

Signed-off-by: Allen Sun <shlallen1990@gmail.com>
This commit is contained in:
Allen Sun 2017-09-23 12:08:38 +08:00 committed by Allen Sun
parent 74a084162c
commit 4611ecd3cd
3 changed files with 12 additions and 3 deletions

View file

@ -6941,16 +6941,20 @@ paths:
description: |
A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters:
- `config=<string>` config name or ID
- `container=<string>` container name or ID
- `daemon=<string>` daemon name or ID
- `event=<string>` event type
- `image=<string>` image name or ID
- `label=<string>` image or container label
- `network=<string>` network name or ID
- `node=<string>` node ID
- `plugin`=<string> plugin name or ID
- `scope`<string> local or swarm
- `type=<string>` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service` or `secret`
- `volume=<string>` volume name or ID
- `secret=<string>` secret name or ID
- `service=<string>` service name or ID
- `type=<string>` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config`
- `volume=<string>` volume name
type: "string"
tags: ["System"]
/system/df:

View file

@ -27,6 +27,10 @@ func (ef *Filter) Include(ev events.Message) bool {
ef.matchVolume(ev) &&
ef.matchNetwork(ev) &&
ef.matchImage(ev) &&
ef.matchNode(ev) &&
ef.matchService(ev) &&
ef.matchSecret(ev) &&
ef.matchConfig(ev) &&
ef.matchLabels(ev.Actor.Attributes)
}

View file

@ -18,7 +18,8 @@ keywords: "API, Docker, rcli, REST, documentation"
[Docker Engine API v1.33](https://docs.docker.com/engine/api/v1.33/) documentation
* `GET /events` now supports filtering 4 more kinds of events: `config`, `node`,
`secret` and `service`.
## v1.32 API changes