2 # NEPI, a framework to manage network experiments
3 # Copyright (C) 2013 INRIA
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License version 2 as
7 # published by the Free Software Foundation;
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Author: Julien Tribino <julien.tribino@inria.fr>
18 # Lucia Guevgeozian <lucia.guevgeozian_odizzio@inria.fr>
20 from nepi.execution.attribute import Attribute, Flags, Types
21 from nepi.execution.resource import ResourceManager, clsinit_copy, \
25 class ResourceGateway:
27 Dictionary used to set OMF gateway depending on Testbed information.
29 #XXX: A.Q. COMMENT: This looks a bit hardcoded
30 # SHOULDN'T THIS BE IN A SEPARATED FILE RATHER THAN IN THE
31 # BASE CLASS FOR ALL OMF RESOURCES?
32 TestbedtoGateway = dict({
33 "wilabt" : "ops.wilab2.ilabt.iminds.be",
34 "nitos" : "nitlab.inf.uth.gr",
39 "am.wilab2.ilabt.iminds.be" : "ops.wilab2.ilabt.iminds.be",
40 "nitlab.inf.uth.gr" : "nitlab.inf.uth.gr",
45 class OMFResource(ResourceManager):
47 Generic resource gathering XMPP credential information and common methods
48 for OMF nodes, channels, applications, etc.
50 _rtype = "abstract::omf::Resource"
54 def _register_attributes(cls):
56 xmppServer = Attribute("xmppServer", "Xmpp Server",
57 flags = Flags.Credential)
58 xmppUser = Attribute("xmppUser","Name of the Xmpp User/Slice",
59 flags = Flags.Credential)
60 xmppPort = Attribute("xmppPort", "Xmpp Port",
61 flags = Flags.Credential)
62 xmppPassword = Attribute("xmppPassword", "Xmpp Password",
63 flags = Flags.Credential)
64 version = Attribute("version", "Version of OMF : Either 5 or 6",
67 cls._register_attribute(xmppUser)
68 cls._register_attribute(xmppServer)
69 cls._register_attribute(xmppPort)
70 cls._register_attribute(xmppPassword)
71 cls._register_attribute(version)
73 def __init__(self, ec, guid):
74 super(OMFResource, self).__init__(ec, guid)