Package enomalism2 :: Package modules :: Package machinecontrol :: Module rest
[hide private]

Module rest

REST controllers for controlling machines.


Requires:

Status: Stable

Functions [hide private]
None
rest_machine_UUID_trigger_status_updates(self, *args, **kw)
Forces the machine to run a status update on all it's children.
Dictionary
rest_machines(self, *args, **kw)
List machines available in the database.
Dictionary
rest_machine(self, *args, **kw)
Same as rest/machines.
Dictionary
rest_machine_UUID(self, *args, **kw)
Returns information about a given machine.
Dictionary
rest_machine_UUID_rename(self, *args, **kw)
Rename the specified machine.
Dictionary
rest_machine_UUID_hypervisors(self, *args, **kw)
Retrieves a list of hypervisors for the requested machine.
Dictionary
rest_machine_UUID_clusters(self, *args, **kw)
Add or list machine clusters.
Dictionary
rest_machine_UUID_actions(self, *args, **kw)
Get a list of available machine actions.
Dictionary
rest_machine_UUID_actions_unlock(self, *args, **kw)
Unlock the specified machine.
Dictionary
rest_machine_UUID_actions_suspend(self, *args, **kw)
Suspend the specified machine.
Dictionary
rest_machine_UUID_actions_resume(self, *args, **kw)
Resume the specified machine.
Dictionary
rest_machine_UUID_actions_shutdown(self, *args, **kw)
Shutdown the specified machine.
Dictionary
rest_machine_UUID_actions_poweroff(self, *args, **kw)
Poweroff the specified machine.
Dictionary
rest_machine_UUID_actions_reboot(self, *args, **kw)
Reboot the specified machine.
Dictionary
rest_machine_UUID_actions_create(self, *args, **kw)
Create the specified machine.
Dictionary
rest_machine_UUID_actions_store_xml(self, *args, **kw)
This overwrites the xml definition in the database with the currently running XML definition.
Dictionary
rest_machine_UUID_actions_manage(self, *args, **kw)
This adds an unmanaged machine (legacy machine) into the administrative console.
Dictionary
rest_machine_UUID_actions_totaldelete(self, *args, **kw)
This deletes all references to a machine in the database, and deletes it's hard drive images/files.
Dictionary
rest_machine_UUID_actions_package(self, *args, **kw)
Package the target machine.
 
rest_machine_UUID_actions_provision(self, *args, **kw)
Function Details [hide private]

rest_machine_UUID_trigger_status_updates(self, *args, **kw)

 

Forces the machine to run a status update on all it's children. Nice for populating the database before a "get state" call.

URL Format:

   /rest/machine/<UUID>/trigger_status_updates/
Parameters:
Returns: None
None
Raises:
  • cherrypy.HTTPError - Raised when permission is denied.

rest_machines(self, *args, **kw)

 

List machines available in the database. Returns a list of machines by UUID in the return result machines.

URL Format:

   /rest/machines/
Parameters:
Returns: Dictionary
Dictionary containing all machines.
Decorators:
  • @register_extension("machines", allowed_methods= ['GET', 'POST'])
Raises:
  • None - No exceptions are raised by this function.

Status: Stable

See Also: enomalism2.machine.Machine

rest_machine(self, *args, **kw)

 

Same as rest/machines.

URL Format:

   /rest/machine/
Parameters:
Returns: Dictionary
Dictionary containing all machines.
Decorators:
  • @register_extension("machine", allowed_methods= ['GET', 'POST'])
Raises:

Status: Stable

See Also:
enomalism2.machine.Machine, enomalism2.modules.machinecontrol.rest.rest_machines

rest_machine_UUID(self, *args, **kw)

 

Returns information about a given machine.

URL Format:

   /rest/machine/<UUID>/
Parameters:
  • self (enomalism2.REST.rest) - The method class.
  • action (String) - Only valid for post, the term "rename" is valid for now.
  • name (String) - When rename action is called, this is the new machine name.
Returns: Dictionary
Dictionary containing the results of the specified command.
Decorators:
  • @register_extension("machine/*", allowed_methods= ['GET', 'POST'])
Raises:
  • cherrypy.HTTPError - Raised when permission is denied.

rest_machine_UUID_rename(self, *args, **kw)

 

Rename the specified machine.

URL Format:

   /rest/machine/<UUID>/rename/
Parameters:
Returns: Dictionary
A dictionary containing the result of the action.
Decorators:
  • @register_extension("machine/*/rename", allowed_methods= ['GET', 'POST'])
Raises:
  • None - No exceptions are raised by this method.

rest_machine_UUID_hypervisors(self, *args, **kw)

 

Retrieves a list of hypervisors for the requested machine. Alternately (with a POST), adds a new hypervisor to the posted machine.

URL Format:

   /rest/machine/<UUID>/hypervisors/
Parameters:
  • self (enomalism2.REST.rest) - The method class.
  • virt_class (String) - Virtualization class to target.
  • virt_url (String) - The url for the virt_class to target.
Returns: Dictionary
A dictionary containing the result of the command.
Decorators:
  • @register_extension("machine/*/hypervisors", allowed_methods= ['GET', 'POST'])
Raises:
  • cherrypy.HTTPError - Raised when permission is denied.

rest_machine_UUID_clusters(self, *args, **kw)

 

Add or list machine clusters.

URL Format:

   /rest/machine/<UUID>/clusters/
Parameters:
  • self (enomalism2.REST.rest) - The method class.
  • clusters (String) - The cluster we are adding the machine to.
Returns: Dictionary
A dictionary containing a list of clusters this machine is a member of.
Decorators:
  • @register_extension("machine/*/clusters", allowed_methods= ['GET', 'POST'])
