X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Femuvim%2Fapi%2Fzerorpc%2Fnetwork.py;h=af11bc3afbb7e47d2201ac138ee1305a8d1cfa67;hb=898a2af8cc32f6814fa3a0971ef71f4936f42171;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..af11bc3 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,18 @@ 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'), + cookie=kwargs.get('cookie')) 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 +91,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 +122,5 @@ class DCNetworkApi(object): logging.exception("RPC error.") return ex.message + +