X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Femuvim%2Fapi%2Fzerorpc%2Fnetwork.py;h=78083b011d974cdc86b32639df7307c709f443c7;hb=23c480906da46931b6f4350f3fb434a89f49227a;hp=827842297da5b78960980af7749c52a7f3a962c8;hpb=300e1e54aefeace41e0f2785c82daccb3dc50357;p=osm%2Fvim-emu.git diff --git a/src/emuvim/api/zerorpc/network.py b/src/emuvim/api/zerorpc/network.py index 8278422..78083b0 100644 --- a/src/emuvim/api/zerorpc/network.py +++ b/src/emuvim/api/zerorpc/network.py @@ -64,27 +64,38 @@ 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'), + bidirectional=kwargs.get('bidirectional')) 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, 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 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=kwargs.get('vnf_src_interface'), + vnf_dst_interface=kwargs.get('vnf_dst_interface'), + cmd='del-flows', + weight=kwargs.get('weight'), + match=kwargs.get('match'), + bidirectional=kwargs.get('bidirectional')) return c except Exception as ex: logging.exception("RPC error.") @@ -110,3 +121,5 @@ class DCNetworkApi(object): logging.exception("RPC error.") return ex.message + +