archipelagenthypervisornetwork :: network :: TNHypervisorNetworks :: Class TNHypervisorNetworks
[hide private]
[frames] | no frames]

Class TNHypervisorNetworks

source code

archipelcore.archipelPlugin.TNArchipelPlugin --+
                                               |
                                              TNHypervisorNetworks

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
libvirtNetwork
get_network_with_identifier(self, identifier)
Return a libvirtNetwork according to the identifier, which can be the name or the UUID
source code
dict
get(self, active=True, inactive=True)
Get the list of networks.
source code
 
create(self, identifier)
Create (start) the network with given identifier.
source code
 
destroy(self, identifier)
destroy (stop) the network with given identifier
source code
 
define(self, definition)
define the network
source code
 
undefine(self, identifier)
Undefine the network with given identifier.
source code
list
getnics(self)
Return the list of all network interfaces.
source code
list
getnwfilters(self)
Return the list of all libvirt network filters.
source code
integer
setAutostart(self, identifier, shouldAutostart)
Set the network to start with the host
source code
Boolean
getAutostart(self, identifier)
Set the network to start with the host
source code
 
process_iq_for_hypervisor(self, conn, iq)
This method is invoked when a ARCHIPEL_NS_HYPERVISOR_NETWORK IQ is received.
source code
 
process_iq_for_virtualmachine(self, conn, iq)
This method is invoked when a ARCHIPEL_NS_HYPERVISOR_NETWORK IQ is received.
source code
xmpp.Protocol.Iq
iq_define(self, iq)
Define a virtual network in the libvirt according to the XML data network passed in argument.
source code
xmpp.Protocol.Iq
iq_undefine(self, iq)
Undefine a virtual network in the libvirt according to name passed in argument.
source code
xmpp.Protocol.Iq
iq_create(self, iq)
Create a network using libvirt connection.
source code
xmpp.Protocol.Message
message_create(self, msg)
Handle the creation request message.
source code
xmpp.Protocol.Iq
iq_destroy(self, iq)
Destroy a network using libvirt connection.
source code
string
message_destroy(self, msg)
Handle the destroying request message.
source code
xmpp.Protocol.Iq
iq_get(self, iq)
List all virtual networks.
source code
string
message_get(self, msg)
Create the message response to list network.
source code
xmpp.Protocol.Iq
iq_get_names(self, iq)
List all virtual network names.
source code
xmpp.Protocol.Iq
iq_bridges(self, iq)
List all bridge names.
source code
xmpp.Protocol.Iq
iq_get_nics(self, iq)
List all existing networks cards on the hypervisor.
source code
string
message_getnics(self, msg)
Get all the nics of the hypervisor.
source code
xmpp.Protocol.Iq
iq_get_nwfilters(self, iq)
List all existing libvirt network filters.
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

plugin_info()
Static Method

source code 

Return informations about the plugin.

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

get_network_with_identifier(self, identifier)

source code 

Return a libvirtNetwork according to the identifier, which can be the name or the UUID

Parameters:
  • identifier (String) - the name or the UUID of the network
Returns: libvirtNetwork
the network object with given identifier

get(self, active=True, inactive=True)

source code 

Get the list of networks.

Parameters:
  • active (bool) - if True, will return active network
  • inactive (bool) - if True, will return not active network
Returns: dict
a list containing networtks

create(self, identifier)

source code 

Create (start) the network with given identifier.

Parameters:
  • identifier (string) - the identifer of the network to create. It can be its name or UUID

destroy(self, identifier)

source code 

destroy (stop) the network with given identifier

Parameters:
  • identifier (string) - the identifer of the network to destroy. It can be its name or UUID

define(self, definition)

source code 

define the network

Parameters:
  • definition (string) - the XML definition to use

undefine(self, identifier)

source code 

Undefine the network with given identifier.

Parameters:
  • identifier (string) - the identifer of the network to destroy. It can be its name or UUID

getnics(self)

source code 

Return the list of all network interfaces.

Returns: list
list containing network cards names

getnwfilters(self)

source code 

Return the list of all libvirt network filters.

Returns: list
list containing network cards names

setAutostart(self, identifier, shouldAutostart)

source code 

Set the network to start with the host

Parameters:
  • identifier (boolean) - the UUID or the name of the network
  • shouldAutostart - set if autostart should be set
  • network_identifier (string)
Returns: integer
the result of the libvirt call

getAutostart(self, identifier)

source code 

Set the network to start with the host

Parameters:
  • identifier (string) - the UUID or the name of the network
Returns: Boolean
True is network is in autostart mode

process_iq_for_hypervisor(self, conn, iq)

source code 

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

  • define
  • undefine
  • create
  • destroy
  • get
  • bridges
  • getnames
  • getnics
Parameters:
  • conn (xmpp.Dispatcher) - ths instance of the current connection that send the stanza
  • iq (xmpp.Protocol.Iq) - the received IQ

process_iq_for_virtualmachine(self, conn, iq)

source code 

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

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

iq_define(self, iq)

source code 

Define a virtual network in the libvirt according to the XML data network passed in argument.

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

iq_undefine(self, iq)

source code 

Undefine a virtual network in the libvirt according to name passed in argument.

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(self, iq)

source code 

Create a network using libvirt connection.

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

message_create(self, msg)

source code 

Handle the creation request message.

Parameters:
  • msg (xmpp.Protocol.Message) - the received message
Returns: xmpp.Protocol.Message
a ready to send Message containing the result of the action

iq_destroy(self, iq)

source code 

Destroy a network using libvirt connection.

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

message_destroy(self, msg)

source code 

Handle the destroying request message.

Parameters:
  • msg (xmpp.Protocol.Message) - the message containing the request
Returns: string
the answer

iq_get(self, iq)

source code 

List all virtual networks.

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

message_get(self, msg)

source code 

Create the message response to list network.

Parameters:
  • msg (xmpp.Protocol.Message) - the message containing the request
Returns: string
the answer

iq_get_names(self, iq)

source code 

List all virtual network names.

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

iq_bridges(self, iq)

source code 

List all bridge names.

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

iq_get_nics(self, iq)

source code 

List all existing networks cards on the hypervisor.

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

message_getnics(self, msg)

source code 

Get all the nics of the hypervisor.

Parameters:
  • msg (xmpp.Protocol.Message) - the message containing the request
Returns: string
the answer

iq_get_nwfilters(self, iq)

source code 

List all existing libvirt network filters.

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