projects
/
osm
/
vim-emu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added HEAT GET /resources endpoint (returns empty list for now)
[osm/vim-emu.git]
/
src
/
emuvim
/
api
/
rest
/
network.py
diff --git
a/src/emuvim/api/rest/network.py
b/src/emuvim/api/rest/network.py
index
84db87e
..
9aab1e6
100755
(executable)
--- 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
import json
import networkx
-logging.basicConfig(
level=logging.INFO
)
+logging.basicConfig()
CORS_HEADER = {'Access-Control-Allow-Origin': '*'}
CORS_HEADER = {'Access-Control-Allow-Origin': '*'}
@@
-80,16
+80,15
@@
class NetworkAction(Resource):
# call DCNetwork method, not really datacenter specific API for now...
# no check if vnfs are really connected to this datacenter...
try:
# 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))
+
+ data = request.json
if data is None:
if data is None:
- data = request.json
- # then no data
+ data = request.args
if data is None:
data = {}
if data is None:
data = {}
- elif type(data) is not dict:
- data = json.loads(request.json)
vnf_src_name = data.get("vnf_src_name")
vnf_dst_name = data.get("vnf_dst_name")
vnf_src_name = data.get("vnf_src_name")
vnf_dst_name = data.get("vnf_dst_name")
@@
-150,4
+149,4
@@
class DrawD3jsgraph(Resource):
links.append(edge_dict)
json = {"nodes":nodes, "links":links}
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