github.com/containers/podman/v2@v2.2.2-0.20210501105131-c1e07d070c4c/pkg/api/handlers/compat/containers_unpause.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 UnpauseContainer(w http.ResponseWriter, r *http.Request) { 11 runtime := r.Context().Value("runtime").(*libpod.Runtime) 12 13 // /{version}/containers/(name)/unpause 14 name := utils.GetName(r) 15 con, err := runtime.LookupContainer(name) 16 if err != nil { 17 utils.ContainerNotFound(w, name, err) 18 return 19 } 20 21 if err := con.Unpause(); err != nil { 22 utils.InternalServerError(w, err) 23 return 24 } 25 26 // Success 27 utils.WriteResponse(w, http.StatusNoContent, "") 28 }