Mercurial > repos > remy-d1 > api_tools
changeset 0:ec6fdbac353f draft
1st upload
author | remy-d1 |
---|---|
date | Tue, 05 Mar 2013 05:22:30 -0500 |
parents | |
children | 33bb43de178f |
files | display_py.xml |
diffstat | 1 files changed, 132 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/display_py.xml Tue Mar 05 05:22:30 2013 -0500 @@ -0,0 +1,132 @@ +<tool id="display_py" name="display_py" version="0.2" hidden="false" URL_method="post"> + <description>Use the display.py API browser from galaxy</description> + + <command> + #if $__user_email__ in $__app__.config.admin_users + #if str($add_path.question) == "yes" + #if str($add_path.specific_path) == "" + #if str($add_path.out_format) == "tsv" + $__root_dir__/scripts/api/display.py $api_key "$url_path_to_api/$content_type" | tail -n +3 |awk 'BEGIN{ FS="(\n|(name|id|[0-9]):)"; RS="#"; print "Num\tPath\tName\tID"; } /[:alnum:]/ { print NR-1,$2,$4,$6; }' > $display_py + #elif str($add_path.out_format) == "txt" + $__root_dir__/scripts/api/display.py $api_key "$url_path_to_api/$content_type" > $display_py + #else + print.py $__root_dir__/scripts/api/display.py $api_key "$url_path_to_api/$content_type" true > $display_py + #end if + #else + #if str($add_content.content_id) == "" + #if str($add_path.out_format) == "txt" + $__root_dir__/scripts/api/display.py $api_key "$url_path_to_api/$content_type/$add_path.specific_path/contents" > $display_py + #else + print.py $__root_dir__/scripts/api/display.py $api_key "$url_path_to_api/$content_type/$add_path.specific_path/contents" false > $display_py + #end if + #else + #if str($add_path.out_format) == "txt" + $__root_dir__/scripts/api/display.py $api_key "$url_path_to_api/$content_type/$add_path.specific_path/contents/$add_content.content_id" > $display_py + #else + print.py $__root_dir__/scripts/api/display.py $api_key "$url_path_to_api/$content_type/$add_path.specific_path/contents/$add_content.content_id" false > $display_py + #end if + #end if + #end if + + #else + #if str($add_path.out_format) == "tsv" + $__root_dir__/scripts/api/display.py $api_key "$url_path_to_api/$content_type" | tail -n +3 |awk 'BEGIN{ FS="(\n|(name|id|[0-9]):)"; RS="#"; print "Num\tPath\tName\tID"; } /[:alnum:]/ { print NR-1,$2,$4,$6; }' > $display_py + #elif str($add_path.out_format) == "txt" + $__root_dir__/scripts/api/display.py $api_key "$url_path_to_api/$content_type" > $display_py + #else + print.py $__root_dir__/scripts/api/display.py $api_key "$url_path_to_api/$content_type" true > $display_py + #end if + #end if + #else + print.py "Sorry, you are not an admin" + #end if + + + </command> + + <inputs> + <param name="api_key" type="text" help="The user's API key (check your database)" optional="false"> + <!-- ${ __app__.model.User.get( $__user_id__ ).api_keys[0].key } --> + <label>The user's key</label> + </param> + <param name="content_type" type="select" label="The content type"> + <option value="histories">histories</option> + <option value="workflows">workflows</option> + <option value="libraries">libraries</option> + </param> + <param name="url_path_to_api" type="baseurl" value="/api"> + </param> + + <conditional name="add_path"> + <param name="question" type="select" label="Add a specific path ID ?"> + <option value="yes">Yes</option> + <option value="no" selected="true">No</option> + </param> + <when value="yes"> + <param name="specific_path" type="text" help="The ID to a specific [ workflow | history | library ]" optional="true"> + <label>The galaxy specific id to access a [ workflow | history | library ]</label> + </param> + <param name="out_format" type="select" help="The output format (.tsv is available if there is no specific path)" label="The output format"> + <option value="html">html</option> + <option value="txt">txt</option> + </param> + </when> + <when value="no"> + <param name="out_format" type="select" help="The output format (.tsv is available if there is no specific path)" label="The output format"> + <option value="tsv">tsv</option> + <option value="html">html</option> + <option value="txt">txt</option> + </param> + </when> + </conditional> + + <conditional name="add_content"> + <param name="contents" type="boolean" truevalue="true" falsevalue="false" label="View content (if you choose a specific ID previously.)"> + </param> + <when value="true"> + <param name="content_id" type="text" help="The id of the specific content you want" optional="true"> + </param> + </when> + <when value="false"> + <param name="content_id" type="hidden" value=""> + </param> + </when> + </conditional> + </inputs> + + <outputs> + <data format="tabular" name="display_py" label="display.py API"> + <change_format> + <when input="add_path.out_format" value="html" format="html" /> + <when input="add_path.out_format" value="txt" format="txt" /> + <when input="add_path.out_format" value="tsv" format="tabular" /> + </change_format> + </data> + </outputs> + + + <help> + + display.py key url + - key is the user's api key (see database. *Example : 8672ceeb5a3d5ac259fc7b0e741ecb9f* ) + - url is a concatenated string which is http://your_galaxy_url/api/[histories|workflows|libraries]/*eventually_something_more_specific* + +---- + +**Details** + + This url string is created for you. All you have to do is to complete what you want and eventually the second part *eventually_something_more_specific*. + +The content type of what you need could be: + - histories + - workflows + - libraries + +(...) And eventuelly, something more specific in the last input text box, to retrieve less (but more precise) information about a [workflow|history|library]: + + * 5e512af0e2dc10db + * 5e512af0e2dc10db/contents + * 5e512af0e2dc10db/contents/c4a2c33b2fb05347 + + </help> +</tool>