Skip to content
Snippets Groups Projects
Commit d0de3624 authored by Renzo Frigato's avatar Renzo Frigato
Browse files

add comment to engine handler method

parent ed076a0b
No related branches found
No related tags found
No related merge requests found
......@@ -181,7 +181,12 @@ class Core(base.RequestHandler):
log.info('Received %s [%s, %s/s] from %s' % (file_store.filename, util.hrsize(file_store.size), util.hrsize(throughput), self.request.client_addr))
def engine(self):
"""Receive a sortable reaper upload."""
"""
URL format: api/engine?level=<container_type>&id=<container_id>
It expects a multipart/form-data request with a "metadata" field (json valid against api/schemas/input/enginemetadata)
and 0 or more file fields with a non null filename property (filename is null for the "metadata").
"""
level = self.get_param('level')
if level != 'acquisition':
self.abort(404, 'engine uploads are supported only at the acquisition level')
......
......@@ -147,7 +147,6 @@ class MultiFileStore(object):
def _save_multipart_files(self, dest_path, hash_alg):
form = getHashingFieldStorage(dest_path, hash_alg)(fp=self.body, environ=self.environ, keep_blank_values=True)
self.tags = json.loads(form['tags'].file.getvalue()) if 'tags' in form else None
self.metadata = json.loads(form['metadata'].file.getvalue()) if 'metadata' in form else None
for field in form:
if form[field].filename:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment