# Decorator to invoke class initialization method
@clsinit
class ResourceManager(Logger):
+ """ Base clase for all ResourceManagers.
+
+ A ResourceManger is specific to a resource type (e.g. Node,
+ Switch, Application, etc) on a specific backend (e.g. PlanetLab,
+ OMF, etc).
+
+ The ResourceManager instances are responsible for interacting with
+ and controlling concrete (physical or virtual) resources in the
+ experimental backends.
+
+ """
_rtype = "Resource"
_attributes = None
_traces = None
+ _help = None
+ _backend = None
@classmethod
def _register_attribute(cls, attr):
"""
return copy.deepcopy(cls._traces.values())
+ @classmethod
+ def get_help(cls):
+ """ Returns the description of the type of Resource
+
+ """
+ return cls._help
+
+ @classmethod
+ def get_backend(cls):
+ """ Returns the identified of the backend (i.e. testbed, environment)
+ for the Resource
+
+ """
+ return cls._backend
+
def __init__(self, ec, guid):
super(ResourceManager, self).__init__(self.rtype())
:type ec: ExperimentController
:param guid: guid of the RM
:type guid: int
- :param creds: Credentials to communicate with the rm (XmppClient)
- :type creds: dict
"""
_rtype = "Collector"
+ _help = "A Collector can be attached to a trace name on another " \
+ "ResourceManager and will retrieve and store the trace content " \
+ "in a local file at the end of the experiment"
+ _backend_type = "all"
@classmethod
def _register_attributes(cls):
"""
_rtype = "LinuxApplication"
+ _help = "Runs an application on a Linux host with a BASH command "
+ _backend_type = "linux"
+
@classmethod
def _register_attributes(cls):
@clsinit
class LinuxChannel(ResourceManager):
_rtype = "LinuxChannel"
+ _help = "Represents a wireless channel on a network of Linux hosts"
+ _backend = "linux"
def __init__(self, ec, guid):
super(LinuxChannel, self).__init__(ec, guid)
@clsinit
class LinuxInterface(ResourceManager):
_rtype = "LinuxInterface"
+ _help = "Controls network devices on Linux hosts through the ifconfig tool"
+ _backend = "linux"
@classmethod
def _register_attributes(cls):
"""
_rtype = "LinuxNode"
+ _help = "Controls Linux host machines ( either localhost or a host " \
+ "that can be accessed using a SSH key)"
+ _backend_type = "linux"
@classmethod
def _register_attributes(cls):
@clsinit_copy
class UdpTunnel(LinuxApplication):
_rtype = "UdpTunnel"
+ _help = "Constructs a tunnel between two Linux endpoints using a UDP connection "
+ _backend = "linux"
+
@classmethod
def _register_attributes(cls):
@clsinit_copy
class PlanetlabNode(LinuxNode):
_rtype = "PlanetlabNode"
+ _help = "Controls a PlanetLab host accessible using a SSH key " \
+ "associated to a PlanetLab user account"
+ _backend = "planetlab"
blacklist = list()
provisionlist = list()
class OVSWitch(LinuxApplication):
_rtype = "OVSWitch"
+ _help = "Runs an OpenVSwitch on a PlanetLab host"
+ _backend = "planetlab"
+
_authorized_connections = ["PlanetlabNode", "OVSPort", "LinuxNode"]
@classmethod
:type ec: ExperimentController
:param guid: guid of the RM
:type guid: int
- :param creds: Credentials to communicate with the rm
- :type creds: dict
"""
super(OVSWitch, self).__init__(ec, guid)
:type ec: ExperimentController
:param guid: guid of the RM
:type guid: int
- :param creds: Credentials to communicate with the rm
- :type creds: dict
"""
_rtype = "OVSPort"
+ _help = "Runs an OpenVSwitch on a PlanetLab host"
+ _backend = "planetlab"
+
_authorized_connections = ["OVSWitch", "Tunnel"]
@classmethod
@clsinit_copy
class PlanetlabTap(LinuxApplication):
_rtype = "PlanetlabTap"
+ _help = "Creates a TAP device on a PlanetLab host"
+ _backend = "planetlab"
@classmethod
def _register_attributes(cls):
@clsinit_copy
class PlanetlabTun(PlanetlabTap):
_rtype = "PlanetlabTun"
+ _help = "Creates a TUN device on a PlanetLab host"
+ _backend = "planetlab"
def __init__(self, ec, guid):
super(PlanetlabTun, self).__init__(ec, guid)