'operation':fields.String(description='Currently unstage is the only operation.')
'operation':fields.String(description='Currently unstage is the only operation.'),
'metadata':fields.Nested(model=upload_meta_data_model,description='Additional upload and calculation meta data that should be considered for the operation')
})
...
...
@@ -278,8 +295,11 @@ class Upload(Resource):
"""
Execute an upload operation. Available operations: ``unstage``
Untage changes the visibility of the upload. Clients can specify, if the calcs
should be restricted.
Unstage accepts further meta data that allows to provide coauthors, comments,
external references, etc.
Unstage changes the visibility of the upload. Clients can specify the visibility
via meta data.
"""
try:
upload=UploadProc.get(upload_id)
...
...
@@ -294,12 +314,13 @@ class Upload(Resource):
json_data={}
operation=json_data.get('operation')
meta_data=json_data.get('meta_data',{})
ifoperation=='unstage':
ifnotupload.in_staging:
abort(400,message='Operation not allowed, upload is not in staging.')
try:
upload.unstage()
upload.unstage(meta_data)
exceptNotAllowedDuringProcessing:
abort(400,message='You must not unstage an upload during processing.')