Package org.jclouds.docker.features
Interface ContainerApi
-
@Consumes("application/json") @Path("/v{jclouds.api-version}") public interface ContainerApi
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description InputStream
attach(String containerId)
InputStream
attach(String containerId, AttachOptions options)
Image
commit()
Create a new image from a container’s changesImage
commit(CommitOptions options)
Create a new image from a container’s changesInputStream
copy(String containerId, Resource resource)
Container
createContainer(String name, Config config)
Container
inspectContainer(String containerId)
Return low-level information on the container idvoid
kill(String containerId)
void
kill(String containerId, int signal)
void
kill(String containerId, String signal)
List<ContainerSummary>
listContainers()
List<ContainerSummary>
listContainers(ListContainerOptions options)
void
pause(String containerId)
void
removeContainer(String containerId)
void
removeContainer(String containerId, RemoveContainerOptions options)
void
restart(String containerId)
void
restart(String containerId, int secondsToWait)
void
startContainer(String containerId)
void
startContainer(String containerId, HostConfig hostConfig)
void
stopContainer(String containerId)
void
stopContainer(String containerId, int secondsToWait)
void
unpause(String containerId)
StatusCode
wait(String containerId)
Block until container @param containerId stops, then returns the exit code
-
-
-
Method Detail
-
listContainers
@Named("containers:list") @GET @Path("/containers/json") List<ContainerSummary> listContainers()
- Returns:
- a set of containers
-
listContainers
@Named("containers:list") @GET @Path("/containers/json") List<ContainerSummary> listContainers(ListContainerOptions options)
- Parameters:
options
- the options to list the containers (@see ListContainerOptions)- Returns:
- a set of containers
-
createContainer
@Named("container:create") @POST @Path("/containers/create") Container createContainer(@QueryParam("name") String name, Config config)
- Parameters:
name
- the name for the new container. Must match /?[a-zA-Z0-9_-]+.config
- the container’s configuration (@see BindToJsonPayload)- Returns:
- a new container
-
inspectContainer
@Named("container:inspect") @GET @Path("/containers/{id}/json") Container inspectContainer(@PathParam("id") String containerId)
Return low-level information on the container id- Parameters:
containerId
- The id of the container to get.- Returns:
- The details of the container or
null
if the container with the given id doesn't exist.
-
removeContainer
@Named("container:delete") @DELETE @Path("/containers/{id}") void removeContainer(@PathParam("id") String containerId)
- Parameters:
containerId
- The id of the container to be removed.
-
removeContainer
@Named("container:delete") @DELETE @Path("/containers/{id}") void removeContainer(@PathParam("id") String containerId, RemoveContainerOptions options)
- Parameters:
containerId
- The id of the container to be removed.options
- the operation’s configuration (@see RemoveContainerOptions)
-
startContainer
@Named("container:start") @POST @Path("/containers/{id}/start") void startContainer(@PathParam("id") String containerId)
- Parameters:
containerId
- The id of the container to be started.
-
startContainer
@Named("container:start") @POST @Path("/containers/{id}/start") void startContainer(@PathParam("id") String containerId, HostConfig hostConfig)
- Parameters:
containerId
- The id of the container to be started.hostConfig
- the container’s host configuration
-
stopContainer
@Named("container:stop") @POST @Path("/containers/{id}/stop") void stopContainer(@PathParam("id") String containerId)
- Parameters:
containerId
- The id of the container to be stopped.
-
stopContainer
@Named("container:stop") @POST @Path("/containers/{id}/stop") void stopContainer(@PathParam("id") String containerId, @QueryParam("t") int secondsToWait)
-
commit
@Named("container:commit") @POST @Path("/commit") Image commit()
Create a new image from a container’s changes- Returns:
- a new image created from the current container's status.
-
commit
@Named("container:commit") @POST @Path("/commit") Image commit(CommitOptions options)
Create a new image from a container’s changes- Parameters:
options
- the commit’s configuration (@see CommitOptions)- Returns:
- a new image created from the current container's status.
-
pause
@Named("container:pause") @POST @Path("/containers/{id}/pause") void pause(@PathParam("id") String containerId)
- Parameters:
containerId
- The id of the container to be paused.
-
unpause
@Named("container:unpause") @POST @Path("/containers/{id}/unpause") void unpause(@PathParam("id") String containerId)
- Parameters:
containerId
- The id of the container to be unpaused.
-
attach
@Named("container:attach") @POST @Path("/containers/{id}/attach") InputStream attach(@PathParam("id") String containerId)
- Parameters:
containerId
- The id of the container to be attached.
-
attach
@Named("container:attach") @POST @Path("/containers/{id}/attach") InputStream attach(@PathParam("id") String containerId, AttachOptions options)
- Parameters:
containerId
- The id of the container to be attached.options
- the attach options @see org.jclouds.docker.options.AttachOptions
-
wait
@Named("container:wait") @POST @Path("/containers/{id}/wait") StatusCode wait(@PathParam("id") String containerId)
Block until container @param containerId stops, then returns the exit code
-
restart
@Named("container:restart") @POST @Path("/containers/{id}/restart") void restart(@PathParam("id") String containerId)
- Parameters:
containerId
- restarts
-
restart
@Named("container:restart") @POST @Path("/containers/{id}/restart") void restart(@PathParam("id") String containerId, @QueryParam("t") int secondsToWait)
-
kill
@Named("container:kill") @POST @Path("/containers/{id}/kill") void kill(@PathParam("id") String containerId)
- Parameters:
containerId
- to be killed
-
kill
@Named("container:kill") @POST @Path("/containers/{id}/kill") void kill(@PathParam("id") String containerId, @QueryParam("signal") int signal)
- Parameters:
containerId
- to be killedsignal
- Signal to send to the container. When not set, SIGKILL is assumed and the call will waits for the container to exit.
-
kill
@Named("container:kill") @POST @Path("/containers/{id}/kill") void kill(@PathParam("id") String containerId, @QueryParam("signal") String signal)
- Parameters:
containerId
- to be killedsignal
- Signal string like "SIGINT" to send to the container. When not set, SIGKILL is assumed and the call will waits for the container to exit.
-
copy
@Named("container:copy") @POST @Path("/containers/{id}/copy") InputStream copy(@PathParam("id") String containerId, Resource resource)
- Parameters:
containerId
- id of the container to copy files from
-
-