Hi Neil, to import all published workflows you can use a script like this: import sys sys.path.insert(1, 'galaxy-central/scripts/api') import common api_key = 'YOUR_USER_API_KEY' workflows = common.get(api_key, 'http://YOUR_SERVER/api/workflows?show_published=True') published_workflow_ids = [str(workflow[u'id']) for workflow in workflows if bool(workflow[u'published'])] for pw_id in published_workflow_ids: data['workflow_id'] = pw_id common.post(api_key, 'http://YOUR_SERVER/api/workflows/import', data) Nicola Il 2014-01-19 03:12 Neil.Burdett@csiro.au ha scritto:
Hi Nicola, that is exactly what I'm looking for, however, how do I execute the script/tool? I would like to import all published workflows. What is the name of the script to run and the arguments ? Can you give an example please?
Thanks again Neil
Date: Fri, 17 Jan 2014 11:36:03 +0100 From: Nicola Soranzo <soranzo@crs4.it> To: <galaxy-dev@lists.bx.psu.edu> Subject: Re: [galaxy-dev] Import workflows via API Message-ID: <d834d247437269704a26e8bbf8f678c2@crs4.it> Content-Type: text/plain; charset=UTF-8; format=flowed
Il 2014-01-17 06:45 Neil.Burdett@csiro.au ha scritto:
Hi,
I execute workflows via the API. However, if I want another user to use my workflows, I can publish my workflows, but the new user then has to go on to the web browser and import this workflow.
Is there a method/script which I can call via the API which can import all available (published) workflows so the user doesn't have to click a button on the web browser "import workflow" ?
Thanks for any help
Hi Neil, you are very lucky, just yesterday my pull request implementing exactly this has been merged in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/pull-request/298/api-display-and...
and is also available in BioBlend thanks to my colleague Simone Leo:
https://github.com/afgane/bioblend/pull/51
Best, Nicola
-- Nicola Soranzo, Ph.D. Bioinformatics Program, CRS4 Loc. Piscina Manna, 09010 Pula (CA), Italy http://www.bioinformatica.crs4.it/