Ravel Python API Reference
A Database-Defined Network Controller
Public Member Functions | List of all members
ravel.network.NetworkProvider Class Reference

Superclass for a network provider. More...

Inheritance diagram for ravel.network.NetworkProvider:
ravel.network.EmptyNetProvider ravel.network.MininetProvider

Public Member Functions

def __init__
 
def cacheNodes
 Cache node-name mapping in memory from database. More...
 
def addLink
 Add a link to the topology. More...
 
def removeLink
 Remove a link from the topology. More...
 
def addSwitch
 Add a new switch to the topology. More...
 
def removeSwitch
 Remove a switch from the topology. More...
 
def addHost
 Add a new host to the topology. More...
 
def removeHost
 Remove a host from the topology. More...
 
def start
 Start the network provider and any components in the network.
 
def stop
 Stop the network provider and any components in the network.
 
def cli
 Pass commands to the network provider's CLI, if it has its own. More...
 

Detailed Description

Superclass for a network provider.

A network provider exposes the underlying topology to Ravel's database and CLI. It also receives and handles changes to the topology that are made from the database (eg, a link is removed from the database)

Constructor & Destructor Documentation

def ravel.network.NetworkProvider.__init__ (   self,
  queue_id,
  db 
)
Parameters
queue_idan integer id to be used for the database to communicate with the provider for updates to the topology inserted into the database
dba ravel.db.RavelDb instance

Member Function Documentation

def ravel.network.NetworkProvider.addHost (   self,
  msg 
)

Add a new host to the topology.

Parameters
msgan AddHostMessage object
def ravel.network.NetworkProvider.addLink (   self,
  msg 
)

Add a link to the topology.

Parameters
msgan AddLinkMessage object
def ravel.network.NetworkProvider.addSwitch (   self,
  msg 
)

Add a new switch to the topology.

Parameters
msgan AddSwitchMessage object
def ravel.network.NetworkProvider.cacheNodes (   self,
  nodes 
)

Cache node-name mapping in memory from database.

Parameters
nodesdictionary of (name, id) values
def ravel.network.NetworkProvider.cli (   self,
  cmd 
)

Pass commands to the network provider's CLI, if it has its own.

Preferably, the behavior should follow the same pattern as Ravel's application sub-shells, which executes a command is one is given, otherwise loop in the CLI on an empty input

Parameters
cmdthe command run within the provider's CLI
def ravel.network.NetworkProvider.removeHost (   self,
  msg 
)

Remove a host from the topology.

Parameters
msga RemoveHostMessage object
def ravel.network.NetworkProvider.removeLink (   self,
  msg 
)

Remove a link from the topology.

Parameters
msga RemoveLinkMessage object
def ravel.network.NetworkProvider.removeSwitch (   self,
  msg 
)

Remove a switch from the topology.

Parameters
msga RemoveSwitchMessage object

The documentation for this class was generated from the following file: