Signed-off-by: Anshul Pundir <anshul.pundir@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| ... | ... |
@@ -16,6 +16,7 @@ func newListNodesFilters(filter filters.Args) (*swarmapi.ListNodesRequest_Filter |
| 16 | 16 |
"label": true, |
| 17 | 17 |
"role": true, |
| 18 | 18 |
"membership": true, |
| 19 |
+ "node.label": true, |
|
| 19 | 20 |
} |
| 20 | 21 |
if err := filter.Validate(accepted); err != nil {
|
| 21 | 22 |
return nil, err |
| ... | ... |
@@ -24,6 +25,7 @@ func newListNodesFilters(filter filters.Args) (*swarmapi.ListNodesRequest_Filter |
| 24 | 24 |
NamePrefixes: filter.Get("name"),
|
| 25 | 25 |
IDPrefixes: filter.Get("id"),
|
| 26 | 26 |
Labels: runconfigopts.ConvertKVStringsToMap(filter.Get("label")),
|
| 27 |
+ NodeLabels: runconfigopts.ConvertKVStringsToMap(filter.Get("node.label")),
|
|
| 27 | 28 |
} |
| 28 | 29 |
|
| 29 | 30 |
for _, r := range filter.Get("role") {
|
| ... | ... |
@@ -26,6 +26,10 @@ keywords: "API, Docker, rcli, REST, documentation" |
| 26 | 26 |
* `POST /swarm/init` now accepts a `DefaultAddrPool` property to set global scope default address pool |
| 27 | 27 |
* `POST /swarm/init` now accepts a `SubnetSize` property to set global scope networks by giving the |
| 28 | 28 |
length of the subnet masks for every such network |
| 29 |
+* `GET /nodes` now supports a filter type `node.label` filter to filter nodes based |
|
| 30 |
+ on the node.label. The format of the label filter is `node.label=<key>`/`node.label=<key>=<value>` |
|
| 31 |
+ to return those with the specified labels, or `node.label!=<key>`/`node.label!=<key>=<value>` |
|
| 32 |
+ to return those without the specified labels. |
|
| 29 | 33 |
|
| 30 | 34 |
## V1.38 API changes |
| 31 | 35 |
|