git://git.onelab.eu
/
nepi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0016ed7
)
Adding help and background class atrributes to ResourceManager
author
Alina Quereilhac
<alina.quereilhac@inria.fr>
Thu, 26 Sep 2013 13:03:08 +0000
(15:03 +0200)
committer
Alina Quereilhac
<alina.quereilhac@inria.fr>
Thu, 26 Sep 2013 13:03:08 +0000
(15:03 +0200)
12 files changed:
src/nepi/execution/resource.py
patch
|
blob
|
history
src/nepi/resources/all/collector.py
patch
|
blob
|
history
src/nepi/resources/linux/application.py
patch
|
blob
|
history
src/nepi/resources/linux/channel.py
patch
|
blob
|
history
src/nepi/resources/linux/interface.py
patch
|
blob
|
history
src/nepi/resources/linux/node.py
patch
|
blob
|
history
src/nepi/resources/linux/udptunnel.py
patch
|
blob
|
history
src/nepi/resources/planetlab/node.py
patch
|
blob
|
history
src/nepi/resources/planetlab/openvswitch/ovs.py
patch
|
blob
|
history
src/nepi/resources/planetlab/openvswitch/ovsport.py
patch
|
blob
|
history
src/nepi/resources/planetlab/tap.py
patch
|
blob
|
history
src/nepi/resources/planetlab/tun.py
patch
|
blob
|
history
diff --git
a/src/nepi/execution/resource.py
b/src/nepi/execution/resource.py
index
95e31ff
..
a9087ae
100644
(file)
--- a/
src/nepi/execution/resource.py
+++ b/
src/nepi/execution/resource.py
@@
-83,9
+83,22
@@
def clsinit_copy(cls):
# Decorator to invoke class initialization method
@clsinit
class ResourceManager(Logger):
# 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
_rtype = "Resource"
_attributes = None
_traces = None
+ _help = None
+ _backend = None
@classmethod
def _register_attribute(cls, attr):
@classmethod
def _register_attribute(cls, attr):
@@
-187,6
+200,21
@@
class ResourceManager(Logger):
"""
return copy.deepcopy(cls._traces.values())
"""
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())
def __init__(self, ec, guid):
super(ResourceManager, self).__init__(self.rtype())
diff --git
a/src/nepi/resources/all/collector.py
b/src/nepi/resources/all/collector.py
index
6101cdd
..
812a939
100644
(file)
--- a/
src/nepi/resources/all/collector.py
+++ b/
src/nepi/resources/all/collector.py
@@
-37,11
+37,13
@@
class Collector(ResourceManager):
:type ec: ExperimentController
:param guid: guid of the RM
:type guid: int
: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"
"""
_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):
@classmethod
def _register_attributes(cls):
diff --git
a/src/nepi/resources/linux/application.py
b/src/nepi/resources/linux/application.py
index
f9c46c8
..
4f4b64e
100644
(file)
--- a/
src/nepi/resources/linux/application.py
+++ b/
src/nepi/resources/linux/application.py
@@
-82,6
+82,9
@@
class LinuxApplication(ResourceManager):
"""
_rtype = "LinuxApplication"
"""
_rtype = "LinuxApplication"
+ _help = "Runs an application on a Linux host with a BASH command "
+ _backend_type = "linux"
+
@classmethod
def _register_attributes(cls):
@classmethod
def _register_attributes(cls):
diff --git
a/src/nepi/resources/linux/channel.py
b/src/nepi/resources/linux/channel.py
index
679a36d
..
2ed5c01
100644
(file)
--- a/
src/nepi/resources/linux/channel.py
+++ b/
src/nepi/resources/linux/channel.py
@@
-23,6
+23,8
@@
from nepi.execution.resource import ResourceManager, clsinit, ResourceState
@clsinit
class LinuxChannel(ResourceManager):
_rtype = "LinuxChannel"
@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)
def __init__(self, ec, guid):
super(LinuxChannel, self).__init__(ec, guid)
diff --git
a/src/nepi/resources/linux/interface.py
b/src/nepi/resources/linux/interface.py
index
f5f7025
..
26a1549
100644
(file)
--- a/
src/nepi/resources/linux/interface.py
+++ b/
src/nepi/resources/linux/interface.py
@@
-36,6
+36,8
@@
import time
@clsinit
class LinuxInterface(ResourceManager):
_rtype = "LinuxInterface"
@clsinit
class LinuxInterface(ResourceManager):
_rtype = "LinuxInterface"
+ _help = "Controls network devices on Linux hosts through the ifconfig tool"
+ _backend = "linux"
@classmethod
def _register_attributes(cls):
@classmethod
def _register_attributes(cls):
diff --git
a/src/nepi/resources/linux/node.py
b/src/nepi/resources/linux/node.py
index
d71d21f
..
b50d7fa
100644
(file)
--- a/
src/nepi/resources/linux/node.py
+++ b/
src/nepi/resources/linux/node.py
@@
-142,6
+142,9
@@
class LinuxNode(ResourceManager):
"""
_rtype = "LinuxNode"
"""
_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):
@classmethod
def _register_attributes(cls):
diff --git
a/src/nepi/resources/linux/udptunnel.py
b/src/nepi/resources/linux/udptunnel.py
index
1d23736
..
82f0139
100644
(file)
--- a/
src/nepi/resources/linux/udptunnel.py
+++ b/
src/nepi/resources/linux/udptunnel.py
@@
-31,6
+31,9
@@
import time
@clsinit_copy
class UdpTunnel(LinuxApplication):
_rtype = "UdpTunnel"
@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):
@classmethod
def _register_attributes(cls):
diff --git
a/src/nepi/resources/planetlab/node.py
b/src/nepi/resources/planetlab/node.py
index
55464d3
..
3cd5b54
100644
(file)
--- a/
src/nepi/resources/planetlab/node.py
+++ b/
src/nepi/resources/planetlab/node.py
@@
-32,6
+32,9
@@
import threading
@clsinit_copy
class PlanetlabNode(LinuxNode):
_rtype = "PlanetlabNode"
@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()
blacklist = list()
provisionlist = list()
diff --git
a/src/nepi/resources/planetlab/openvswitch/ovs.py
b/src/nepi/resources/planetlab/openvswitch/ovs.py
index
e8b8011
..
bffc61e
100644
(file)
--- a/
src/nepi/resources/planetlab/openvswitch/ovs.py
+++ b/
src/nepi/resources/planetlab/openvswitch/ovs.py
@@
-31,6
+31,9
@@
reschedule_delay = "0.5s"
class OVSWitch(LinuxApplication):
_rtype = "OVSWitch"
class OVSWitch(LinuxApplication):
_rtype = "OVSWitch"
+ _help = "Runs an OpenVSwitch on a PlanetLab host"
+ _backend = "planetlab"
+
_authorized_connections = ["PlanetlabNode", "OVSPort", "LinuxNode"]
@classmethod
_authorized_connections = ["PlanetlabNode", "OVSPort", "LinuxNode"]
@classmethod
@@
-58,8
+61,6
@@
class OVSWitch(LinuxApplication):
:type ec: ExperimentController
:param guid: guid of the RM
:type guid: int
: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)
"""
super(OVSWitch, self).__init__(ec, guid)
diff --git
a/src/nepi/resources/planetlab/openvswitch/ovsport.py
b/src/nepi/resources/planetlab/openvswitch/ovsport.py
index
426ad97
..
d3e9d79
100644
(file)
--- a/
src/nepi/resources/planetlab/openvswitch/ovsport.py
+++ b/
src/nepi/resources/planetlab/openvswitch/ovsport.py
@@
-35,12
+35,13
@@
class OVSPort(LinuxApplication):
:type ec: ExperimentController
:param guid: guid of the RM
:type guid: int
: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"
"""
_rtype = "OVSPort"
+ _help = "Runs an OpenVSwitch on a PlanetLab host"
+ _backend = "planetlab"
+
_authorized_connections = ["OVSWitch", "Tunnel"]
@classmethod
_authorized_connections = ["OVSWitch", "Tunnel"]
@classmethod
diff --git
a/src/nepi/resources/planetlab/tap.py
b/src/nepi/resources/planetlab/tap.py
index
411eb51
..
c4867b2
100644
(file)
--- a/
src/nepi/resources/planetlab/tap.py
+++ b/
src/nepi/resources/planetlab/tap.py
@@
-36,6
+36,8
@@
PYTHON_VSYS_VERSION = "1.0"
@clsinit_copy
class PlanetlabTap(LinuxApplication):
_rtype = "PlanetlabTap"
@clsinit_copy
class PlanetlabTap(LinuxApplication):
_rtype = "PlanetlabTap"
+ _help = "Creates a TAP device on a PlanetLab host"
+ _backend = "planetlab"
@classmethod
def _register_attributes(cls):
@classmethod
def _register_attributes(cls):
diff --git
a/src/nepi/resources/planetlab/tun.py
b/src/nepi/resources/planetlab/tun.py
index
8d66210
..
cdd3a3b
100644
(file)
--- a/
src/nepi/resources/planetlab/tun.py
+++ b/
src/nepi/resources/planetlab/tun.py
@@
-25,6
+25,8
@@
import os
@clsinit_copy
class PlanetlabTun(PlanetlabTap):
_rtype = "PlanetlabTun"
@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)
def __init__(self, ec, guid):
super(PlanetlabTun, self).__init__(ec, guid)