# no check if vnfs are really connected to this datacenter...
try:
- # get URL parameters
- data = request.args
- #then no data
+ # check json payload
+ logging.debug("json: {}".format(request.json))
+ logging.debug("args: {}".format(request.args))
+
+ data = request.json
+ if data is None:
+ data = request.args
if data is None:
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")
# 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
- # then no data
+ if data is None:
+ data = request.args
if data is None:
data = {}
- 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")
priority=args.get("priority"))
response = delete("{0}/restapi/network".format(args.get("endpoint")),
- params=params)
+ params=params)
pp.pprint(response.text)
def _parse_vnf_name(self, vnf_name_str):