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 as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
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.
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/>.
20 from nepi.execution.resource import ResourceManager, clsinit
21 from nepi.execution.attribute import Attribute
23 from nepi.resources.omf.omf_api import OMFAPIFactory
26 class OMFResource(ResourceManager):
27 _rtype = "OMFResource"
30 def _register_attributes(cls):
31 xmppSlice = Attribute("xmppSlice","Name of the slice", flags = "0x02")
32 xmppHost = Attribute("xmppHost", "Xmpp Server",flags = "0x02")
33 xmppPort = Attribute("xmppPort", "Xmpp Port",flags = "0x02")
34 xmppPassword = Attribute("xmppPassword", "Xmpp Port",flags = "0x02")
35 cls._register_attribute(xmppSlice)
36 cls._register_attribute(xmppHost)
37 cls._register_attribute(xmppPort)
38 cls._register_attribute(xmppPassword)
40 def __init__(self, ec, guid, creds):
41 super(OMFNode, self).__init__(ec, guid)
42 self.set('xmppSlice', creds['xmppSlice'])
43 self.set('xmppHost', creds['xmppHost'])
44 self.set('xmppPort', creds['xmppPort'])
45 self.set('xmppPassword', creds['xmppPassword'])
47 self._omf_api = OMFAPIFactory.get_api(self.get('xmppSlice'), self.get('xmppHost'), self.get('xmppPort'), self.get('xmppPassword'))
52 def provision(self, credential):