Skip to content

Commit

Permalink
fix: remove agent dependcy
Browse files Browse the repository at this point in the history
  • Loading branch information
luohoufu committed Dec 4, 2024
1 parent c000f00 commit a60875a
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions modules/elastic/api/test_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)

}

0 comments on commit a60875a

Please sign in to comment.