public DockerRestClient getRestClient() { return DockerRestClient.forDockerClient(getDockerClient()); } }
public DockerRestClient getRestClient() { return DockerRestClient.forDockerClient(dockerScanner.getDockerClient()); }
public void scan() { WebTarget wt = SwarmScanner.extractWebTarget(getDockerClient()); JsonNode n = wt.path("/info").request().buildGet().invoke(JsonNode.class); if (n.path("Swarm").path("Cluster").isContainerNode()) { logger.info("talking to a docker swarm manager: {}",wt); SwarmScanner ss = new SwarmScanner(this); ss.scan(); } else { // looks like we are talking to a docker engine. We don't support this yet because we need to figure out // how to ensure that we do not get duplicate entries from the Swarm view of the nodes and the engine's view of itself. logger.info("talking to a docker engine: {}",wt); String engineId = n.get("ID").asText(); JsonLogger.logInfo("x", n); updateEngineInfo(n); } }
public void scan() { WebTarget t = extractWebTarget(dockerScanner.getDockerClient()); logger.info("Scanning {}", t); JsonNode response = t.path("/info").request().buildGet().invoke(JsonNode.class);
@BeforeClass public static void setupDockerScanner() { DockerScanner ds = new Projector.Builder().build().createBuilder(DockerScannerBuilder.class).withLocalDockerDaemon().build(); boolean b = ds.getNeoRxClient().checkConnection(); if (b==false) { logger.warn("neo4j is not available...integration tests will be skipped"); Assume.assumeTrue("neo4j available", b); } else { logger.info("neo4j is available for integration tests"); } try { Info info = ds.getDockerClient().infoCmd().exec(); logger.info("local docker daemon is available for integration tests"); dockerScanner = ds; } catch (Exception e) { logger.warn("neo4j is not available for integration tests",e); Assume.assumeTrue(false); return; } } }