Question: Uploading Files To History Via Api
0
gravatar for Neil.Burdett@csiro.au
5.9 years ago by
Neil.Burdett@csiro.au310 wrote:

Hi, It seems the API documentation is a bit scarce. I'd like to upload a file from the command line using the API rather than the GUI, but would like to see the file in the history. Does anyone have any information how to do this/ any tools that are available. Thanks Neil

upload api data local • 1.5k views
ADD COMMENTlink modified 4.1 years ago by Jennifer Hillman Jackson25k • written 5.9 years ago by Neil.Burdett@csiro.au310
2
gravatar for rowland.mosbergen
4.5 years ago by
Australia
rowland.mosbergen20 wrote:

Hi Neil,

Probably too late but there is a blend4j that has an exercise for loading a file that is using java. There is also bioblend that is based in python, although I haven't had a look at it.

Rowland

ADD COMMENTlink written 4.5 years ago by rowland.mosbergen20
1
gravatar for Jennifer Hillman Jackson
4.5 years ago by
United States
Jennifer Hillman Jackson25k wrote:

Thanks Rowland, such great idea to complete the information in archives here (I gave you a +1)! There have been many API updates since this was posted. I checked to see if the question was moved to the galaxy-dev list, but didn't find it. Perhaps it was addressed directly. Both could occur when there were development questions posted to the user list.

To add in some resources ..

Neil and other readers, also please see api example scripts in the source here:
https://bitbucket.org/galaxy/galaxy-dist: / scripts / api /

This action was enabled as of pull-request #94:
http://bitbucket.org/galaxy/galaxy-central/pull-request/94/enable-upload-of-files-to-history-through/diff

There are new improvements pending in the upcoming release (including one that specifically addresses uploaded datasets) and more planned in the future around the API. Visit our Trello "Development" board and filter by "API" to review associated ticket. Documentation is on our list. Everyone, please upvote the tickets you are interested in.
https://wiki.galaxyproject.org/Issues

Developers can also search here for more related information as while working through developing your API protocol (including recent mailing list posts on the galaxy-dev@bx.psu.edu mailing list - also feel free to post a question if it hasn't come up yet or a problem is encountered). 
http://galaxyproject.org/search/getgalaxy/

Best! Jen, Galaxy team

ADD COMMENTlink written 4.5 years ago by Jennifer Hillman Jackson25k
0
gravatar for nicolas.lucero145
4.1 years ago by
Spain
nicolas.lucero14540 wrote:

I'm trying to do the same thing using blend4j.I guess Rowland is refering to 

https://github.com/apetkau/blend4j-tutorials/blob/master/answers/blend4j-answer-1/src/main/java/Blend4JExercise1.java

But as I understand, that is to upload to library instead of history. 

i was checking the test codes and followed this one:

https://github.com/jmchilton/blend4j/blob/master/src/test/java/com/github/jmchilton/blend4j/galaxy/ToolsTest.java

So my code is:

        File fileToUpload = new File(file); //file is a String with the url with the file I'm trying to upload
        FileUploadRequest uploadRequest = new FileUploadRequest(historyId, fileToUpload);
        ToolsClient client = galaxyInstance.getToolsClient();
        ClientResponse clientResponse = client.uploadRequest(uploadRequest);

I'm showing a message before and after this fragment of code. The one before is shown, the other one not.

Would you please tell me what am I doing wrong?

Thanks a lot in advance.

Nico
        

 

ADD COMMENTlink written 4.1 years ago by nicolas.lucero14540

I realize that the File is not an URL, so this won't work. How can I send a file to be downloaded in my history?

ADD REPLYlink written 4.1 years ago by nicolas.lucero14540
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 169 users visited in the last hour