Send Data to Cloud
The send API allows a user to copy data from a Galaxy history to a cloud-based storage (e.g., Amazon S3, and
Microsoft Azure BLOB).
You may use the following steps to use this API:
-
Login to Galaxy using your Google account (read how);
-
Define a cloud authzorization configuration (read how);
-
Get a Galaxy API key by going to
User -> Manage API keyOn Galaxy’s webpage and clicking on theCreate a new keybutton; -
Make the API call as it follows:
4.1. Open Postman;
4.2. Choose
POSTand enter the following in the fields highlighted in the following figure:http://localhost:8080/api/cloud/storage/send?key=1234567890Replace
http://localhost:8080with the IP address of the Galaxy instance you’re using, and replace1234567890with the your API key.
4.3. Get the ID of Galaxy
historyfrom which you want to copy data, by going to the following address on your browser:http://localhost:8080/api/historiesThis will display a JSON object similar to the following, note the value of
idfield:[ { "name":"Unnamed history", "tags":[ ], "deleted": false, "purged": false, "annotation": null, "url": "/api/histories/df7a1f0c02a5b08e", "published": false, "model_class": "History", "id": "df7a1f0c02a5b08e" } ]4.4. Get the ID of authorization defined in step #2, which you want to use to write to the cloud-based storage, by going to following address:
http://localhost:8080/api/cloud/authzThis will display a JSON object similar to the following, note the value of
idfield:[ { "authn_id": "f2db41e1fa331b3e", "user_id": "f2db41e1fa331b3e", "last_update": "2018-12-07 17:53:55.714802", "last_activity": "2018-12-07 17:53:55.714818", "provider": "aws", "model_class": "CloudAuthz", "config": "{u'role_arn': u'arn:aws:iam:: ...'}", "id": "f2db41e1fa331b3e" } ]4.5. On Postman, goto
Bodytab as shown in the following figure and enter the following API payload:
{ "history_id": "03501d7626bd192f", "authz_id": "f2db41e1fa331b3e", "bucket": "vahid-objectstore" }Replace
vahid-objectstorewith a bucket name to which you want tosenddata.4.6. Click on the
Sendbutton; Postman will submit a request to Galaxy tosenddata and will shows a result as the following.{ "sent_dataset_labels": [ "{\"object\": \"rep1.bed\", \"job_id\": \"3f5830403180d620\"}", "{\"object\": \"rep2.bed\", \"job_id\": \"e85a3be143d5905b\"}" ], "bucket_name": "vahid-objectstore", "failed_dataset_labels": [] }This JSON object shows two Galaxy datasets,
rep1.bedandrep2.bed, are queued for being sent to thevahid-objectstorebucket.