0ca5962a6a6d4ed07abdcf231d78df2d6070784d
[nepi.git] / src / nepi / resources / omf / xx_omf_resource.py
1 #!/usr/bin/env python
2 from nepi.execution.resource import ResourceManager, clsinit
3 from nepi.execution.attribute import Attribute
4
5 from nepi.resources.omf.omf_api import OMFAPIFactory
6
7 @clsinit
8 class OMFResource(ResourceManager):
9     _rtype = "OMFResource"
10
11     @classmethod
12     def _register_attributes(cls):
13         xmppSlice = Attribute("xmppSlice","Name of the slice", flags = "0x02")
14         xmppHost = Attribute("xmppHost", "Xmpp Server",flags = "0x02")
15         xmppPort = Attribute("xmppPort", "Xmpp Port",flags = "0x02")
16         xmppPassword = Attribute("xmppPassword", "Xmpp Port",flags = "0x02")
17         cls._register_attribute(xmppSlice)
18         cls._register_attribute(xmppHost)
19         cls._register_attribute(xmppPort)
20         cls._register_attribute(xmppPassword)
21
22     def __init__(self, ec, guid, creds):
23         super(OMFNode, self).__init__(ec, guid)
24         self.set('xmppSlice', creds['xmppSlice'])
25         self.set('xmppHost', creds['xmppHost'])
26         self.set('xmppPort', creds['xmppPort'])
27         self.set('xmppPassword', creds['xmppPassword'])
28
29         self._omf_api = OMFAPIFactory.get_api(self.get('xmppSlice'), self.get('xmppHost'), self.get('xmppPort'), self.get('xmppPassword'))
30
31     def discover(self):
32         pass
33      
34     def provision(self, credential):
35         pass
36
37