@ProviderType
public interface ContainerOrchestrationService
| Modifier and Type | Method and Description |
|---|---|
void |
deleteContainer(java.lang.String id)
Deletes a container identified by the specified ID
|
void |
deleteImage(java.lang.String imageId)
Deletes Image from container engine.
|
java.util.Optional<java.lang.String> |
getContainerIdByName(java.lang.String name)
Returns the id of the container corresponding to the specified name.
|
java.util.List<ContainerInstanceDescriptor> |
listContainerDescriptors()
Lists all available containers returning the corresponding
ContainerInstanceDescriptors |
java.util.List<java.lang.String> |
listContainersIds()
Lists all available containers by id only, like running the cli command 'docker ps -a'
|
java.util.List<ImageInstanceDescriptor> |
listImageInstanceDescriptors()
Lists all available images, returning the corresponding
ImageInstanceDescriptors |
void |
pullImage(ImageConfiguration imageConfig)
Allows to pull the required image, using the specified tag and credentials.
|
void |
pullImage(java.lang.String imageName,
java.lang.String imageTag,
int timeOutSeconds,
java.util.Optional<RegistryCredentials> registryCredentials)
Allows to pull the required image, using the specified tag and credentials.
|
void |
registerListener(ContainerOrchestrationServiceListener dockerListener)
Adds a new
ContainerOrchestrationServiceListener |
java.lang.String |
startContainer(ContainerConfiguration containerConfiguration)
Starts a container identified by the values provided in a not null
ContainerConfiguration object. |
void |
startContainer(java.lang.String id)
Starts a container identified by the specified ID
|
void |
stopContainer(java.lang.String id)
Stops a container identified by the specified ID
|
void |
unregisterListener(ContainerOrchestrationServiceListener dockerListener)
Removes the
ContainerOrchestrationServiceListener specified as
parameter |
java.util.List<java.lang.String> listContainersIds()
java.util.List<ContainerInstanceDescriptor> listContainerDescriptors()
ContainerInstanceDescriptorsContainerInstanceDescriptors representing the
available containersjava.util.List<ImageInstanceDescriptor> listImageInstanceDescriptors()
ImageInstanceDescriptorsContainerInstanceDescriptors representing the
available containersvoid deleteImage(java.lang.String imageId)
throws KuraException
imageId - string parameter that identifies the image to be deletedKuraException - if the image is used by a container or if the image
deletion process failsvoid pullImage(ImageConfiguration imageConfig) throws KuraException, java.lang.InterruptedException
imageConfig - an ImageConfiguration object which contains info such as
image name, tag, pull timeout in seconds and registry
credentials.KuraException - if the pull operation failsjava.lang.InterruptedExceptionvoid pullImage(java.lang.String imageName,
java.lang.String imageTag,
int timeOutSeconds,
java.util.Optional<RegistryCredentials> registryCredentials)
throws KuraException,
java.lang.InterruptedException
imageName - the image name to be used. Must not be null.imageTag - a string representing the image tag. Must not be
null.timeOutSeconds - a non negative integer representing the image
download timeout in secondsregistryCredentials - an optional that can contain the registry URL and
credentials for authenticationKuraException - if the pull operation failsjava.lang.InterruptedExceptionjava.util.Optional<java.lang.String> getContainerIdByName(java.lang.String name)
Optional#empty( result is returned.name - the string representing the container name. Must not be nullOptional value that will contain the container ID, if the
container exists. Otherwise and Optional.empty()java.lang.String startContainer(ContainerConfiguration containerConfiguration) throws KuraException, java.lang.InterruptedException
ContainerConfiguration object. If the requested image does not
exists, it will be downloaded. A String representing the container ID will be
returned if the operation of container creation and start succeed.containerConfiguration - KuraException - is thrown if the image pull or container creation and
start failjava.lang.InterruptedExceptionvoid startContainer(java.lang.String id)
throws KuraException
id - the ID of an already existing container. Must not be nullKuraException - if the container starting failsvoid stopContainer(java.lang.String id)
throws KuraException
id - the ID of an already existing container. Must not be nullKuraException - if the container stopping failsvoid deleteContainer(java.lang.String id)
throws KuraException
id - the ID of an already existing container. Must not be nullKuraException - if the container removal failsvoid registerListener(ContainerOrchestrationServiceListener dockerListener)
ContainerOrchestrationServiceListenerdockerListener - containerName - void unregisterListener(ContainerOrchestrationServiceListener dockerListener)
ContainerOrchestrationServiceListener specified as
parameterdockerListener -