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

Module model

Core machine control functionality. Includes helper classes as well as hooks and proxying functionality.


Requires:

Status: Stable

Classes [hide private]
  MachineTools
Utility class that defines machine control utility functionality.
  InfoProxy
Abstract class for machine info proxying.
Functions [hide private]
Dictionary
_get_remote_info(target_machine, puuid, purl)
Helper function for getting remote machine information.
None
_run_status_updates(uuid)
Run status updates for the specified machine's children.
List
hook_machine_get_actions_by_state(fn, self, state)
Hook to add actions to a machine.
Dictionary
hook_machine_get_info(fn, self)
Hook for getting machine information.
Tuple
hook_machine_get_state(fn, self)
Hook that is processed when getting the machine state.
None
hook_machine_trigger_status_updates(fn, self)
Hook that is processed when status updates are triggered.
Dictionary
provision_utility(*args, **kw)
Utility function which actually does the provisioning job.
Variables [hide private]
  uuid = '344e551b-ba08-4eab-8c4d-ad52ef3805c9'
  actions = {'libvirt': {STATE_PAUSED: ['shutdown', 'resume', 'p...
Function Details [hide private]

_get_remote_info(target_machine, puuid, purl)

 

Helper function for getting remote machine information.

Example usage:

>>> from enomalism2 import model
>>> from machinecontrol.model import _get_remote_info
>>> machine_obj=model.UUIDSearch.machine('123')
>>> _get_remote_info(machine_obj, '456', 'http://192.168.4.105/rest/')
Parameters:
  • target_machine (enomalism2.machine.Machine) - The machine we are getting information for.
  • puuid (String) - The uuid of the parent machine we are calling.
  • purl (String) - The url of the parent machine we are calling.
Returns: Dictionary
The remote information.
Raises:
  • None - No exceptions are raised by this function.

_run_status_updates(uuid)

 

Run status updates for the specified machine's children.

Example usage:

>>> from machinecontrol.model import _run_status_updates
>>> _run_status_updates('123')
Parameters:
  • uuid (String) - The machine uuid.
Returns: None
None
Raises:
  • None - No exceptions are raised by this function.

hook_machine_get_actions_by_state(fn, self, state)

 

Hook to add actions to a machine.

Parameters:
Returns: List
The result of the original method invocation.
Decorators:
  • @model.hook(model.Machine, model.Machine.get_actions_by_state)
Raises:
  • None - No exceptions are raised by this function.

hook_machine_get_info(fn, self)

 

Hook for getting machine information.

Parameters:
Returns: Dictionary
The machine information.
Decorators:
  • @model.hook(model.Machine, model.Machine.get_info)
Raises:
  • None - No exceptions are raised by this method.

hook_machine_get_state(fn, self)

 

Hook that is processed when getting the machine state.

Parameters:
Returns: Tuple
The machine state.
Decorators:
  • @model.hook(model.Machine, model.Machine.get_state)
Raises:
  • None - No exceptions are raised by this function.

hook_machine_trigger_status_updates(fn, self)

 

Hook that is processed when status updates are triggered.

Parameters:
Returns: None
None
Decorators:
  • @model.hook(model.Machine, model.Machine.trigger_status_updates)
Raises:
  • None - No exceptions are raised by this function.

provision_utility(*args, **kw)

 

Utility function which actually does the provisioning job.

Parameters:
  • pkguuid (String) - The uuid of the package to provision.
  • hvmuuid (String) - The uuid of the provisioning hypervisor.
  • name (String) - The name of the new machine.
Returns: Dictionary
A dictionary cntaining the result of the provisioning job.
Raises:
  • cherrypy.HTTPError - Raised when permission is denied.

Variables Details [hide private]

actions

Value:
{'libvirt': {STATE_PAUSED: ['shutdown', 'resume', 'poweroff', 'reboot'\
, 'store_xml', 'totaldelete'], STATE_RUNNING: ['shutdown', 'suspend', \
'poweroff', 'reboot', 'store_xml', 'totaldelete'], STATE_BLOCKED: ['sh\
utdown', 'suspend', 'poweroff', 'reboot', 'store_xml', 'totaldelete'],\
 STATE_OFF: ['create', 'totaldelete'], STATE_SHUTDOWN: ['create', 'tot\
aldelete'], STATE_UNKNOWN: ['create', 'totaldelete'], STATE_UNAVAILABL\
E: ['create', 'totaldelete'], STATE_UNMANAGED: ['store_xml'], STATE_HO\
ST_DOWN: [],}, None: {}}