Fixing get_ip and do_ping method PLnode
[nepi.git] / src / nepi / resources / omf / omf_resource.py
1 #
2 #    NEPI, a framework to manage network experiments
3 #    Copyright (C) 2013 INRIA
4 #
5 #    This program is free software: you can redistribute it and/or modify
6 #    it under the terms of the GNU General Public License as published by
7 #    the Free Software Foundation, either version 3 of the License, or
8 #    (at your option) any later version.
9 #
10 #    This program is distributed in the hope that it will be useful,
11 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 #    GNU General Public License for more details.
14 #
15 #    You should have received a copy of the GNU General Public License
16 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 #
18 # Author: Julien Tribino <julien.tribino@inria.fr>
19 #         Lucia Guevgeozian <lucia.guevgeozian_odizzio@inria.fr>
20
21 from nepi.execution.attribute import Attribute, Flags, Types
22 from nepi.execution.resource import ResourceManager, clsinit, ResourceState, \
23         reschedule_delay
24
25 class ResourceGateway:
26     """
27     Dictionary used to set OMF gateway depending on Testbed information.
28     """
29     TestbedtoGateway = dict({
30         "wilabt" : "ops.wilab2.ilabt.iminds.be",
31         "nitos" : "nitlab.inf.uth.gr",
32         "nicta" : "??.??.??",
33
34     })
35
36 @clsinit
37 class OMFResource(ResourceManager):
38     """
39     Generic resource gathering XMPP credential information and common methods
40     for OMF nodes, channels, applications, etc.
41     """
42     _rtype = "OMFResource"
43
44     @classmethod
45     def _register_attributes(cls):
46
47         xmppSlice = Attribute("xmppSlice","Name of the slice", 
48             flags = Flags.Credential)
49         xmppHost = Attribute("xmppHost", "Xmpp Server",
50             flags = Flags.Credential)
51         xmppPort = Attribute("xmppPort", "Xmpp Port",
52             flags = Flags.Credential)
53         xmppPassword = Attribute("xmppPassword", "Xmpp Password",
54                 flags = Flags.Credential)
55
56         cls._register_attribute(xmppSlice)
57         cls._register_attribute(xmppHost)
58         cls._register_attribute(xmppPort)
59         cls._register_attribute(xmppPassword)
60
61     def __init__(self, ec, guid):
62         super(OMFResource, self).__init__(ec, guid)
63         pass
64