1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Changes to cluster/filter, swagger.yaml, version-history.md for filtering on node labels.

Signed-off-by: Anshul Pundir <anshul.pundir@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Anshul Pundir 2018-08-16 16:29:33 -07:00 committed by Sebastiaan van Stijn
parent 2629fe9326
commit 514ce73391
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
3 changed files with 7 additions and 0 deletions

View file

@ -8609,6 +8609,7 @@ paths:
- `label=<engine label>`
- `membership=`(`accepted`|`pending`)`
- `name=<node name>`
- `node.label=<node label>`
- `role=`(`manager`|`worker`)`
type: "string"
tags: ["Node"]

View file

@ -16,6 +16,7 @@ func newListNodesFilters(filter filters.Args) (*swarmapi.ListNodesRequest_Filter
"label": true,
"role": true,
"membership": true,
"node.label": true,
}
if err := filter.Validate(accepted); err != nil {
return nil, err
@ -24,6 +25,7 @@ func newListNodesFilters(filter filters.Args) (*swarmapi.ListNodesRequest_Filter
NamePrefixes: filter.Get("name"),
IDPrefixes: filter.Get("id"),
Labels: runconfigopts.ConvertKVStringsToMap(filter.Get("label")),
NodeLabels: runconfigopts.ConvertKVStringsToMap(filter.Get("node.label")),
}
for _, r := range filter.Get("role") {

View file

@ -26,6 +26,10 @@ keywords: "API, Docker, rcli, REST, documentation"
* `POST /swarm/init` now accepts a `DefaultAddrPool` property to set global scope default address pool
* `POST /swarm/init` now accepts a `SubnetSize` property to set global scope networks by giving the
length of the subnet masks for every such network
* `GET /nodes` now supports a filter type `node.label` filter to filter nodes based
on the node.label. The format of the label filter is `node.label=<key>`/`node.label=<key>=<value>`
to return those with the specified labels, or `node.label!=<key>`/`node.label!=<key>=<value>`
to return those without the specified labels.
## V1.38 API changes