From ca91918dd49e1ade9145ce955c8eb297f58389fb Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 28 Feb 2019 17:39:57 +0100 Subject: [PATCH] docs follow-ups for networks "dangling" filter Signed-off-by: Sebastiaan van Stijn --- api/swagger.yaml | 4 ++++ api/types/network/network.go | 6 +++--- docs/api/version-history.md | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/api/swagger.yaml b/api/swagger.yaml index d31af04dcf..8652c368c4 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -8088,6 +8088,10 @@ paths: description: | JSON encoded value of the filters (a `map[string][]string`) to process on the networks list. Available filters: + - `dangling=` When set to `true` (or `1`), returns all + networks that are not in use by a container. When set to `false` + (or `0`), only networks that are in use by one or more + containers are returned. - `driver=` Matches a network's driver. - `id=` Matches all or part of a network ID. - `label=` or `label==` of a network label. diff --git a/api/types/network/network.go b/api/types/network/network.go index 014a8d5c96..71e97338fd 100644 --- a/api/types/network/network.go +++ b/api/types/network/network.go @@ -112,13 +112,13 @@ type ConfigReference struct { } var acceptedFilters = map[string]bool{ + "dangling": true, "driver": true, - "type": true, - "name": true, "id": true, "label": true, + "name": true, "scope": true, - "dangling": true, + "type": true, } // ValidateFilters validates the list of filter args with the available filters. diff --git a/docs/api/version-history.md b/docs/api/version-history.md index 5d71aa15a9..ccb36d16a8 100644 --- a/docs/api/version-history.md +++ b/docs/api/version-history.md @@ -35,6 +35,10 @@ keywords: "API, Docker, rcli, REST, documentation" * `POST /services/{id}/update` now includes `Runtime` as an option in `ContainerSpec.Configs` * `GET /tasks` now returns `Sysctls` as part of the `ContainerSpec`. * `GET /tasks/{id}` now returns `Sysctls` as part of the `ContainerSpec`. +* `GET /networks` now supports a `dangling` filter type. When set to `true` (or + `1`), the endpoint returns all networks that are not in use by a container. When + set to `false` (or `0`), only networks that are in use by one or more containers + are returned. * `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=`/`node.label==` to return those with the specified labels, or `node.label!=`/`node.label!==`