diff options
author | Paul Holzinger <paul.holzinger@web.de> | 2020-09-02 18:13:58 +0200 |
---|---|---|
committer | Paul Holzinger <paul.holzinger@web.de> | 2020-09-07 15:39:41 +0200 |
commit | 5b8f3f2f1f863dfb58e5d3cfda95e7ecb6582b22 (patch) | |
tree | a413ccdad49a09f2bae47dff5c549d12465ccb27 /pkg/bindings/network | |
parent | 1184cdf03d8464451d36b24643e57b65a8b97980 (diff) | |
download | podman-5b8f3f2f1f863dfb58e5d3cfda95e7ecb6582b22.tar.gz podman-5b8f3f2f1f863dfb58e5d3cfda95e7ecb6582b22.tar.bz2 podman-5b8f3f2f1f863dfb58e5d3cfda95e7ecb6582b22.zip |
APIv2 Add network list filtering
Add the filter option to the libpod endpoint.
Add support for the name filter on the docker endpoint.
Add apiv2 tests for the network list endpoints.
Enable podman network integration tests for remote.
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'pkg/bindings/network')
-rw-r--r-- | pkg/bindings/network/network.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pkg/bindings/network/network.go b/pkg/bindings/network/network.go index fd1111282..d8dc7e352 100644 --- a/pkg/bindings/network/network.go +++ b/pkg/bindings/network/network.go @@ -70,7 +70,7 @@ func Remove(ctx context.Context, nameOrID string, force *bool) ([]*entities.Netw } // List returns a summary of all CNI network configurations -func List(ctx context.Context) ([]*entities.NetworkListReport, error) { +func List(ctx context.Context, options entities.NetworkListOptions) ([]*entities.NetworkListReport, error) { var ( netList []*entities.NetworkListReport ) @@ -78,7 +78,11 @@ func List(ctx context.Context) ([]*entities.NetworkListReport, error) { if err != nil { return nil, err } - response, err := conn.DoRequest(nil, http.MethodGet, "/networks/json", nil, nil) + params := url.Values{} + if options.Filter != "" { + params.Set("filter", options.Filter) + } + response, err := conn.DoRequest(nil, http.MethodGet, "/networks/json", params, nil) if err != nil { return netList, err } |