update cluster search api

This commit is contained in:
medcl 2021-02-20 16:13:10 +08:00
parent a48ea8d4c1
commit 523ba2fbec
2 changed files with 2 additions and 2 deletions

View File

@ -55,5 +55,5 @@ func Init(cfg *config.AppConfig) {
ui.HandleUIMethod(api.POST, pathPrefix + "system/cluster", shdl.HandleCreateClusterAction)
ui.HandleUIMethod(api.PUT, pathPrefix + "system/cluster/:id", shdl.HandleUpdateClusterAction)
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)
}

View File

@ -137,7 +137,7 @@ func (h *APIHandler) HandleSearchClusterAction(w http.ResponseWriter, req *http.
res, err := esClient.SearchWithRawQueryDSL(orm.GetIndexName(model.ClusterConfig{}), []byte(queryDSL))
if err != nil {
resBody["error"] = err.Error()
h.WriteJSON(w, resBody, http.StatusOK)
h.WriteJSON(w, resBody, http.StatusInternalServerError)
return
}