Interface ContainerApi


  • @Consumes("application/json")
    @Path("/v{jclouds.api-version}")
    public interface ContainerApi
    • 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 killed
        signal - 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 killed
        signal - 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