Remote upload and download module

This module offers the downloading and uploading capacity for annotation services working on a AMQP.

VestaService.RemoteAccess.cleanup(doc)

Remove a given local document.

Parameters:doc – Document on which the cleanup will act.
VestaService.RemoteAccess.download(doc_msg, timeout=10, max_try=5)

Download a given document to a local file. The calling function is responsible for the resulting file.

Parameters:
  • doc_msg

    Dictionary containing the following keys:

    url:path to a distant document
  • timeout – Request timeout in seconds
  • max_try – Maximal number of tries
Returns:

object of type Document.

VestaService.RemoteAccess.upload(doc)

Upload a given document from a local file.

This function is built to upload exclusively to the Vesta storage service.

Parameters:doc – Instance of Document with valid values.
Returns:Instance of Document with the URL updated by the one that should be used to download the uploaded file.