update cluster search api
This commit is contained in:
parent
a48ea8d4c1
commit
523ba2fbec
|
@ -55,5 +55,5 @@ func Init(cfg *config.AppConfig) {
|
||||||
ui.HandleUIMethod(api.POST, pathPrefix + "system/cluster", shdl.HandleCreateClusterAction)
|
ui.HandleUIMethod(api.POST, pathPrefix + "system/cluster", shdl.HandleCreateClusterAction)
|
||||||
ui.HandleUIMethod(api.PUT, pathPrefix + "system/cluster/:id", shdl.HandleUpdateClusterAction)
|
ui.HandleUIMethod(api.PUT, pathPrefix + "system/cluster/:id", shdl.HandleUpdateClusterAction)
|
||||||
ui.HandleUIMethod(api.DELETE, pathPrefix + "system/cluster/:id", shdl.HandleDeleteClusterAction)
|
ui.HandleUIMethod(api.DELETE, pathPrefix + "system/cluster/:id", shdl.HandleDeleteClusterAction)
|
||||||
ui.HandleUIMethod(api.GET, pathPrefix + "system/cluster", shdl.HandleSearchClusterAction)
|
ui.HandleUIMethod(api.GET, pathPrefix + "system/cluster/_search", shdl.HandleSearchClusterAction)
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,7 +137,7 @@ func (h *APIHandler) HandleSearchClusterAction(w http.ResponseWriter, req *http.
|
||||||
res, err := esClient.SearchWithRawQueryDSL(orm.GetIndexName(model.ClusterConfig{}), []byte(queryDSL))
|
res, err := esClient.SearchWithRawQueryDSL(orm.GetIndexName(model.ClusterConfig{}), []byte(queryDSL))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
resBody["error"] = err.Error()
|
resBody["error"] = err.Error()
|
||||||
h.WriteJSON(w, resBody, http.StatusOK)
|
h.WriteJSON(w, resBody, http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue