@Test @Ignore("Need a running Docker daemon") public void testDockerInfo() throws Exception { Info info = dockerClient.info(); System.out.println("Info:"); System.out.println("\tDriver: " + info.getDriver()); System.out.println("\tDriver Status: " + info.getDriverStatus()); System.out.println("\tExecution Driver: " + info.getExecutionDriver()); System.out.println("\tIndex Server Address: " + info.getIndexServerAddress()); System.out.println("\tInit Path: " + info.getInitPath()); System.out.println("\tInit SHA1: " + info.getInitSha1()); System.out.println("\tKernel Version: " + info.getKernelVersion()); System.out.println("\tContainers: " + info.getContainers()); System.out.println("\tImages: " + info.getImages()); System.out.println("\tNFD: " + info.getNfd()); System.out.println("\tNGoRoutines: " + info.getNgoroutines()); System.out.println("\tMemory Limit enabled: " + info.isMemoryLimit()); System.out.println("\tSwap Limit enabled: " + info.isSwapLimit()); }
public Info info() throws Exception { URL dockerUrl = new URL(this.url + "/info"); HttpURLConnection connection = (HttpURLConnection) dockerUrl.openConnection(); connection.setRequestMethod("GET"); Info info = mapper.readValue(connection.getInputStream(), Info.class); return info; }
DockerClient { public Info info() throws Exception { URL dockerUrl = new URL(this.url + "/info"); HttpURLConnection connection = (HttpURLConnection) dockerUrl.openConnection(); connection.setRequestMethod("GET"); Info info = mapper.readValue(connection.getInputStream(), Info.class); return info; } }
DockerClient { public Info info() throws Exception { URL dockerUrl = new URL(this.url + "/info"); HttpURLConnection connection = (HttpURLConnection) dockerUrl.openConnection(); connection.setRequestMethod("GET"); Info info = mapper.readValue(connection.getInputStream(), Info.class); return info; } DockerClient(String url); }
DockerClient { public Info info() throws Exception { URL dockerUrl = new URL(this.url + "/info"); HttpURLConnection connection = (HttpURLConnection) dockerUrl.openConnection(); connection.setRequestMethod("GET"); Info info = mapper.readValue(connection.getInputStream(), Info.class); return info; } DockerClient(String url); Info info(); Version version(); List<Container> ps(boolean showAll); Container inspect(String id); Top top(String id); void create(ContainerConfig config, String name); void rm(String id, boolean removeVolumes, boolean force); void start(String id); void stop(String id, int timeToWait); void restart(String id, int timeToWait); void kill(String id, String signal); void rename(String id, String name); void pause(String id); void unpause(String id); String logs(String id, boolean stdout, boolean stderr, boolean timestamps, boolean details); void commit(String container, ContainerConfig config, String message, String repo, String tag); List<Image> images(boolean showAll); void pull(String name, String tag, boolean verbose); void push(String name, String tag, boolean verbose); void tag(String name, String repo, String tag); void rmi(String name, boolean force, boolean noprune); List<ImageSearch> search(String term); Image getImage(String name); List<ImageHistory> history(String name); }
DockerClient { public Info info() throws Exception { URL dockerUrl = new URL(this.url + "/info"); HttpURLConnection connection = (HttpURLConnection) dockerUrl.openConnection(); connection.setRequestMethod("GET"); Info info = mapper.readValue(connection.getInputStream(), Info.class); return info; } DockerClient(String url); Info info(); Version version(); List<Container> ps(boolean showAll); Container inspect(String id); Top top(String id); void create(ContainerConfig config, String name); void rm(String id, boolean removeVolumes, boolean force); void start(String id); void stop(String id, int timeToWait); void restart(String id, int timeToWait); void kill(String id, String signal); void rename(String id, String name); void pause(String id); void unpause(String id); String logs(String id, boolean stdout, boolean stderr, boolean timestamps, boolean details); void commit(String container, ContainerConfig config, String message, String repo, String tag); List<Image> images(boolean showAll); void pull(String name, String tag, boolean verbose); void push(String name, String tag, boolean verbose); void tag(String name, String repo, String tag); void rmi(String name, boolean force, boolean noprune); List<ImageSearch> search(String term); Image getImage(String name); List<ImageHistory> history(String name); static final String DEFAULT_URL; }