func installHostInfo(w http.ResponseWriter, r *http.Request, t auth.Token) error {
	allowed := permission.Check(t, permission.PermInstallManage)
	if !allowed {
		return permission.ErrUnauthorized
	}
	host, err := install.GetHostByName(r.URL.Query().Get(":name"))
	if errNf, ok := err.(*install.ErrHostNotFound); ok {
		return &errors.HTTP{Code: http.StatusNotFound, Message: fmt.Sprintf("Host %s not found.", errNf.Name)}
	}
	if err != nil {
		return err
	}
	w.Header().Set("Content-Type", "application/json")
	return json.NewEncoder(w).Encode(&host)
}
func installHostInfo(w http.ResponseWriter, r *http.Request, t auth.Token) error {
	allowed := permission.Check(t, permission.PermInstallManage)
	if !allowed {
		return permission.ErrUnauthorized
	}
	host, err := install.GetHostByName(r.URL.Query().Get(":name"))
	if errNf, ok := err.(*install.ErrHostNotFound); ok {
		return &errors.HTTP{Code: http.StatusNotFound, Message: fmt.Sprintf("Host %s not found.", errNf.Name)}
	}
	if err != nil {
		return err
	}
	w.Header().Set("Content-Type", "application/json")
	return json.NewEncoder(w).Encode(&host)
}
func installHostInfo ( w http . ResponseWriter , r * http . Request , t auth . Token ) error { allowed := permission . Check ( t , permission . PermInstallManage ) if ! allowed { return permission . ErrUnauthorized } host , err := install . GetHostByName ( r . URL . Query ( ) . Get ( " " ) ) if errNf , ok := err . ( * install . ErrHostNotFound ) ; ok { return & errors . HTTP { Code : http . StatusNotFound , Message : fmt . Sprintf ( " " , errNf . Name ) } } if err != nil { return err } w . Header ( ) . Set ( " " , " " ) return json . NewEncoder ( w ) . Encode ( & host ) }
// title: install host info
// path: /install/hosts/{name}
// method: GET
// produce: application/json
// responses:
//   200: OK
//   401: Unauthorized
//   404: Not Found
title : install host info path : / install / hosts / { name } method : GET produce : application / json responses : 200 : OK 401 : Unauthorized 404 : Not Found