public Map<AgentInstance, Collection<String>> agentEnvironmentMap() { Map<AgentInstance, Collection<String>> allAgents = new LinkedHashMap<>(); for (AgentInstance agentInstance : agentInstances.allAgents()) { allAgents.put(agentInstance, environmentConfigService.environmentsFor(agentInstance.getUuid())); } return allAgents; }
private AgentViewModel toAgentViewModel(AgentInstance instance) { return new AgentViewModel(instance, environmentConfigService.environmentsFor(instance.getUuid())); }
@Override public Consumer<OutputWriter> jsonWriter(AgentInstance agentInstance) { return outputWriter -> AgentRepresenter.toJSON(outputWriter, agentInstance, environmentConfigService.environmentsFor(agentInstance.getUuid()), securityService, currentUsername()); }
public String show(Request request, Response response) throws IOException { final AgentInstance agentInstance = fetchEntityFromConfig(request.params("uuid")); return writerForTopLevelObject(request, response, outputWriter -> AgentRepresenter.toJSON(outputWriter, agentInstance, environmentConfigService.environmentsFor(request.params("uuid")), securityService, currentUsername())); }