@Override protected void doExecute() { IpAddress nodeIp = get(ClusterService.class).getLocalNode().ip(); Version version = get(CoreService.class).version(); long numNodes = activeNodes(get(ClusterService.class).getNodes()); int numDevices = get(DeviceService.class).getDeviceCount(); int numLinks = get(LinkService.class).getLinkCount(); int numHosts = get(HostService.class).getHostCount(); int numScc = get(TopologyService.class).currentTopology().clusterCount(); int numFlows = get(FlowRuleService.class).getFlowRuleCount(); long numIntents = get(IntentService.class).getIntentCount(); String clusterId = get(ClusterMetadataService.class).getClusterMetadata().getName(); if (outputJson()) { print("%s", new ObjectMapper().createObjectNode() .put("node", nodeIp.toString()) .put("version", version.toString()) .put("clusterId", clusterId) .put("nodes", numNodes) .put("devices", numDevices) .put("links", numLinks) .put("hosts", numHosts) .put("SCC(s)", numScc) .put("flows", numFlows) .put("intents", numIntents)); } else { print("node=%s, version=%s clusterId=%s", nodeIp, version, clusterId); print("nodes=%d, devices=%d, links=%d, hosts=%d, SCC(s)=%s, flows=%d, intents=%d", numNodes, numDevices, numLinks, numHosts, numScc, numFlows, numIntents); } }