summaryrefslogtreecommitdiff
path: root/pkg/bindings
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-09-10 10:15:01 -0400
committerGitHub <noreply@github.com>2020-09-10 10:15:01 -0400
commit3d33923374ee39977166d9fff3ee53c58d884bbe (patch)
tree327b33269b94c9d1faec38eaedf5b78a12a26214 /pkg/bindings
parente1b47296daaf4148d9970b59757a86e71bf8bb10 (diff)
parentce7d2bba1f6fdc96ef7439135b3c1388b7bac297 (diff)
downloadpodman-3d33923374ee39977166d9fff3ee53c58d884bbe.tar.gz
podman-3d33923374ee39977166d9fff3ee53c58d884bbe.tar.bz2
podman-3d33923374ee39977166d9fff3ee53c58d884bbe.zip
Merge pull request #7536 from Luap99/api-network-filter
APIv2 Add network list filtering
Diffstat (limited to 'pkg/bindings')
-rw-r--r--pkg/bindings/network/network.go8
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
}