acknowledge the contributions of their colleagues of the SONATA
partner consortium (www.sonata-nfv.eu).
"""
+
+"""
+Distributed Cloud Emulator (dcemulator)
+Networking and monitoring functions
+(c) 2015 by Steven Van Rossem <steven.vanrossem@intec.ugent.be>
+"""
+
import logging
from flask_restful import Resource
from flask import request
"""
global net
- def put(self, vnf_name, vnf_interface, metric):
+ def put(self, vnf_name, vnf_interface=None, metric='tx_packets'):
logging.debug("REST CALL: start monitor VNF interface")
try:
c = net.monitor_agent.setup_metric(vnf_name, vnf_interface, metric)
logging.exception("API error.")
return ex.message, 500
- def delete(self, vnf_name, vnf_interface, metric):
+ def delete(self, vnf_name, vnf_interface=None, metric='tx_packets'):
logging.debug("REST CALL: stop monitor VNF interface")
try:
c = net.monitor_agent.stop_metric(vnf_name, vnf_interface, metric)
"""
global net
- def put(self, vnf_name, vnf_interface, metric, cookie):
+ def put(self, vnf_name, vnf_interface=None, metric='tx_packets', cookie=0):
logging.debug("REST CALL: start monitor VNF interface")
try:
c = net.monitor_agent.setup_flow(vnf_name, vnf_interface, metric, cookie)
logging.exception("API error.")
return ex.message, 500
- def delete(self, vnf_name, vnf_interface, metric, cookie):
+ def delete(self, vnf_name, vnf_interface=None, metric='tx_packets', cookie=0):
logging.debug("REST CALL: stop monitor VNF interface")
try:
c = net.monitor_agent.stop_flow(vnf_name, vnf_interface, metric, cookie)