@Test @Ignore("Need a running Docker daemon") public void testDockerVersion() throws Exception { Version version = dockerClient.version(); System.out.println("Version:"); System.out.println("\tAPI version: " + version.getApiVersion()); System.out.println("\tArch: " + version.getArch()); System.out.println("\tBuild Time: " + version.getBuildTime()); System.out.println("\tExperimental: " + version.getExperimental()); System.out.println("\tGit Commit: " + version.getGitCommit()); System.out.println("\tGo Version: " + version.getGoVersion()); System.out.println("\tKernel Version: " + version.getKernelVersion()); System.out.println("\tOS: " + version.getOs()); System.out.println("\tVersion: " + version.getVersion()); }
public Version version() throws Exception { URL dockerUrl = new URL(this.url + "/version"); HttpURLConnection connection = (HttpURLConnection) dockerUrl.openConnection(); connection.setRequestMethod("GET"); Version version = mapper.readValue(connection.getInputStream(), Version.class); return version; }
DockerClient { public Version version() throws Exception { URL dockerUrl = new URL(this.url + "/version"); HttpURLConnection connection = (HttpURLConnection) dockerUrl.openConnection(); connection.setRequestMethod("GET"); Version version = mapper.readValue(connection.getInputStream(), Version.class); return version; } }
DockerClient { public Version version() throws Exception { URL dockerUrl = new URL(this.url + "/version"); HttpURLConnection connection = (HttpURLConnection) dockerUrl.openConnection(); connection.setRequestMethod("GET"); Version version = mapper.readValue(connection.getInputStream(), Version.class); return version; } DockerClient(String url); }
DockerClient { public Version version() throws Exception { URL dockerUrl = new URL(this.url + "/version"); HttpURLConnection connection = (HttpURLConnection) dockerUrl.openConnection(); connection.setRequestMethod("GET"); Version version = mapper.readValue(connection.getInputStream(), Version.class); return version; } 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 Version version() throws Exception { URL dockerUrl = new URL(this.url + "/version"); HttpURLConnection connection = (HttpURLConnection) dockerUrl.openConnection(); connection.setRequestMethod("GET"); Version version = mapper.readValue(connection.getInputStream(), Version.class); return version; } 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; }