#!/usr/bin/env python from neco.execution.resource import ResourceManager, clsinit from neco.execution.attribute import Attribute from neco.resources.omf.omf_api import OMFAPIFactory @clsinit class OMFResource(ResourceManager): _rtype = "OMFResource" @classmethod def _register_attributes(cls): xmppSlice = Attribute("xmppSlice","Name of the slice", flags = "0x02") xmppHost = Attribute("xmppHost", "Xmpp Server",flags = "0x02") xmppPort = Attribute("xmppPort", "Xmpp Port",flags = "0x02") xmppPassword = Attribute("xmppPassword", "Xmpp Port",flags = "0x02") cls._register_attribute(xmppSlice) cls._register_attribute(xmppHost) cls._register_attribute(xmppPort) cls._register_attribute(xmppPassword) def __init__(self, ec, guid, creds): super(OMFNode, self).__init__(ec, guid) self.set('xmppSlice', creds['xmppSlice']) self.set('xmppHost', creds['xmppHost']) self.set('xmppPort', creds['xmppPort']) self.set('xmppPassword', creds['xmppPassword']) self._omf_api = OMFAPIFactory.get_api(self.get('xmppSlice'), self.get('xmppHost'), self.get('xmppPort'), self.get('xmppPassword')) def discover(self): pass def provision(self, credential): pass