REST API module

This module defines a REST API for the multimedia storage system as defined by the CANARIE API specification. See : https://collaboration.canarie.ca/elgg/file/download/849

Any incoming transcoding request on the REST interface is passed on to the Celery distributed worker queue and any service workers listening on the corresponding queue should pick up the request message and initiate their task.

From a code separation perspective this module is in charge of defining the REST API and use others modules to do the actual job. It also plays the role of formatting any response that should be sent back in the proper format.

mss.rest_api.add(worker_autorization_key)[source]

POST a new file to add into the storage server (file:form-data) GET a temporary public URL from swift to upload a file.

The file name must be provided as parameter, for example:

/add?filename=name.ext
Returns:[POST] JSON object with the unique URL of the file. [GET] JSON object with the unique URL of the file and the URL to make a PUT with the file.
mss.rest_api.delete(storage_doc_id)[source]

POST a delete request for a given document.

Parameters:storage_doc_id – The unique document id of the file to delete.
mss.rest_api.get(storage_doc_id)[source]

GET the file associated with the given storage_doc_id

Parameters:storage_doc_id – The unique document id of the file to get.
mss.rest_api.stream(storage_doc_id)[source]

GET the streaming server URL for a given unique URL.

Parameters:storage_doc_id – The unique document id of the file to stream.
Returns:JSON object with a valid URL from which the video can be streamed