import json
import networkx
-logging.basicConfig(level=logging.INFO)
+logging.basicConfig(level=logging.DEBUG)
CORS_HEADER = {'Access-Control-Allow-Origin': '*'}
# no check if vnfs are really connected to this datacenter...
try:
# check json payload
- logging.debug("json: {}".format(request.json))
- logging.debug("args: {}".format(request.args))
+ logging.info("json: {}".format(request.json))
+ logging.info("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")
priority=args.get("priority"))
response = put("{0}/restapi/network".format(args.get("endpoint")),
- json=params)
+ params=params)
pp.pprint(response.text)
def remove(self, args):
priority=args.get("priority"))
response = delete("{0}/restapi/network".format(args.get("endpoint")),
- json=params)
+ params=params)
pp.pprint(response.text)
def _parse_vnf_name(self, vnf_name_str):