X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=manifoldapi%2Fmanifoldproxy.py;fp=manifoldapi%2Fmanifoldproxy.py;h=9897b5064150fb8d4885d251990910477e8e0093;hb=bb98f1e7f4d1d2692b0405377c8f7c7466d72aee;hp=433a854b57152d40b9ed96be88a4319c87416d12;hpb=22d09f122df0baa7f9d033e687b0422ea12b0e07;p=myslice.git diff --git a/manifoldapi/manifoldproxy.py b/manifoldapi/manifoldproxy.py index 433a854b..9897b506 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,26 @@ 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'] ] - + + print "=> MANIFOLD PROXY executing: " + manifold_query.action.lower() + # + # register activity + # + # resource reservation + if (manifold_query.action.lower() == 'update') : + print result['value'][0] + if 'resource' in result['value'][0] : + for resource in result['value'][0]['resource'] : + activity.slice.resource(request, + { + 'slice' : result['value'][0]['slice_hrn'], + 'resource' : resource['hostname'], + 'resource_type' : resource['type'], + 'facility' : resource['facility_name'], + 'testbed' : resource['testbed_name'] + } + ) + json_answer=json.dumps(result) return HttpResponse (json_answer, mimetype="application/json")