Documentation Virtualization Abstraction Layer (VAL) Plugins¶
-
class
motey.val.plugins.abstractVAL.AbstractVAL[source]¶ An abstract implementation for a virtualization abstraction layer (VAL). Should be inherited to build an custom VAL plugin. A VAL plugin is implemented as an yapsy plugin. Each plugin must be configured via a yapsy-plugin file. See more at http://yapsy.sourceforge.net/
-
create_instance(image_name, parameters={})[source]¶ Create and start an instance of an image.
Parameters: - image_name – the name of the image which should be created
- parameters – execution parameters
Returns: the id of the created instance
-
delete_image(image_name)[source]¶ Delete an image, but not the instance of it.
Parameters: image_name – the image to be deleted.
-
get_all_instances_stats()[source]¶ Returns object which is type of
Status. Represents the status of all instances of this plugin type.Returns: object from type Status
-
get_all_running_instances()[source]¶ Returns a list with all running instance in this VAL.
Returns: list of instances
-
get_stats(instance_name)[source]¶ Returns object which is type of
Status. Represents the status of an instance.Parameters: instance_name – the name of the instance Returns: object from type Status
-
has_image(image_name)[source]¶ Checks if an specific images exists.
Parameters: image_name – the name of the image to search for. Returns: True if the image exist, otherwise False.
-
has_instance(instance_name)[source]¶ Checks if an image instance exists.
Parameters: instance_name – the name of an existing instance
-
load_image(image_name)[source]¶ Load the image to the device, but does not start the image himself.
Parameters: image_name – the image to be loaded.
-
-
class
motey.val.plugins.dockerVAL.DockerVAL[source]¶ Concrete implementation of the docker virtualization abstraction layer (VAL).
-
create_instance(image_name, parameters={})[source]¶ Create and start an instance of an image. It is a wrapper around the
docker.containers.createcommand.Parameters: - image_name – the name of the image which should be created
- parameters – execution parameters. Same as in the
docker.create_container.
Returns: the id of the created instance
-
delete_image(image_name)[source]¶ Delete an image, but not the instance of it. It is a wrapper around the
docker.images.removecommand.Parameters: image_name – the image to be deleted.
-
get_all_instances_stats()[source]¶ Returns object which is type of
Status. Represents the status of all docker container.Returns: object from type Status
-
get_all_running_instances()[source]¶ Returns a list with all running instance in this VAL. It is a wrapper around the
docker.containers.list(filters={'status': 'running'})command.Returns: list of instances
-
get_stats(container_name)[source]¶ Returns object which is type of
Status. Represents the status of a container.Parameters: container_name – the name of the container Returns: object from type Status
-
has_image(image_name)[source]¶ Checks if an specific images exists.
Parameters: image_name – the name of the image to search for. Can be the image.idor theimage.short_id.Returns: True if the image exist, otherwise False.
-
has_instance(container_name)[source]¶ Checks if an image instance exists. It is a wrapper around the
docker.containers.getcommand.Parameters: container_name – the name of an existing instance
-
load_image(image_name)[source]¶ Load the image to the device, but does not start the image himself. It is a wrapper around the
docker.images.pullcommand.Parameters: image_name – the image to be loaded.
-
start_instance(instance_name, parameters={})[source]¶ Start an existing image instance. It is a wrapper around the
docker.containers.runcommand.Parameters: - instance_name – the name of the existing instance
- parameters – execution parameters. Same as in the
docker.create_container.
Returns: the id of the started instance
-