From a60875a5f79d9606ac9d37e1f065f32d852732ce Mon Sep 17 00:00:00 2001 From: luohoufu Date: Wed, 4 Dec 2024 16:52:59 +0800 Subject: [PATCH] fix: remove agent dependcy --- modules/elastic/api/test_connection.go | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/modules/elastic/api/test_connection.go b/modules/elastic/api/test_connection.go index 3b76e8f6..a1455342 100644 --- a/modules/elastic/api/test_connection.go +++ b/modules/elastic/api/test_connection.go @@ -30,7 +30,6 @@ package api import ( "fmt" "github.com/segmentio/encoding/json" - util2 "infini.sh/agent/lib/util" "infini.sh/console/core" "infini.sh/framework/core/api" httprouter "infini.sh/framework/core/api/router" @@ -165,21 +164,6 @@ func (h TestAPI) HandleTestConnectionAction(w http.ResponseWriter, req *http.Req resBody["number_of_data_nodes"] = healthInfo.NumberOf_data_nodes resBody["active_shards"] = healthInfo.ActiveShards - //fetch local node's info - nodeID, nodeInfo, err := util2.GetLocalNodeInfo(config.GetAnyEndpoint(), config.BasicAuth) - if err != nil { - resBody["error"] = fmt.Sprintf("error on decode cluster health info : %v", err) - h.WriteJSON(w, resBody, http.StatusInternalServerError) - return - } - - resBody["status"] = healthInfo.Status - resBody["number_of_nodes"] = healthInfo.NumberOfNodes - resBody["number_of_data_nodes"] = healthInfo.NumberOf_data_nodes - resBody["active_shards"] = healthInfo.ActiveShards - resBody["node_uuid"] = nodeID - resBody["node_info"] = nodeInfo - h.WriteJSON(w, resBody, http.StatusOK) }