public interface ContainerManager
| Modifier and Type | Field and Description |
|---|---|
static String |
LABEL_PARENT
Label that denotes container parent
|
static String |
LABEL_TYPE
Label that denotes container type
|
| Modifier and Type | Method and Description |
|---|---|
void |
addContainerObserver(ContainerStateObserver containerObserver)
Adds the given observer to the list of internal observers.
|
String |
getContainerId(String name)
Retrieves the container Id for the container with the given name or null if
no such container could be found.
|
com.spotify.docker.client.messages.swarm.Task |
getContainerInfo(String containerId)
Returns container info
|
String |
getContainerName(String containerId)
Returns the name of the container with the given Id or
null if such a
container can not be found |
default List<com.spotify.docker.client.messages.swarm.Task> |
getContainers()
Get a list of tasks
|
List<com.spotify.docker.client.messages.swarm.Task> |
getContainers(com.spotify.docker.client.messages.swarm.Task.Criteria criteria)
Get a list of tasks which fulfill the given filter criteria.
|
com.spotify.docker.client.messages.ContainerStats |
getStats(String containerId)
Returns statistics of the container with the given Id or
null if the
container can not be found or an error occurs. |
void |
pullImage(String imageName)
Pulls the image with the given name.
|
void |
removeContainer(String containerId)
Removes the container with the given container Id.
|
void |
removeParentAndChildren(String parentId)
Removes the parent container and all its children given the parent id
|
String |
startContainer(String imageName)
Deprecated.
because the method tries to create a container with type=null and
parent="" which does not work without a predefined default type
for all containers that are created in that way. Use
startContainer(String, String, String) instead. |
String |
startContainer(String imageName,
String[] command)
Deprecated.
because the method tries to create a container with type=null and
parent="" which does not work without a predefined default type
for all containers that are created in that way. Use
startContainer(String, String, String, String[])
instead. |
String |
startContainer(String imageName,
String type,
String parent)
Start container with given image, type and parent
|
String |
startContainer(String imageName,
String containerType,
String parentId,
String[] command)
Starts the container with the given image name.
|
String |
startContainer(String imageName,
String containerType,
String parentId,
String[] env,
String[] command)
Starts the container with the given image name.
|
String |
startContainer(String imageName,
String containerType,
String parentId,
String[] env,
String[] command,
String experimentId)
Starts the container with the given image name.
|
void |
stopContainer(String containerId)
Deprecated.
use
removeContainer(String) instead. |
void |
stopParentAndChildren(String parentId)
Deprecated.
use
removeParentAndChildren(String) instead. |
static final String LABEL_TYPE
static final String LABEL_PARENT
@Deprecated String startContainer(String imageName)
startContainer(String, String, String) instead.imageName - Name of the image to startString startContainer(String imageName, String[] command)
startContainer(String, String, String, String[])
instead.imageName - name of the image to startcommand - command to be executedString startContainer(String imageName, String type, String parent)
imageName - name of the image to starttype - container typeparent - parent idString startContainer(String imageName, String containerType, String parentId, String[] command)
imageName - name of the image to be startedcontainerType - type to be assigned to containerparentId - id of the parent containercommand - commands that should be executedString startContainer(String imageName, String containerType, String parentId, String[] env, String[] command)
imageName - name of the image to be startedcontainerType - type to be assigned to containerparentId - id of the parent containerenv - environment variables of the schema "key=value"command - commands that should be executedString startContainer(String imageName, String containerType, String parentId, String[] env, String[] command, String experimentId)
imageName - name of the image to be startedcontainerType - type to be assigned to containerparentId - id of the parent containerenv - environment variables of the schema "key=value"command - commands that should be executedexperimentId - experimentId to add to GELF tag@Deprecated void stopContainer(String containerId)
removeContainer(String) instead.containerId - id of the container that should be stoppedvoid removeContainer(String containerId)
containerId - id of the container that should be removed@Deprecated void stopParentAndChildren(String parentId)
removeParentAndChildren(String) instead.parentId - id of the parent containervoid removeParentAndChildren(String parentId)
parentId - id of the parent containercom.spotify.docker.client.messages.swarm.Task getContainerInfo(String containerId) throws InterruptedException, com.spotify.docker.client.exceptions.DockerException
containerId - InterruptedExceptioncom.spotify.docker.client.exceptions.DockerExceptiondefault List<com.spotify.docker.client.messages.swarm.Task> getContainers()
List<com.spotify.docker.client.messages.swarm.Task> getContainers(com.spotify.docker.client.messages.swarm.Task.Criteria criteria)
String getContainerId(String name)
String getContainerName(String containerId)
null if such a
container can not be foundcontainerId - the Id of the container for which the name should be retrievednull if such a
container can not be foundvoid addContainerObserver(ContainerStateObserver containerObserver)
containerObserver - the observer that should be added to the internal listvoid pullImage(String imageName)
imageName - the name of the image that should be pulledcom.spotify.docker.client.messages.ContainerStats getStats(String containerId)
null if the
container can not be found or an error occurs.containerId - the Id of the container for which statistics should be requestednull if the
container can not be found or an error occurs.Copyright © 2017–2018. All rights reserved.