# 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")
# no check if vnfs are really connected to this datacenter...
try:
# check json payload
- logging.info("json: {}".format(request.json))
- logging.info("args: {}".format(request.args))
+ 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
metric = args.get("metric"))
url = "{0}/restapi/monitor/interface".format(args.get("endpoint"))
- response = put(url, json=params)
+ response = put(url, params=params)
pp.pprint(response.text)
def stop_metric(self, args):
metric=args.get("metric"))
url = "{0}/restapi/monitor/interface".format(args.get("endpoint"))
- response = put(url, json=params)
+ response = put(url, params=params)
pp.pprint(response.text)
def setup_flow(self, args):
cookie=args.get("cookie"))
url = "{0}/restapi/monitor/flow".format(args.get("endpoint"))
- response = put(url, json=params)
+ response = put(url, params=params)
pp.pprint(response.text)
def stop_flow(self, args):
cookie=args.get("cookie"))
url = "{0}/restapi/monitor/flow".format(args.get("endpoint"))
- response = put(url, json=params)
+ response = put(url, params=params)
pp.pprint(response.text)
def prometheus(self, args):