fix son-emu-cli network/monitor CLI
diff --git a/src/emuvim/api/rest/network.py b/src/emuvim/api/rest/network.py
index 1374373..28b5c66 100755
--- a/src/emuvim/api/rest/network.py
+++ b/src/emuvim/api/rest/network.py
@@ -38,7 +38,7 @@
import json
import networkx
-logging.basicConfig(level=logging.DEBUG)
+logging.basicConfig(level=logging.INFO)
CORS_HEADER = {'Access-Control-Allow-Origin': '*'}
@@ -80,16 +80,19 @@
# call DCNetwork method, not really datacenter specific API for now...
# no check if vnfs are really connected to this datacenter...
try:
- # check if json data is a dict
- data = request.args
- # try json payload
+ # check json payload
+ logging.debug("json: {}".format(request.json))
+ logging.debug("args: {}".format(request.args))
+
+ # when called directly with curl via REST
data = request.json
- # then no data
if data is None:
data = {}
+ # check if json data is a dict
elif type(data) is not dict:
data = json.loads(request.json)
+ logging.info("data: {}".format(data))
vnf_src_name = data.get("vnf_src_name")
vnf_dst_name = data.get("vnf_dst_name")
vnf_src_interface = data.get("vnf_src_interface")