Raises:
  • cherrypy.HTTPError - Raised when permission is denied.

rest_machine_UUID_actions(self, *args, **kw)

 

Get a list of available machine actions.

URL Format:

   /rest/machine/<UUID>/actions/
Parameters:
Returns: Dictionary
A Dictionary containing a list of available actions.
Decorators:
  • @register_extension("machine/*/actions", allowed_methods= ['GET', 'POST'])
Raises:
  • cherrypy.HTTPError - Raised when permission is denied.

rest_machine_UUID_actions_unlock(self, *args, **kw)

 

Unlock the specified machine.

URL Format:

   /rest/machine/<UUID>/actions/unlock/
Parameters:
Returns: Dictionary
A dictionary containing the result of the action.
Decorators:
  • @register_extension("machine/*/actions/unlock", allowed_methods= ['POST'])
Raises:
  • cherrypy.HTTPError - Raised when permission is denied.

rest_machine_UUID_actions_suspend(self, *args, **kw)

 

Suspend the specified machine.

URL Format:

   /rest/machine/<UUID>/actions/suspend/
Parameters:
Returns: Dictionary
A dictionary containing the result of the action.
Decorators:
  • @register_extension("machine/*/actions/suspend", allowed_methods= ['POST'])
Raises:
  • cherrypy.HTTPError - Raised when permission is denied.

rest_machine_UUID_actions_resume(self, *args, **kw)

 

Resume the specified machine.

URL Format:

   /rest/machine/<UUID>/actions/resume/
Parameters:
Returns: Dictionary
A dictionary containing the result of the action.
Decorators:
  • @register_extension("machine/*/actions/resume", allowed_methods= ['POST'])
Raises:
  • cherrypy.HTTPError - Raised when permission is denied.

rest_machine_UUID_actions_shutdown(self, *args, **kw)

 

Shutdown the specified machine.

URL Format:

   /rest/machine/<UUID>/actions/shutdown/
Parameters:
Returns: Dictionary
A dictionary containing the result of the command.
Decorators:
  • @register_extension("machine/*/actions/shutdown", allowed_methods= ['POST'])
Raises:
  • cherrypy.HTTPError - Raised when permission is denied.

rest_machine_UUID_actions_poweroff(self, *args, **kw)

 

Poweroff the specified machine.

URL Format:

   /rest/machine/<UUID>/actions/poweroff/
Parameters:
Returns: Dictionary
A dictionary containing the result of the command.
Decorators:
  • @register_extension("machine/*/actions/poweroff", allowed_methods= ['POST'])
Raises:
  • cherrypy.HTTPError - Raised when permission is denied.

rest_machine_UUID_actions_reboot(self, *args, **kw)

 

Reboot the specified machine.

URL Format:

   /rest/machine/<UUID>/actions/reboot/
Parameters:
Returns: Dictionary
A dictionary containing the result of the command.
Decorators:
  • @register_extension("machine/*/actions/reboot", allowed_methods= ['POST',])
Raises:
  • cherrypy.HTTPError - Raised when permission is denied.

rest_machine_UUID_actions_create(self, *args, **kw)

 

Create the specified machine.

URL Format:

   /rest/machine/<UUID>/actions/create/
Parameters:
Returns: Dictionary
A dictionary containing the result of the command.
Decorators:
  • @register_extension("machine/*/actions/create", allowed_methods= ['POST',])
Raises:
  • cherrypy.HTTPError - Raised when permission is denied.

rest_machine_UUID_actions_store_xml(self, *args, **kw)

 

This overwrites the xml definition in the database with the currently running XML definition.

URL Format:

   /rest/machine/<UUID>/actions/store_xml/
Parameters:
Returns: Dictionary
A dictionary containing the result of the command.
Decorators:
  • @register_extension("machine/*/actions/store_xml", allowed_methods= ['POST',])
Raises:
  • cherrypy.HTTPError - Raised when permission is denied.

rest_machine_UUID_actions_manage(self, *args, **kw)

 

This adds an unmanaged machine (legacy machine) into the administrative console. Once added, it is assigned a UUID and other management options become available.

URL Format:

   /rest/machine/<UUID>/actions/manage/
Parameters:
  • self (enomalism2.REST.rest) - The method class.
  • parent (String) - The parent hypervisor to add the specified machine to.
Returns: Dictionary
A dictionary containing the result of the command.
Decorators:
  • @register_extension("machine/*/actions/manage", allowed_methods= ['POST',])
Raises:
  • cherrypy.HTTPError - Raised when permission is denied.

rest_machine_UUID_actions_totaldelete(self, *args, **kw)

 

This deletes all references to a machine in the database, and deletes it's hard drive images/files.

URL Format:

   /rest/machine/<UUID>/actions/totaldelete/
Parameters:
Returns: Dictionary
A dictionary containing the result of the action.
Decorators:
  • @register_extension("machine/*/actions/totaldelete", allowed_methods= ['POST',])
Raises:
  • cherrypy.HTTPError - Raised when permission is denied.

rest_machine_UUID_actions_package(self, *args, **kw)

 

Package the target machine.

URL Format:

   /rest/machine/<UUID>/actions/package/
Parameters:
Returns: Dictionary
A dictionary containing the result of the action.
Decorators:
  • @register_extension("machine/*/actions/package", allowed_methods= ['POST',])
Raises:
  • cherrypy.HTTPError - Raised when permission is denied.

rest_machine_UUID_actions_provision(self, *args, **kw)

 
Decorators:
  • @register_extension("machine/*/actions/provision", allowed_methods= ['POST', 'PUT'])