mirror of
https://github.com/containers/podman.git
synced 2025-06-04 13:08:55 +08:00

the current implementation of info, while typed, is very loosely done so. we need stronger types for our apiv2 implmentation and bindings. Signed-off-by: Brent Baude <bbaude@redhat.com>
19 lines
390 B
Go
19 lines
390 B
Go
package libpod
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/containers/libpod/libpod"
|
|
"github.com/containers/libpod/pkg/api/handlers/utils"
|
|
)
|
|
|
|
func GetInfo(w http.ResponseWriter, r *http.Request) {
|
|
runtime := r.Context().Value("runtime").(*libpod.Runtime)
|
|
info, err := runtime.Info()
|
|
if err != nil {
|
|
utils.InternalServerError(w, err)
|
|
return
|
|
}
|
|
utils.WriteResponse(w, http.StatusOK, info)
|
|
}
|