Skip to content

Commit

Permalink
proxy cluster and agents
Browse files Browse the repository at this point in the history
  • Loading branch information
Cat-Drink committed Dec 7, 2024
1 parent c747e45 commit f0fcab4
Show file tree
Hide file tree
Showing 3 changed files with 428 additions and 256 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.apache.bigtop.manager.server.proxy;

import com.fasterxml.jackson.databind.node.ObjectNode;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
Expand Down Expand Up @@ -73,6 +74,9 @@ public JsonNode queryClusterAgentsList(String clusterId) {
JsonNode agents = result.get("data").get("content");
agents.forEach(agent -> hosts.add(agent.get("ipv4").asText()));
}
return objectMapper.createObjectNode().set("agents", objectMapper.valueToTree(hosts));
ObjectNode clusterAgents = objectMapper.createObjectNode();
clusterAgents.put("agentsNum",hosts.size());
clusterAgents.set("agents", objectMapper.valueToTree(hosts));
return clusterAgents;
}
}
Loading

0 comments on commit f0fcab4

Please sign in to comment.