Skip to content

Commit c76d2dd

Browse files
committed
Merge pull request docker-java#65 from vjuranek/ping
Add ping method
2 parents 3d84b5b + 9aa7c50 commit c76d2dd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/main/java/com/kpelykh/docker/client/DockerClient.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,19 @@ public Version version() throws DockerException {
190190
}
191191
}
192192
}
193+
194+
195+
public int ping() throws DockerException {
196+
WebResource webResource = client.resource(restEndpointUrl + "/_ping");
197+
198+
try {
199+
LOGGER.trace("GET: {}", webResource);
200+
ClientResponse resp = webResource.get(ClientResponse.class);
201+
return resp.getStatus();
202+
} catch (UniformInterfaceException exception) {
203+
throw new DockerException(exception);
204+
}
205+
}
193206

194207

195208
/**

0 commit comments

Comments
 (0)