summaryrefslogtreecommitdiff
path: root/pkg/bindings/system/system.go
diff options
context:
space:
mode:
authorSujil02 <sushah@redhat.com>2020-05-05 22:29:54 -0400
committerSujil02 <sushah@redhat.com>2020-05-11 17:03:32 -0400
commit1c6ae73a898222a14b98526339d9985c51f88d35 (patch)
tree0abf9eebf0625817cf92b77e03348543402d96b3 /pkg/bindings/system/system.go
parentdc7d6f4818f4b986cfd15208d53f6765d8fad986 (diff)
downloadpodman-1c6ae73a898222a14b98526339d9985c51f88d35.tar.gz
podman-1c6ae73a898222a14b98526339d9985c51f88d35.tar.bz2
podman-1c6ae73a898222a14b98526339d9985c51f88d35.zip
Adds tunnel routes for system reset.
Adds tunnel routes for system reset. Makes forces flag local as options are not propogated down the stack. Adds relevant test cases and swagger docs. Signed-off-by: Sujil02 <sushah@redhat.com>
Diffstat (limited to 'pkg/bindings/system/system.go')
-rw-r--r--pkg/bindings/system/system.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg/bindings/system/system.go b/pkg/bindings/system/system.go
index caef6af6f..f1c40cd75 100644
--- a/pkg/bindings/system/system.go
+++ b/pkg/bindings/system/system.go
@@ -121,3 +121,16 @@ func Version(ctx context.Context) (*entities.SystemVersionReport, error) {
}
return &report, err
}
+
+// Reset removes all unused system data.
+func Reset(ctx context.Context) error {
+ conn, err := bindings.GetClient(ctx)
+ if err != nil {
+ return err
+ }
+ response, err := conn.DoRequest(nil, http.MethodPost, "/system/reset", nil)
+ if err != nil {
+ return err
+ }
+ return response.Process(response)
+}