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
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.
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:
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.
Developers can also search here for more related information as while working through developing your API protocol (including recent mailing list posts on the email@example.com mailing list - also feel free to post a question if it hasn't come up yet or a problem is encountered).
Best! Jen, Galaxy team
I'm trying to do the same thing using blend4j.I guess Rowland is refering to
But as I understand, that is to upload to library instead of history.
i was checking the test codes and followed this one:
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.