2020-02-21 20:59:59 +08:00
|
|
|
package controller
|
|
|
|
|
|
|
|
import (
|
2020-03-30 18:23:33 +08:00
|
|
|
"net/http"
|
|
|
|
|
2020-02-21 22:43:28 +08:00
|
|
|
"github.com/go-chi/chi"
|
2020-03-30 18:23:33 +08:00
|
|
|
|
2020-02-21 20:59:59 +08:00
|
|
|
"github.com/goodrain/rainbond/api/handler"
|
2020-03-30 18:23:33 +08:00
|
|
|
|
2020-02-21 20:59:59 +08:00
|
|
|
httputil "github.com/goodrain/rainbond/util/http"
|
|
|
|
)
|
|
|
|
|
|
|
|
//GetRunningServices list all running service ids
|
|
|
|
func GetRunningServices(w http.ResponseWriter, r *http.Request) {
|
2020-02-21 22:43:28 +08:00
|
|
|
enterpriseID := chi.URLParam(r, "enterprise_id")
|
2020-03-30 18:23:33 +08:00
|
|
|
runningList, err := handler.GetServiceManager().GetEnterpriseRunningServices(enterpriseID)
|
|
|
|
if err != nil {
|
|
|
|
err.Handle(r, w)
|
|
|
|
return
|
|
|
|
}
|
2020-02-21 20:59:59 +08:00
|
|
|
httputil.ReturnNoFomart(r, w, 200, map[string]interface{}{"service_ids": runningList})
|
|
|
|
}
|