Interface ContainerOperations
- All Known Subinterfaces:
ContainerManager,EcsClient
- All Known Implementing Classes:
AbstractContainerManager,EcsAasClient
public interface ContainerOperations
Basic container operations that a container manager as well as an AAS client shall provide.
- Author:
- Holger Eichelberger, SSE
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionaddContainer(URI location) Adds a container to the management domain of this instance, e.g., by downloading it from a container registry.Returns the name of the underlying container system, e.g.Returns the version of the underlying container system.Returns the container id for a given container location as used inaddContainer(URI).Returns the state of the container.voidmigrateContainer(String id, String resourceId) Migrates the container.voidstartContainer(String id) Starts a container.voidstopContainer(String id) Stops the container.voidRemoves the container from the management domain of this instance.voidupdateContainer(String id, URI location) Updates the container by the container in the givenlocation.
-
Field Details
-
EXC_ALREADY_KNOWN
- See Also:
-
-
Method Details
-
addContainer
Adds a container to the management domain of this instance, e.g., by downloading it from a container registry. This defines theidof the container within the management domain of this instance. After a successful execution, the containeridis returned and shall be available and the container shall be in stateContainerState.AVAILABLE.- Parameters:
location- the location from where to download the container, e.g., an URL- Returns:
- the id of the container
- Throws:
ExecutionException- in case that adding the container fails for some reason
-
getId
Returns the container id for a given container location as used inaddContainer(URI).- Parameters:
location- the location- Returns:
- the id of the container, may be empty or nullnull if there is none
-
startContainer
Starts a container. The container must be already within the management domain of this instance byaddContainer(URI). The container shall after some time be in stateContainerState.DEPLOYING,ContainerState.DEPLOYEDorContainerState.FAILED.- Parameters:
id- the id of the container- Throws:
ExecutionException- in case that starting the container fails for some reason
-
stopContainer
Stops the container. The container shall afterwards be in stateContainerState.STOPPED.- Parameters:
id- the id of the container to stop, or as fallback the canonical URI of the container descriptor used for adding- Throws:
ExecutionException- if stopping the container fails
-
migrateContainer
Migrates the container.- Parameters:
id- the id of the containerresourceId- the target resource id, e.g., a device- Throws:
ExecutionException- if migration fails
-
undeployContainer
Removes the container from the management domain of this instance. This operation shall only remove the implementation of a non-operational container and, thus, perform a state transition toContainerState.UNDEPLOYINGand ultimately the container shall be removed and its descriptor shall not be available anymore.- Parameters:
id- the id of the container to remove, or as fallback the canonical URI of the container descriptor used for adding- Throws:
ExecutionException- if undeploying the container fails, e.g., because it is still running
-
updateContainer
Updates the container by the container in the givenlocation. This operation is responsible for stopping the running container (if needed), replacing it, starting the new container.- Parameters:
id- the id of the container to be updatedlocation- the location of the new container, e.g., an URL- Throws:
ExecutionException- if the given container cannot be updated for some reason
-
getState
Returns the state of the container.- Parameters:
id- the id/URI of the container- Returns:
- the state of the container
-
getContainerSystemName
String getContainerSystemName()Returns the name of the underlying container system, e.g. Docker.- Returns:
- the name
-
getContainerSystemVersion
String getContainerSystemVersion()Returns the version of the underlying container system. As this version may differ from the syntax conventions ofVersion, we just return here a string.- Returns:
- the version
-