X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Femuvim%2Fapi%2Fzerorpc%2Fnetwork.py;h=78083b011d974cdc86b32639df7307c709f443c7;hb=23c480906da46931b6f4350f3fb434a89f49227a;hp=116d13b018eb771aaf221d19b52204e1238a73ca;hpb=d31e5d2016a61817381d109301086cb94a783ec4;p=osm%2Fvim-emu.git diff --git a/src/emuvim/api/zerorpc/network.py b/src/emuvim/api/zerorpc/network.py index 116d13b..78083b0 100644 --- a/src/emuvim/api/zerorpc/network.py +++ b/src/emuvim/api/zerorpc/network.py @@ -64,7 +64,7 @@ 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, weight=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... @@ -72,15 +72,17 @@ class DCNetworkApi(object): try: c = self.net.setChain( vnf_src_name, vnf_dst_name, - vnf_src_interface=vnf_src_interface, - vnf_dst_interface=vnf_dst_interface, - weight=weight) + 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, weight=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... @@ -88,10 +90,12 @@ class DCNetworkApi(object): try: c = self.net.setChain( vnf_src_name, vnf_dst_name, - vnf_src_interface=vnf_src_interface, - vnf_dst_interface=vnf_dst_interface, + vnf_src_interface=kwargs.get('vnf_src_interface'), + vnf_dst_interface=kwargs.get('vnf_dst_interface'), cmd='del-flows', - weight=weight) + weight=kwargs.get('weight'), + match=kwargs.get('match'), + bidirectional=kwargs.get('bidirectional')) return c except Exception as ex: logging.exception("RPC error.") @@ -117,3 +121,5 @@ class DCNetworkApi(object): logging.exception("RPC error.") return ex.message + +