Skip to content

Commit

Permalink
Merge pull request #136 from linkernetworks/phstsai/VX-195
Browse files Browse the repository at this point in the history
VX-195 DEV: Let get node api shows all the detail data

Former-commit-id: 56de989ac8824e04ff96cc53d34a04193bbf918a [formerly 56de989ac8824e04ff96cc53d34a04193bbf918a [formerly cc3c50c]]
Former-commit-id: 267fb63abf694341307ce385b21d383fc1cf0b40
Former-commit-id: 940bc0d
  • Loading branch information
John-Lin authored Jul 20, 2018
2 parents a930d02 + d5364a6 commit 17266c6
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/server/handler_prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,23 @@ func listNodeMetricsHandler(ctx *web.Context) {
expression := pc.Expression{}
expression.Metrics = []string{"kube_node_info"}

containerList, err := pc.ListResource(sp, "node", expression)
nodeNameList, err := pc.ListResource(sp, "node", expression)
if err != nil {
response.InternalServerError(req.Request, resp.ResponseWriter, err)
return
}

resp.WriteEntity(containerList)
nodeList := map[string]entity.NodeMetrics{}
for _, nodeName := range nodeNameList {
node, err := pc.GetNode(sp, nodeName)
if err != nil {
response.InternalServerError(req.Request, resp.ResponseWriter, err)
return
}
nodeList[nodeName] = node
}

resp.WriteEntity(nodeList)
}

func listNodeNicsMetricsHandler(ctx *web.Context) {
Expand Down

0 comments on commit 17266c6

Please sign in to comment.