@Path(value="/containers")
@Produces(value="application/json")
@Consumes(value="application/json")
public interface ContainersClient
| Modifier and Type | Method and Description |
|---|---|
InputStream |
attachToContainer(String id,
boolean returnLogs,
boolean returnStream,
boolean attachStdin,
boolean attachStdout,
boolean attachStderr) |
void |
copy(String id) |
ContainerCreateResponse |
createContainer(String name,
ContainerConfig config) |
Object |
exportContainer(String containerId) |
List<FileChanges> |
getFilesystemChanges(String containerId) |
ContainerInspectResponse |
inspectContainer(String id)
Inspect a container
|
String |
killContainer(String id)
Kill a container
|
List<Container> |
listContainers(boolean all,
int limit,
String since,
String before,
boolean size)
List containers
|
InputStream |
logs(String id,
boolean follow,
boolean stdout,
boolean stderr,
boolean timestamps)
Get stdout and stderr logs from the container ID
|
void |
removeContainer(String id) |
void |
removeContainer(String id,
boolean removeVolumes,
boolean force)
Remove the container ID from the filesystem
|
String |
restartContainer(String id,
Long secondsToWait) |
String |
startContainer(String id,
HostConfig hostConfig)
Start a container
|
String |
stopContainer(String id,
Long secondsToWait) |
TopResponse |
top(String containerId) |
StatusCodeResponse |
waitForContainer(String id) |
@GET @Path(value="/json") List<Container> listContainers(@QueryParam(value="all") boolean all, @QueryParam(value="limit") int limit, @DefaultValue(value="") @QueryParam(value="since") String since, @DefaultValue(value="") @QueryParam(value="before") String before, @QueryParam(value="size") boolean size)
all - 1/True/true or 0/False/false, Show all containers. Only running containers are shown by defaultlimit - Show limit last created containers, include non-running ones.since - Show only containers created since Id, include non-running ones.before - Show only containers created before Id, include non-running ones.size - 1/True/true or 0/False/false, Show the containers sizes@POST @Consumes(value="application/json") @Path(value="/create") ContainerCreateResponse createContainer(@QueryParam(value="name") String name, ContainerConfig config)
@GET
@Path(value="/{id}/json")
ContainerInspectResponse inspectContainer(@PathParam(value="id")
String id)
id - - id of the container@GET
@Path(value="/{id}/top")
TopResponse top(@PathParam(value="id")
String containerId)
@GET
@Path(value="/{id}/changes")
List<FileChanges> getFilesystemChanges(@PathParam(value="id")
String containerId)
@GET
@Path(value="/{id}/export")
Object exportContainer(@PathParam(value="id")
String containerId)
@POST
@Path(value="/{id}/start")
@Produces(value="text/plain")
String startContainer(@PathParam(value="id")
String id,
HostConfig hostConfig)
id - - the container IDhostConfig - - the container’s host configuration (optional)@POST
@Path(value="/{id}/stop")
@Produces(value="text/plain")
String stopContainer(@PathParam(value="id")
String id,
@QueryParam(value="t")
Long secondsToWait)
@POST
@Path(value="/{id}/restart")
@Produces(value="text/plain")
String restartContainer(@PathParam(value="id")
String id,
@QueryParam(value="t")
Long secondsToWait)
@POST
@Path(value="/{id}/kill")
@Produces(value="text/plain")
String killContainer(@PathParam(value="id")
String id)
id - @POST
@Path(value="/{id}/attach")
@Produces(value="application/octet-stream")
InputStream attachToContainer(@PathParam(value="id")
String id,
@QueryParam(value="logs")
boolean returnLogs,
@QueryParam(value="stream")
boolean returnStream,
@QueryParam(value="stdin")
boolean attachStdin,
@QueryParam(value="stdout")
boolean attachStdout,
@QueryParam(value="stderr")
boolean attachStderr)
@POST
@Path(value="/{id}/wait")
StatusCodeResponse waitForContainer(@PathParam(value="id")
String id)
@DELETE
@Path(value="/{id}")
@Produces(value="text/plain")
void removeContainer(@PathParam(value="id")
String id)
@DELETE
@Path(value="/{id}")
@Produces(value="text/plain")
void removeContainer(@PathParam(value="id")
String id,
@QueryParam(value="v")
boolean removeVolumes,
@QueryParam(value="force")
boolean force)
id - removeVolumes - Remove the volumes associated to the containerforce - Removes the container
even if it was running.@POST
@Path(value="/{id}/copy")
void copy(@PathParam(value="id")
String id)
@GET
@Path(value="/{id}/logs")
InputStream logs(@PathParam(value="id")
String id,
@QueryParam(value="follow")
boolean follow,
@QueryParam(value="stdout")
boolean stdout,
@QueryParam(value="stderr")
boolean stderr,
@QueryParam(value="timestamps")
boolean timestamps)
Copyright © 2014. All rights reserved.