2 # Copyright 2016 RIFT.IO Inc
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
20 class NsmPluginBase(object):
22 Abstract base class for the NSM plugin.
23 There will be single instance of this plugin for each plugin type.
26 def __init__(self
, dts
, log
, loop
, nsm
, plugin_name
, dts_publisher
):
31 self
._plugin
_name
= plugin_name
32 self
._dts
_publisher
= dts_publisher
51 def set_state(self
, nsr_id
, state
):
55 def create_nsr(self
, nsr
, nsd
, key_pairs
=None, ssh_key
=None):
61 def deploy(self
, nsr_msg
):
66 def instantiate_ns(self
, nsr
, xact
):
67 """ Instantiate the network service """
72 def instantiate_vnf(self
, nsr
, vnfr
, scaleout
=False):
73 """ Instantiate the virtual network function """
78 def instantiate_vl(self
, nsr
, vl
):
79 """ Instantiate the virtual link"""
84 def update_vnfr(self
, vnfr
):
85 """ Update the virtual network function record """
90 def get_nsr(self
, nsr_path
):
96 def get_vnfr(self
, vnfr_path
):
102 def get_vlr(self
, vlr_path
):
108 def terminate_ns(self
, nsr
):
109 """Terminate the network service """
114 def terminate_vnf(self
, nsr
, vnfr
, scalein
=False):
115 """Terminate the VNF """
120 def terminate_vl(self
, vlr
):
121 """Terminate the Virtual Link Record"""