/** * @return * @throws DockerJSONException */ public List<DockerContainer> findAllContainers() throws DockerJSONException { List<DockerContainer> containers = null; try { logger.info("The client attempts to list all containers..."); DockerResponse dockerResponse = driver.findAll(); handleDockerAPIError(dockerResponse); containers = objectMapper.readValue(dockerResponse.getBody(), new TypeReference<List<DockerContainer>>() { }); } catch (FatalDockerJSONException | IOException e) { throw new DockerJSONException(e.getMessage(), e); } return containers; }
/** * @return * @throws DockerJSONException */ public List<DockerContainer> findAllContainers() throws DockerJSONException { List<DockerContainer> containers = null; try { logger.info("The client attempts to list all containers..."); DockerResponse dockerResponse = driver.findAll(); handleDockerAPIError(dockerResponse); containers = objectMapper.readValue(dockerResponse.getBody(), new TypeReference<List<DockerContainer>>() { }); } catch (FatalDockerJSONException | IOException e) { throw new DockerJSONException(e.getMessage(), e); } return containers; }
/** * @param host * @return * @throws DockerJSONException */ public List<DockerContainer> findAllContainers(String host) throws DockerJSONException { List<DockerContainer> containers = null; try { logger.info("The client attempts to list all containers..."); DockerResponse dockerResponse = driver.findAll(); handleDockerAPIError(dockerResponse); containers = objectMapper.readValue(dockerResponse.getBody(), new TypeReference<List<DockerContainer>>() { }); } catch (FatalDockerJSONException | IOException e) { throw new DockerJSONException(e.getMessage(), e); } return containers; }
/** * @param host * @return * @throws DockerJSONException */ public List<DockerContainer> findAllContainers(String host) throws DockerJSONException { List<DockerContainer> containers = null; try { logger.info("The client attempts to list all containers..."); DockerResponse dockerResponse = driver.findAll(); handleDockerAPIError(dockerResponse); containers = objectMapper.readValue(dockerResponse.getBody(), new TypeReference<List<DockerContainer>>() { }); } catch (FatalDockerJSONException | IOException e) { throw new DockerJSONException(e.getMessage(), e); } return containers; }