/** * @param container * @throws DockerJSONException */ public void stopContainer(DockerContainer container) throws DockerJSONException { try { logger.info("The client attempts to stop a container..."); DockerResponse dockerResponse = driver.stop(container); handleDockerAPIError(dockerResponse); } catch (FatalDockerJSONException e) { throw new DockerJSONException(e.getMessage(), e); } }
/** * @param container * @throws DockerJSONException */ public void createContainer(DockerContainer container) throws DockerJSONException { try { logger.info("The client attempts to create a container..."); DockerResponse dockerResponse = driver.create(container); handleDockerAPIError(dockerResponse); } catch (FatalDockerJSONException e) { throw new DockerJSONException(e.getMessage(), e); } }
/** * @param container * @throws DockerJSONException */ public void startContainer(DockerContainer container) throws DockerJSONException { try { logger.info("The client attempts to start a container..."); DockerResponse dockerResponse = driver.start(container); handleDockerAPIError(dockerResponse); } catch (FatalDockerJSONException e) { throw new DockerJSONException(e.getMessage(), e); } }
public DockerResponse findVolume(String name) throws DockerJSONException { DockerResponse dockerResponse = null; try { logger.info("The client attempts to find a volume..."); Volume volume = new Volume(); volume.setName(name); dockerResponse = driver.findVolume(volume); handleDockerAPIError(dockerResponse); } catch (FatalDockerJSONException e) { throw new DockerJSONException(e.getMessage(), e); } return dockerResponse; }
/** * @param container * @return * @throws DockerJSONException */ public DockerResponse removeContainer(DockerContainer container) throws DockerJSONException { DockerResponse dockerResponse = null; try { logger.info("The client attempts to remove a container..."); dockerResponse = driver.remove(container); handleDockerAPIError(dockerResponse); } catch (FatalDockerJSONException e) { throw new DockerJSONException(e.getMessage(), e); } return dockerResponse; }
public DockerResponse removeVolume(String name) throws DockerJSONException { DockerResponse dockerResponse = null; try { logger.info("The client attempts to find a volume..."); Volume volume = new Volume(); volume.setName(name); dockerResponse = driver.removeVolume(volume); handleDockerAPIError(dockerResponse); } catch (FatalDockerJSONException e) { throw new DockerJSONException(e.getMessage(), e); } return dockerResponse; }
public DockerResponse removeNetwork(String id) throws DockerJSONException { DockerResponse dockerResponse = null; try { logger.info("The client attempts to remove a network..."); Network network = new Network(); network.setId(id); dockerResponse = driver.removeNetwork(network); handleDockerAPIError(dockerResponse); } catch (FatalDockerJSONException e) { throw new DockerJSONException(e.getMessage(), e); } return dockerResponse; }
/** * @param container * @return * @throws DockerJSONException */ public DockerResponse killContainer(DockerContainer container) throws DockerJSONException { DockerResponse dockerResponse = null; try { logger.info("The client attempts to kill a container..."); dockerResponse = driver.kill(container); handleDockerAPIError(dockerResponse); } catch (FatalDockerJSONException e) { throw new DockerJSONException(e.getMessage(), e); } return dockerResponse; }
public Image findAnImage(Image image) throws DockerJSONException { DockerResponse dockerResponse = null; try { logger.info("The client attempts to find an image..."); dockerResponse = driver.findAnImage(image); handleDockerAPIError(dockerResponse); image = objectMapper.readValue(dockerResponse.getBody(), Image.class); } catch (FatalDockerJSONException | IOException e) { throw new DockerJSONException(e.getMessage(), e); } return image; }
@BeforeClass public static void setupClass() { DOCKER_HOST = "cloudunit.dev:4243"; dockerCloudUnitClient = new DockerCloudUnitClient(); dockerCloudUnitClient.setDriver(new SimpleDockerDriver(false, "http", DOCKER_HOST, null)); }
/** * @param container * @throws DockerJSONException */ public void createContainer(DockerContainer container) throws DockerJSONException { try { logger.info("The client attempts to create a container..."); DockerResponse dockerResponse = driver.create(container); handleDockerAPIError(dockerResponse); } catch (FatalDockerJSONException e) { throw new DockerJSONException(e.getMessage(), e); } }
/** * @param container * @throws DockerJSONException */ public void stopContainer(DockerContainer container) throws DockerJSONException { try { logger.info("The client attempts to stop a container..."); DockerResponse dockerResponse = driver.stop(container); handleDockerAPIError(dockerResponse); } catch (FatalDockerJSONException e) { throw new DockerJSONException(e.getMessage(), e); } }
/** * @param container * @throws DockerJSONException */ public void startContainer(DockerContainer container) throws DockerJSONException { try { logger.info("The client attempts to start a container..."); DockerResponse dockerResponse = driver.start(container); handleDockerAPIError(dockerResponse); } catch (FatalDockerJSONException e) { throw new DockerJSONException(e.getMessage(), e); } }
public DockerResponse findVolume(String name) throws DockerJSONException { DockerResponse dockerResponse = null; try { logger.info("The client attempts to find a volume..."); Volume volume = new Volume(); volume.setName(name); dockerResponse = driver.findVolume(volume); handleDockerAPIError(dockerResponse); } catch (FatalDockerJSONException e) { throw new DockerJSONException(e.getMessage(), e); } return dockerResponse; }
/** * @param container * @return * @throws DockerJSONException */ public DockerResponse removeContainer(DockerContainer container) throws DockerJSONException { DockerResponse dockerResponse = null; try { logger.info("The client attempts to remove a container..."); dockerResponse = driver.remove(container); handleDockerAPIError(dockerResponse); } catch (FatalDockerJSONException e) { throw new DockerJSONException(e.getMessage(), e); } return dockerResponse; }
public DockerResponse removeVolume(String name) throws DockerJSONException { DockerResponse dockerResponse = null; try { logger.info("The client attempts to find a volume..."); Volume volume = new Volume(); volume.setName(name); dockerResponse = driver.removeVolume(volume); handleDockerAPIError(dockerResponse); } catch (FatalDockerJSONException e) { throw new DockerJSONException(e.getMessage(), e); } return dockerResponse; }
public DockerResponse removeNetwork(String id) throws DockerJSONException { DockerResponse dockerResponse = null; try { logger.info("The client attempts to remove a network..."); Network network = new Network(); network.setId(id); dockerResponse = driver.removeNetwork(network); handleDockerAPIError(dockerResponse); } catch (FatalDockerJSONException e) { throw new DockerJSONException(e.getMessage(), e); } return dockerResponse; }
@BeforeClass public static void setupClass() { DOCKER_HOST = "cloudunit.dev:4243"; dockerCloudUnitClient = new DockerCloudUnitClient(); dockerCloudUnitClient.setDriver(new SimpleDockerDriver(false, "http", DOCKER_HOST, null)); }
/** * @param container * @param host * @throws DockerJSONException */ public void createContainer(DockerContainer container, String host) throws DockerJSONException { try { logger.info("The client attempts to create a container..."); DockerResponse dockerResponse = driver.create(container); handleDockerAPIError(dockerResponse); } catch (FatalDockerJSONException e) { throw new DockerJSONException(e.getMessage(), e); } }
/** * @param container * @param host * @throws DockerJSONException */ public void createContainer(DockerContainer container, String host) throws DockerJSONException { try { logger.info("The client attempts to create a container..."); DockerResponse dockerResponse = driver.create(container); handleDockerAPIError(dockerResponse); } catch (FatalDockerJSONException e) { throw new DockerJSONException(e.getMessage(), e); } }