-
Notifications
You must be signed in to change notification settings - Fork 8
API
The runtime model of the system can be manipulated in both imperative and declarative ways. It can be modified through a set of instructions (e.g. instantiate/destroy a node of a predefined type), or a new model can be provided to replace the instantiated one. The latter can be an in memory model or defined in a file (for instance in JSON or XMI) through the MODACloudML’s serialization codecs.
The runtime model is based on the type-instance pattern and consists of two main kinds of elements, namely the node and the artefacts. A node represents a virtual machine (e.g., a virtual machine running GNU/Linux with 2 cores and 2GiB of memory). An artefact represents a software component of the application (e.g., a Java servlet, a Jetty container, or a MongoDB database).
Moreover bindings can be specified between artefacts ports representing either deployment dependencies (e.g., the Jetty container and the MongoDB database have to be deployed before the Java servlet) or communication channels (e.g., a Java servlet communicates with another Java servlet through Hypertext Transfer Protocol Secure - HTTPS - on port 443).
Accordingly, the models@runtime will provide the following interfaces
##Actions on Types
Command | description |
---|---|
listOfTypes(): List | return the list of types in the current deploymentModel |
listOfNodeTypes(): List | return the list of node types in the current deploymentModel |
listOfArtefactTypes(): List | return the list of artefact types in the current deploymentModel |
listOfBindingTypes(): List | return the list of binding types in the current deploymentModel |
getNodeType(String id): NodeType | return information about the type of node with the specified id |
getArtefactType(String id): ArtefactType | return information about the type of artefact with the specified id |
getBindingType(String id): BindingType | return information about the type of binding with the specified id |
##Actions on instances
Command | description |
---|---|
instantiateNode(NodeType type,String name): Node | instantiate a node of type ’type’ in the deployment model |
instantiateArtefact(ArtefactType type, String name): Artefact | instantiate an artefact of type ’type’ in the deployment model |
instantiateBinding(String artefactPortId,String artefactPortId):Binding | instantiate a binding between two artefacts ports. Depending on the type of port used as parameter, the created binding can depict a communication channel (describe how the two artefacts will communicate) or a deployment dependency (An artefact require another artefact to run properly) |
removeNode(String id): Boolean | remove the node instance with the specified id from the deployment model |
removeArtefact(String id): void | remove the artefact instance with the specified id from the deployment model |
removeBinding(String id): void | remove the binding instance with the specified id from the deployment model |
setProvider(NodeInstance node,Provider p): void | define the cloud provider on which the node instance should be provisioned |
setDestination(String artefactId,String nodeId): void | define the node on which the artefact should be deployed |
listOfInstances(): List | return the list of instances in the current deployment Model |
listOfNodes(): List | return the list of node instances in the current deploymentModel |
listOfArtefacts(): List | return the list of artefact instances in the current deploymentModel |
listOfBindings(): List | return the list of binding instances in the current deploymentModel |
getArtefact(String id): Artefact | return information about the artefact with the specified id |
getNode(String id): Node | return information about the node with the specified id |
getBinding(String id): Binding | return information about the binding with the specified id |
##Declarative approach
Command | description |
---|---|
getDeploymentModel() | return the current deploymentModel |
loadDeploymentModel(deploymentModel) | load a deployment model as the current deploymentModel |
saveDeploymentModel(deploymentModel) | save the current deploymentModel |
##Lifecycle commands In addition the models@runtime engine of CloudML will provide the following interface to manage the lyfe cycles of node and artefact instances.
Command | description |
---|---|
stopArtefact(String artefactId): Artefact | stop the specified artefact |
installArtefact(String artefactId): Artefact | install the artefact with the specified id |
configureArtefact(String artefactId): Artefact | configure the artefact with the specified id |
startArtefact(String artefactId): Artefact | start the artefact with the specified id |
uninstallArtefact(String artefactId): Artefact | delete the virtual machine instance with the specified id |
provisionNode(String nodeId): Node | create an instance of a virtual machine with the specified startNode(String nodeId): Node |
stopNode(String nodeId): Node | shut-down a virtual machine (data persists) with the specified terminateNode(String nodeId): void |
scaleOut(String nodeId, Integer instanceNumber): void | create n new node instances of the same type. |
scaleIn(String nodeId, Integer instanceNumber): void | delete n node instances |