summaryrefslogtreecommitdiff
path: root/pkg/bindings/system/system.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/bindings/system/system.go')
-rw-r--r--pkg/bindings/system/system.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/pkg/bindings/system/system.go b/pkg/bindings/system/system.go
index f1c40cd75..e567e7a86 100644
--- a/pkg/bindings/system/system.go
+++ b/pkg/bindings/system/system.go
@@ -134,3 +134,18 @@ func Reset(ctx context.Context) error {
}
return response.Process(response)
}
+
+// DiskUsage returns information about image, container, and volume disk
+// consumption
+func DiskUsage(ctx context.Context) (*entities.SystemDfReport, error) {
+ var report entities.SystemDfReport
+ conn, err := bindings.GetClient(ctx)
+ if err != nil {
+ return nil, err
+ }
+ response, err := conn.DoRequest(nil, http.MethodGet, "/system/df", nil)
+ if err != nil {
+ return nil, err
+ }
+ return &report, response.Process(&report)
+}