MCPcopy Create free account
hub / github.com/actiontech/dtle / NodeListV2

Function NodeListV2

api/handler/v2/node.go:22–33  ·  view source on GitHub ↗

@Id NodeListV2 @Description get node list. @Tags node @Security ApiKeyAuth @Success 200 {object} models.NodeListRespV2 @Router /v2/nodes [get]

(c echo.Context)

Source from the content-addressed store, hash-verified

20// @Success 200 {object} models.NodeListRespV2
21// @Router /v2/nodes [get]
22func NodeListV2(c echo.Context) error {
23 logger := handler.NewLogger().Named("NodeListV2")
24 nodes, err := FindNomadNodes(logger)
25 if nil != err {
26 return c.JSON(http.StatusInternalServerError, models.BuildBaseResp(fmt.Errorf("invoke nomad api failed: %v", err)))
27 }
28
29 return c.JSON(http.StatusOK, &models.NodeListRespV2{
30 Nodes: nodes,
31 BaseResp: models.BuildBaseResp(nil),
32 })
33}
34
35func FindNomadNodes(logger g.LoggerType) ([]models.NodeListItemV2, error) {
36 logger.Info("invoke nomad api begin : nodesUrl")

Callers

nothing calls this directly

Calls 3

NewLoggerFunction · 0.92
BuildBaseRespFunction · 0.92
FindNomadNodesFunction · 0.85

Tested by

no test coverage detected