summaryrefslogtreecommitdiff
path: root/pkg/api/handlers
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-05-12 09:05:03 -0700
committerGitHub <noreply@github.com>2020-05-12 09:05:03 -0700
commit38c4b9bcc0296a1fe7efc5bb6058e8aaa5ecae6f (patch)
tree7964cf7e1dd1ed54c58bd7b30dcd80bbdbfcc752 /pkg/api/handlers
parentd6d94cfdd7104c036e7def993f22abb962c5762a (diff)
parent03c29c357fb21d69ed878dcfea29f99c7a369f25 (diff)
downloadpodman-38c4b9bcc0296a1fe7efc5bb6058e8aaa5ecae6f.tar.gz
podman-38c4b9bcc0296a1fe7efc5bb6058e8aaa5ecae6f.tar.bz2
podman-38c4b9bcc0296a1fe7efc5bb6058e8aaa5ecae6f.zip
Merge pull request #6182 from baude/v2remotedf
add podman remote system df
Diffstat (limited to 'pkg/api/handlers')
-rw-r--r--pkg/api/handlers/libpod/system.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg/api/handlers/libpod/system.go b/pkg/api/handlers/libpod/system.go
index 72a38db63..81ed37b4a 100644
--- a/pkg/api/handlers/libpod/system.go
+++ b/pkg/api/handlers/libpod/system.go
@@ -7,6 +7,7 @@ import (
"github.com/containers/libpod/pkg/api/handlers/compat"
"github.com/containers/libpod/pkg/api/handlers/utils"
"github.com/containers/libpod/pkg/domain/entities"
+ "github.com/containers/libpod/pkg/domain/infra/abi"
"github.com/gorilla/schema"
"github.com/pkg/errors"
)
@@ -79,3 +80,15 @@ func SystemReset(w http.ResponseWriter, r *http.Request) {
}
utils.WriteResponse(w, http.StatusOK, nil)
}
+
+func DiskUsage(w http.ResponseWriter, r *http.Request) {
+ // Options are only used by the CLI
+ options := entities.SystemDfOptions{}
+ runtime := r.Context().Value("runtime").(*libpod.Runtime)
+ ic := abi.ContainerEngine{Libpod: runtime}
+ response, err := ic.SystemDf(r.Context(), options)
+ if err != nil {
+ utils.InternalServerError(w, err)
+ }
+ utils.WriteResponse(w, http.StatusOK, response)
+}