X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Femuvim%2Fapi%2Fzerorpc%2Fnetwork.py;h=e5d5ca0a25ff2eab9f52663e17d6b01e67af9d51;hb=a1e59c710ed694b97cb4aed76af6e8ee34a7bfbe;hp=ac17e25393a175cae51697024ba6a001554a701a;hpb=1cbad5fddca5a204ac4c2c6a5ba1e9df949f1dd6;p=osm%2Fvim-emu.git diff --git a/src/emuvim/api/zerorpc/network.py b/src/emuvim/api/zerorpc/network.py index ac17e25..e5d5ca0 100644 --- a/src/emuvim/api/zerorpc/network.py +++ b/src/emuvim/api/zerorpc/network.py @@ -64,27 +64,35 @@ class DCNetworkApi(object): def __init__(self, net): self.net = net - def network_action_start(self, vnf_src_name, vnf_dst_name, vnf_src_interface=None, vnf_dst_interface=None): + def network_action_start(self, vnf_src_name, vnf_dst_name, kwargs): # call DCNetwork method, not really datacenter specific API for now... # provided dc name needs to be part of API endpoint # no check if vnfs are really connected to this datacenter... logging.debug("RPC CALL: network chain start") try: c = self.net.setChain( - vnf_src_name, vnf_dst_name, vnf_src_interface, vnf_dst_interface) + vnf_src_name, vnf_dst_name, + vnf_src_interface=kwargs.get('vnf_src_interface'), + vnf_dst_interface=kwargs.get('vnf_dst_interface'), + weight=kwargs.get('weight'), + match=kwargs.get('match')) return str(c) except Exception as ex: logging.exception("RPC error.") return ex.message - def network_action_stop(self, vnf_src_name, vnf_dst_name, vnf_src_interface=None, vnf_dst_interface=None): + def network_action_stop(self, vnf_src_name, vnf_dst_name, vnf_src_interface=None, vnf_dst_interface=None, weight=None): # call DCNetwork method, not really datacenter specific API for now... # provided dc name needs to be part of API endpoint # no check if vnfs are really connected to this datacenter... logging.debug("RPC CALL: network chain stop") try: c = self.net.setChain( - vnf_src_name, vnf_dst_name, vnf_src_interface, vnf_dst_interface, cmd='del-flows') + vnf_src_name, vnf_dst_name, + vnf_src_interface=vnf_src_interface, + vnf_dst_interface=vnf_dst_interface, + cmd='del-flows', + weight=weight) return c except Exception as ex: logging.exception("RPC error.") @@ -102,11 +110,13 @@ class DCNetworkApi(object): # remove the rate measurement for a vnf interface def stop_metric(self, vnf_name, vnf_interface, metric): - logging.debug("RPC CALL: setup metric") + logging.debug("RPC CALL: stop metric") try: - c = self.net.monitor_agent.remove_metric(vnf_name, vnf_interface, metric) + c = self.net.monitor_agent.stop_metric(vnf_name, vnf_interface, metric) return c except Exception as ex: logging.exception("RPC error.") return ex.message + +