diff options
author | Jhon Honce <jhonce@redhat.com> | 2020-04-06 16:40:32 -0700 |
---|---|---|
committer | Jhon Honce <jhonce@redhat.com> | 2020-04-07 09:39:46 -0700 |
commit | 8ae28a55acc51a02597b23140916a690fbbdc3fc (patch) | |
tree | 735d876be3204dcd54c7e739083cc706dec83101 /pkg/api/handlers/compat/changes.go | |
parent | 44f910c28cae178eab9ad439587355fa4927dab7 (diff) | |
download | podman-8ae28a55acc51a02597b23140916a690fbbdc3fc.tar.gz podman-8ae28a55acc51a02597b23140916a690fbbdc3fc.tar.bz2 podman-8ae28a55acc51a02597b23140916a690fbbdc3fc.zip |
V2 podman diff(changes) support
* Ported CLI command
* Added API endpoint
* Added bindings
* Updated swagger (TODO: n endpoints, one handler)
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'pkg/api/handlers/compat/changes.go')
-rw-r--r-- | pkg/api/handlers/compat/changes.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/pkg/api/handlers/compat/changes.go b/pkg/api/handlers/compat/changes.go new file mode 100644 index 000000000..6907c487e --- /dev/null +++ b/pkg/api/handlers/compat/changes.go @@ -0,0 +1,20 @@ +package compat + +import ( + "net/http" + + "github.com/containers/libpod/libpod" + "github.com/containers/libpod/pkg/api/handlers/utils" +) + +func Changes(w http.ResponseWriter, r *http.Request) { + runtime := r.Context().Value("runtime").(*libpod.Runtime) + + id := utils.GetName(r) + changes, err := runtime.GetDiff("", id) + if err != nil { + utils.InternalServerError(w, err) + return + } + utils.WriteJSON(w, 200, changes) +} |