"apikey" : apikey,
"signature" : sign(secret, "%s%s%s%s" % (timestamp, ip, request.user, action)),
"slice" : None,
- "resource" : None
+ "resource" : None,
+ "resource_type" : None,
+ "facility" : None,
+ "testbed" : None,
}
- if objects and 'slice' in objects :
- log['slice'] = objects['slice']
-
- if objects and 'resource' in objects :
- log['resource'] = objects['resource']
+ for o in objects :
+ if (o in log) :
+ log[o] = objects[o]
try :
result = urllib2.urlopen(server, urllib.urlencode(log))
- print "===============>> activity: " + action + " <" + request.user + "> " + message
+ print "===============>> activity: %s <%s> %s" % (action, request.user,message)
content = result.read()
except urllib2.URLError as e:
print "===============>> activity: connection to " + server + " impossible, could not log action"
+ print "==>> " + e.strerror
def log(request, action, message, objects = None):
# Create a new thread in Daemon mode to send the log entry
from manifold.util.log import Log
from myslice.configengine import ConfigEngine
+# register activity
+import activity.slice
+
debug=False
#debug=True
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")
on the reserved nodes. To access your slice on a resource just type the following command:
</p>
<p class="command">
- $ ssh coverted_slice_name@planetlab-resource.hostname.com
+ $ ssh converted_slice_name@planetlab-resource.hostname.com
</p>
<p>You need to convert your typical slicename into a specific format in order to do SSH. An example below will demonstrate the conversion:</p>
<p class="command">