diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-04-06 21:27:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-06 21:27:52 +0200 |
commit | 7d95e0c47ad7203c6ad3e5a0441a309e5368dc52 (patch) | |
tree | 94f380670abc8b55885d37f79c5232222d2e8b43 /pkg/bindings/system/info.go | |
parent | 0519fa0f1e1697cd52f5ceb388117b64eefa7fc2 (diff) | |
parent | e20ecc733c878f0c4b67a21204f0d5ae11929bf0 (diff) | |
download | podman-7d95e0c47ad7203c6ad3e5a0441a309e5368dc52.tar.gz podman-7d95e0c47ad7203c6ad3e5a0441a309e5368dc52.tar.bz2 podman-7d95e0c47ad7203c6ad3e5a0441a309e5368dc52.zip |
Merge pull request #5507 from baude/newinfo
refactor info
Diffstat (limited to 'pkg/bindings/system/info.go')
-rw-r--r-- | pkg/bindings/system/info.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/pkg/bindings/system/info.go b/pkg/bindings/system/info.go new file mode 100644 index 000000000..f8269cfd8 --- /dev/null +++ b/pkg/bindings/system/info.go @@ -0,0 +1,23 @@ +package system + +import ( + "context" + "net/http" + + "github.com/containers/libpod/libpod/define" + "github.com/containers/libpod/pkg/bindings" +) + +// Info returns information about the libpod environment and its stores +func Info(ctx context.Context) (define.Info, error) { + info := define.Info{} + conn, err := bindings.GetClient(ctx) + if err != nil { + return info, err + } + response, err := conn.DoRequest(nil, http.MethodGet, "/info", nil) + if err != nil { + return info, err + } + return info, response.Process(&info) +} |