X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Femuvim%2Fapi%2Frest%2Fnetwork.py;h=9aab1e606eda51ad56788f8ca2170866c8599b51;hb=c9abfbec5b0e0ae589c8ad66426e207fbe2385b1;hp=28b5c6654c30a27d7090f49e806594d3e426266b;hpb=284ba2b074eecf9cc46867b317d46ab95445b18e;p=osm%2Fvim-emu.git diff --git a/src/emuvim/api/rest/network.py b/src/emuvim/api/rest/network.py index 28b5c66..9aab1e6 100755 --- a/src/emuvim/api/rest/network.py +++ b/src/emuvim/api/rest/network.py @@ -38,7 +38,7 @@ from flask import request import json import networkx -logging.basicConfig(level=logging.INFO) +logging.basicConfig() CORS_HEADER = {'Access-Control-Allow-Origin': '*'} @@ -84,15 +84,12 @@ class NetworkAction(Resource): logging.debug("json: {}".format(request.json)) logging.debug("args: {}".format(request.args)) - # when called directly with curl via REST data = request.json + if data is None: + data = request.args 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") @@ -152,4 +149,4 @@ class DrawD3jsgraph(Resource): links.append(edge_dict) json = {"nodes":nodes, "links":links} - return json, 200, CORS_HEADER \ No newline at end of file + return json, 200, CORS_HEADER