archipelagentvmparking :: vmparking :: TNVMParking :: Class TNVMParking
[hide private]
[frames] | no frames]

Class TNVMParking

source code

archipelcore.archipelPlugin.TNArchipelPlugin --+
                                               |
                                              TNVMParking

Instance Methods [hide private]
 
__init__(self, configuration, entity, entry_point_group)
Initialize the plugin.
source code
 
register_handlers(self)
This method will be called by the plugin user when it will be necessary to register module for listening to stanza.
source code
 
unregister_handlers(self)
Unregister the handlers.
source code
 
get_vms_from_uuid(self, vms, callback)
Get a list of parked vms from central db based on a list of uuids.
source code
 
get_vms_from_name(self, name, callback)
Get a list of parked vms from central db based on name pattern.
source code
 
get_vms(self, iq, conn)
List virtual machines in the park withing an interval
source code
 
park(self, vm_informations)
Park a virtual machine.
source code
 
unpark(self, vm_information)
Unpark virtual machine
source code
 
delete(self, vms_uuids)
Delete a parked virtual machine
source code
 
get_definition(self, uuid)
Retrive the xml vm defintion form the parking
source code
 
edit_definition(self, iq, uuid, domain)
Update the domain XML of a parked VM
source code
 
create_parked(self, vm_informations)
Creates a VM directly into the parking.
source code
 
process_iq_for_hypervisor(self, conn, iq)
This method is invoked when a ARCHIPEL_NS_HYPERVISOR_VMPARKING IQ is received.
source code
xmpp.Protocol.Iq
iq_list(self, iq, conn)
Return the list of parked virtual machines
source code
string
message_list(self, msg)
Handle the parking list message.
source code
xmpp.Protocol.Iq
iq_park(self, iq)
Park virtual machine
source code
string
message_park_hypervisor(self, msg)
Handle the park message.
source code
xmpp.Protocol.Iq
iq_unpark(self, iq)
Unpark virtual machine
source code
string
message_unpark(self, msg)
Handle the unpark message.
source code
xmpp.Protocol.Iq
iq_delete(self, iq)
Delete a parked virtual machine
source code
xmpp.Protocol.Iq
iq_edit_definition(self, iq)
Update the XML description of a parked virtual machine
source code
xmpp.Protocol.Iq
iq_create_parked(self, iq)
Create a VM in directly into the parking
source code
 
process_iq_for_vm(self, conn, iq)
This method is invoked when a ARCHIPEL_NS_VM_VMPARKING IQ is received.
source code
xmpp.Protocol.Iq
iq_park_vm(self, iq)
ask own hypervisor to park the virtual machine
source code
string
message_park_vm(self, msg)
Handle the park message for vm.
source code
Static Methods [hide private]
dict
plugin_info()
Return informations about the plugin.
source code
Method Details [hide private]

__init__(self, configuration, entity, entry_point_group)
(Constructor)

source code 

Initialize the plugin.

Parameters:
  • configuration (Configuration object) - the configuration
  • entity (TNArchipelEntity) - the entity that owns the plugin
  • entry_point_group (string) - the group name of plugin entry_point
Overrides: archipelcore.archipelPlugin.TNArchipelPlugin.__init__

register_handlers(self)

source code 

This method will be called by the plugin user when it will be necessary to register module for listening to stanza.

Overrides: archipelcore.archipelPlugin.TNArchipelPlugin.register_handlers

unregister_handlers(self)

source code 

Unregister the handlers.

Overrides: archipelcore.archipelPlugin.TNArchipelPlugin.unregister_handlers

get_vms_from_uuid(self, vms, callback)

source code 

Get a list of parked vms from central db based on a list of uuids.

Parameters:
  • uuid - The list of vm objects like [ { "uuid": x } , { "uuid": y} ]
  • uuids (List)

get_vms_from_name(self, name, callback)

source code 

Get a list of parked vms from central db based on name pattern.

Parameters:
  • name (string) - The pattern name of vms like vm_

plugin_info()
Static Method

source code 

Return informations about the plugin.

Returns: dict
dictionary contaning plugin informations
Overrides: archipelcore.archipelPlugin.TNArchipelPlugin.plugin_info

park(self, vm_informations)

source code 

Park a virtual machine.

Parameters:
  • vm_informations (list) - list of dict like {"uuid": x, "parker": z)}

unpark(self, vm_information)

source code 

Unpark virtual machine

Parameters:
  • vm_information (list) - list of dict like {"uuid": x, "start": True|False, "parker": z}

delete(self, vms_uuids)

source code 

Delete a parked virtual machine

Parameters:
  • uuid - list of dic like {"uuid": x}
  • vm_uuids (list)

edit_definition(self, iq, uuid, domain)

source code 

Update the domain XML of a parked VM

Parameters:
  • uuid (String) - the VM UUID
  • domain (xmpp.Node) - the new XML description

create_parked(self, vm_informations)

source code 

Creates a VM directly into the parking.

Parameters:
  • vm_informations (list) - list containing VM to park [{"uuid": x, domain: y, parker: x, creation_date: d, status: s}]

process_iq_for_hypervisor(self, conn, iq)

source code 

This method is invoked when a ARCHIPEL_NS_HYPERVISOR_VMPARKING IQ is received. It understands IQ of type:

  • list
  • park
  • create_parked
  • unpark
  • destroy
  • edit_definition
Parameters:
  • conn (xmpp.Dispatcher) - ths instance of the current connection that send the stanza
  • iq (xmpp.Protocol.Iq) - the received IQ

iq_list(self, iq, conn)

source code 

Return the list of parked virtual machines

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action

message_list(self, msg)

source code 

Handle the parking list message.

Parameters:
  • msg (xmmp.Protocol.Message) - the message
Returns: string
the answer

iq_park(self, iq)

source code 

Park virtual machine

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action

message_park_hypervisor(self, msg)

source code 

Handle the park message.

Parameters:
  • msg (xmmp.Protocol.Message) - the message
Returns: string
the answer

iq_unpark(self, iq)

source code 

Unpark virtual machine

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action

message_unpark(self, msg)

source code 

Handle the unpark message.

Parameters:
  • msg (xmmp.Protocol.Message) - the message
Returns: string
the answer

iq_delete(self, iq)

source code 

Delete a parked virtual machine

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action

iq_edit_definition(self, iq)

source code 

Update the XML description of a parked virtual machine

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action

iq_create_parked(self, iq)

source code 

Create a VM in directly into the parking

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action

process_iq_for_vm(self, conn, iq)

source code 

This method is invoked when a ARCHIPEL_NS_VM_VMPARKING IQ is received. It understands IQ of type:

  • park
Parameters:
  • conn (xmpp.Dispatcher) - ths instance of the current connection that send the stanza
  • iq (xmpp.Protocol.Iq) - the received IQ

iq_park_vm(self, iq)

source code 

ask own hypervisor to park the virtual machine

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action

message_park_vm(self, msg)

source code 

Handle the park message for vm.

Parameters:
  • msg (xmmp.Protocol.Message) - the message
Returns: string
the answer