github.com/containers/podman/v2@v2.2.2-0.20210501105131-c1e07d070c4c/pkg/api/handlers/compat/changes.go (about)

     1  package compat
     2  
     3  import (
     4  	"net/http"
     5  
     6  	"github.com/containers/podman/v2/libpod"
     7  	"github.com/containers/podman/v2/pkg/api/handlers/utils"
     8  )
     9  
    10  func Changes(w http.ResponseWriter, r *http.Request) {
    11  	runtime := r.Context().Value("runtime").(*libpod.Runtime)
    12  
    13  	id := utils.GetName(r)
    14  	changes, err := runtime.GetDiff("", id)
    15  	if err != nil {
    16  		utils.InternalServerError(w, err)
    17  		return
    18  	}
    19  	utils.WriteJSON(w, 200, changes)
    20  }