15. vm – Virtual Machine

Virtual machine functionality.

15.1. Resources

15.1.1. Vm

class vm.Vm

This resource represents a method in which to provision a new virtual machine.

Resource URI:

/rest/hosting/vm/
PUT(name, package, hardware, disk, network_uuid)

Provision a new virtual machine by submitting an HTTP PUT request.

Note

This resource requires create permission on the elastic_hosting extension module.

Parameters:
  • name – New virtual machine name.
  • package – New virtual machine package.
  • hardware – New virtual machine hardware profile.
  • disk – Additional hard disk for the virtual machine.
  • network_uuid – Network associated with the new virtual machine.
Return type:

vm.RepVm

15.1.2. VmUUID

class vm.VmUUID

This resource represens a specific virtual machine.

Resource URI:

/rest/hosting/vm/<UUID>/
GET()

Retrieve the specified virtual machine by submitting an HTTP GET request. The UUID in the resource URI should be the UUID of the target virtual machine.

Note

This resource requires read permission on both the virtual machine and the elastic_hosting extension module when using the HTTP GET method.

Return type:vm.RepVmUUID
POST(action, name, hardware_profile_uuid)

Update the specified virtual machine by submitting an HTTP POST request. The UUID in the resource URI should be the UUID of the target virtual machine.

Note

This resource requires update permission on both the virtual machine and the elastic_hosting extension module when using the HTTP POST method.

Parameters:
  • action – The action to perform on the virtual machine. The following actions are supported - start, stop, pause, resume, delete, and save.
  • name – The name to update the virtual machine with.
  • harware_profile_uuid – The hardware profile to associate with the virtual machine.
Return type:

vm.RepVmUUID

15.1.3. VmList

class vm.VmList

This resource represents a list of virtual machines.

Resource URI:

/rest/hosting/vm/list/
GET()

Retrieve a list of virtual machines by submitting an HTTP GET request.

Note

This resource requires read permission on the elastic_hosting extension module and on each virtual machine that is found.

Return type:vm.RepVmList

15.2. Representations

15.2.1. RepVm

_images/RepVm.png
class vm.RepVm

This is a representation of a virtual machine currently being provisioned.

errno
This attribute represents the general error number generated by the resource.
message
This attribute represents the general message generated by the resource.
transaction
This attribute represents the UUID of the transaction that is executing the provision job.

Representation:

{"errno":response.errno,
 "message":response.message,
 "transaction": transaction.uuid}

15.2.2. RepVmUUID

class vm.RepVmUUID

This is a representation of a virtual machine resource.

errno
This attribute represents the general error number generated by the resource.
message
This attribute represents the general message generated by the resource.
vm.uuid
This attribute represents the UUID of the virtual machine.
vm.name
This attribute represents the name of the virtual machine.
vm.state
This attribute represents the current state of the virtual machine.
vm.os
This attribute represents the operating system of the virtual machine.
vm.hardware_profile_uuid
This attribute represents the UUID of the hardware profile this virtual machine is using.
vm.vnc_ip_address
This attribute represents the VNC IP address of the virtual machine.
vm.vnc_port
This attribute represents the VNC port of the virtual machine.
vm.vnc_password
This attribute represents the VNC password of the virtual machine.
vm.vnc_enabled
This attribute represents whether or not VNC is enabled for this virtual machine.
vm.interfaces
This attribute represents the list of network interfacs belonging to this virtual machine.

Representation:

{"errno": response.errno,
 "message": response.message,
 "vm": {"uuid": vm.uuid,
        "name": vm.name,
        "state": vm.state,
        "os": vm.os,
        "hardware_profile_uuid": vm.hardware_profile,
        "vnc_ip_address": vm.vnc_ip,
        "vnc_port": vm.vnc_port,
        "vnc_password": vm.vnc_password,
        "vnc_enabled": vm.vnc_enabled,
        "interfaces": [interface_obj1, interface_obj2]}}

15.2.3. RepVmList

class vm.RepVmList

This is a representation of a list of virtual machines. This is a list of vm.RepVmUUID representations.

errno
This attribute represents the general error number generated by the resource.
message
This attribute represents the general message generated by the resource.
vms
This attribute represents the list of virtual machine representations.

Representation

{"errno": response.errno,
 "message": response.message,
 "vms": [vm1, vm2]}

See also

vm.RepVmUUID