github.com/containers/libpod@v1.9.4-0.20220419124438-4284fd425507/pkg/api/handlers/compat/changes.go (about)

     1  package compat
     2  
     3  import (
     4  	"net/http"
     5  
     6  	"github.com/containers/libpod/libpod"
     7  	"github.com/containers/libpod/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  }