From 890dee4d60a5864c03e133ec03cc0a498dd16c50 Mon Sep 17 00:00:00 2001 From: Ciro Scognamiglio Date: Fri, 3 Oct 2014 15:42:03 +0200 Subject: [PATCH] activity monitor on resources --- manifoldapi/manifoldproxy.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/manifoldapi/manifoldproxy.py b/manifoldapi/manifoldproxy.py index 433a854b..b47b998f 100644 --- a/manifoldapi/manifoldproxy.py +++ b/manifoldapi/manifoldproxy.py @@ -13,6 +13,9 @@ from manifoldresult import ManifoldException from manifold.util.log import Log from myslice.configengine import ConfigEngine +# register activity +import activity.slice + debug=False #debug=True @@ -78,7 +81,15 @@ with the query passed using POST""" if 'description' in result and result['description'] \ and isinstance(result['description'], (tuple, list, set, frozenset)): result [ 'description' ] = [ ResultValue.to_html (x) for x in result['description'] ] - + + # + # register activity + # + # resource reservation + if (manifold_query.action.lower() == 'update') : + for resources in result['value'][0]['resources'] : + activity.slice.resource(request, { 'slice' : result['value'][0]['slice_hrn'], 'resource' : result['value'][0]}) + json_answer=json.dumps(result) return HttpResponse (json_answer, mimetype="application/json") -- 2.43.0