Instances
An instance represents a physical or virtual machine described by a host.
Representation
The following elements are defined as part of an instance representation:
- organization: The organization of instantiated host. This field is read-only.
- environment: The environment of instantiated host. This field is read-only.
- host: The instantiated host. This field is read-only.
- state: The state of the instance (one of following values: UNDEFINED, PENDING, RUNNING, PAUSED, STOPPED). This field is read-only.
- properties: Instance’s properties (platform-related data). This field is read-only.
- synapseState: Synapse’s state (Up or Down). This field is read-only.
Example
{
"organization" : "Guardis Test",
"environment" : "Test Environment",
"host" : "test-host-on-Hyp3",
"state":"RUNNING",
"properties": [
{
"key" : "amqp.user_queue",
"value" : "host.EE9380B0B07211E18D8A5BD37F000001"
},
{
"key" : "libvirt.uuid",
"value" : "97c6b5be-bc74-4a4c-5a64-a594c00c88a8"
},
{
"key" : "mac",
"value" : "00:50:56:2C:92:E1"
},
{
"key" : "libvirt.hostUuid",
"value" : "EE9380B0B07211E18D8A5BD37F000001"
}
],
"synapseState" : "Down"
}
Methods
Entity
/organizations/{org_name}/environments/{env_name}/hosts/{host_name}/instance
- GET: returns host’s instance.
- POST: provisions associated host.
- DELETE: deletes the instance and destroys the associated resources (VM, storage, etc.).
Other
Fake provisioning
/organizations/{org_name}/environments/{env_name}/hosts/{host_name}/instance/properties
POST: creates host’s instance, but without provisioning host. This may be useful when migrating hosts between different ComodIT servers. This method takes as input a list of properties, for example:
[
{ "key" : "amqp.user_queue", "value" : "host.EE9380B0B07211E18D8A5BD37F000001" }, { "key" : "libvirt.uuid", "value" : "97c6b5be-bc74-4a4c-5a64-a594c00c88a8" }, { "key" : "mac", "value" : "00:50:56:2C:92:E1" }, { "key" : "libvirt.hostUuid", "value" : "EE9380B0B07211E18D8A5BD37F000001" }
]
VNC access
/organizations/{org_name}/environments/{env_name}/hosts/{host_name}/instance/vnc
GET: returns VNC access information, for example:
{
"token" : "+++eQcne1oQKAiG6h4lo9oeW+hsLN51HqEKeU3v0p+K5JqKLY3n1L/8kpIVEKUvW47k", "hostname" : "hyp3-devel.angleur.guardis.be", "port" : "5911"
}
Start
/organizations/{org_name}/environments/{env_name}/hosts/{host_name}/instance/_start
- PUT: starts the instance.
Pause
/organizations/{org_name}/environments/{env_name}/hosts/{host_name}/instance/_pause
- PUT: pauses the instance.
Resume
/organizations/{org_name}/environments/{env_name}/hosts/{host_name}/instance/_resume
- PUT: resumes the execution of the instance.
Shutdown
/organizations/{org_name}/environments/{env_name}/hosts/{host_name}/instance/_shutdown
- PUT: shutdowns the instance.
Reboot
/organizations/{org_name}/environments/{env_name}/hosts/{host_name}/instance/_reboot
- PUT: reboots the instance.
Force-off
/organizations/{org_name}/environments/{env_name}/hosts/{host_name}/instance/_off
- PUT: powers the instance off.