Exemple #1
0
func KillContainer(w http.ResponseWriter, r *http.Request) {
	vars := mux.Vars(r)
	hostname := vars["hostname"]
	c := db.GetContainer(hostname)
	status := make(chan string)
	go manager.Kill(&c, status)
	<-status // block until the status updates
	fmt.Fprintln(w, c.Serialize())
}
Exemple #2
0
func ListContainer(w http.ResponseWriter, r *http.Request) {
	vars := mux.Vars(r)
	hostname := vars["hostname"]
	c := db.GetContainer(hostname)
	fmt.Fprintln(w, c.Serialize())
}