1 package dst.ass3.elastic;
3 import dst.ass3.messaging.RequestType;
7 public interface IContainerService {
10 * Returns a list of all running containers.
12 * @return a list of ContainerInfo objects
13 * @throws ContainerException if an error occurred when trying to fetch the running containers.
15 List<ContainerInfo> listContainers() throws ContainerException;
18 * Stops the container with the given container ID.
20 * @param containerId ID of the container to stop.
21 * @throws ContainerNotFoundException if the container to stop is not running
22 * @throws ContainerException if another error occurred when trying to stop the container
24 void stopContainer(String containerId) throws ContainerException;
27 * Starts a worker for the specific {@link RequestType}.
29 * @param type {@link RequestType} of the worker to start
30 * @return ContainerInfo of the started container / worker
31 * @throws ImageNotFoundException if the worker docker image is not available
32 * @throws ContainerException if another error occurred when trying to start the worker
34 ContainerInfo startWorker(RequestType type) throws ContainerException;