-
-class RwNsPlugin(rwnsmplugin.NsmPluginBase):
- """
- RW Implentation of the NsmPluginBase
- """
- def __init__(self, dts, log, loop, publisher, ro_account):
- self._dts = dts
- self._log = log
- self._loop = loop
-
- def set_state(self, nsr_id, state):
- pass
-
- def create_nsr(self, nsr_msg, nsd,key_pairs=None):
- """
- Create Network service record
- """
- pass
-
- @asyncio.coroutine
- def deploy(self, nsr):
- pass
-
- @asyncio.coroutine
- def instantiate_ns(self, nsr, config_xact):
- """
- Instantiate NSR with the passed nsr id
- """
- yield from nsr.instantiate(config_xact)
-
- @asyncio.coroutine
- def instantiate_vnf(self, nsr, vnfr, scaleout=False):
- """
- Instantiate NSR with the passed nsr id
- """
- yield from vnfr.instantiate(nsr)
-
- @asyncio.coroutine
- def instantiate_vl(self, nsr, vlr):
- """
- Instantiate NSR with the passed nsr id
- """
- yield from vlr.instantiate()
-
- @asyncio.coroutine
- def terminate_ns(self, nsr):
- """
- Terminate the network service
- """
- pass
-
- @asyncio.coroutine
- def terminate_vnf(self, vnfr):
- """
- Terminate the network service
- """
- yield from vnfr.terminate()
-
- @asyncio.coroutine
- def terminate_vl(self, vlr):
- """
- Terminate the virtual link
- """
- yield from vlr.terminate()
-
-
-class NsmPlugins(object):
- """ NSM Plugins """
- def __init__(self):
- self._plugin_classes = {
- "openmano": openmano_nsm.OpenmanoNsPlugin,
- }
-
- @property
- def plugins(self):
- """ Plugin info """
- return self._plugin_classes
-
- def __getitem__(self, name):
- """ Get item """
- print("%s", self._plugin_classes)
- return self._plugin_classes[name]
-
- def register(self, plugin_name, plugin_class, *args):
- """ Register a plugin to this Nsm"""
- self._plugin_classes[plugin_name] = plugin_class
-
- def deregister(self, plugin_name, plugin_class, *args):
- """ Deregister a plugin to this Nsm"""
- if plugin_name in self._plugin_classes:
- del self._plugin_classes[plugin_name]
-
- def class_by_plugin_name(self, name):
- """ Get class by plugin name """
- return self._plugin_classes[name]
-
-