Taverna Server 2.5.4

For a full list of operations, see the service listing generated by Apache CXF, which indicates where to access the WSDL and WADL descriptions of the T2Server interface.

What follows below is a simple guide to using the server. It does not cover all the features; a much more extensive guide is available on the myGrid website.

5 Minute Guide to Using the REST API

Taverna Server 2.5.4 supports both REST and SOAP APIs; you may use either API to access the service and any of the workflow runs hosted by the service. This simple guide just discusses the REST API.

  1. The client starts by creating a workflow run. This is done by POSTing a T2flow document to the service at the address http://sandbox.rohub.org/taverna-server/rest/runs with the content type application/vnd.taverna.t2flow+xml.

    The result of the POST is an HTTP 201 Created that gives the location of the created run (in a Location header), http://sandbox.rohub.org/taverna-server/rest/runs/UUID (where UUID is a unique string that identifies the particular run; this is also the name of the run that you would use in the SOAP interface). Note that the run is not yet actually doing anything.

  2. Next, you need to set up the inputs to the workflow ports. To set the input port, FOO, to have the value BAR, you would PUT a message like this to the URI http://sandbox.rohub.org/taverna-server/rest/runs/UUID/input/input/FOO

    <t2sr:runInput xmlns:t2sr="http://ns.taverna.org.uk/2010/xml/server/rest/">
  3. Now you can start the file running. This is done by using a PUT to set http://sandbox.rohub.org/taverna-server/rest/runs/UUID/status to the plain text value Operating.

  4. Now you need to poll, waiting for the workflow to finish. To discover the state of a run, you can (at any time) do a GET on http://sandbox.rohub.org/taverna-server/rest/runs/UUID/status; when the workflow has finished executing, this will return Finished instead of Operating (or Initialized, the starting state).

  5. Every workflow run has an expiry time, after which it will be destroyed and all resources (i.e., local files) associated with it cleaned up. By default in this release, this is 20 minutes after initial creation. To see when a particular run is scheduled to be disposed of, do a GET on http://sandbox.rohub.org/taverna-server/rest/runs/UUID/expiry; you may set the time when the run is disposed of by PUTting a new time to that same URI. Note that this includes not just the time when the workflow is executing, but also when the input files are being created beforehand and when the results are being downloaded afterwards; you are advised to make your clients regularly advance the expiry time while the run is in use.

  6. The outputs from the workflow are files created in the out subdirectory of the run's working directory. The contents of the subdirectory can be read by doing a GET on http://sandbox.rohub.org/taverna-server/rest/runs/UUID/wd/out which will return an XML document describing the contents of the directory, with links to each of the files within it. Doing a GET on those links will retrieve the actual created files (as uninterpreted binary data).

    Thus, if a single output FOO.OUT was produced from the workflow, it would be written to the file that can be retrieved from http://sandbox.rohub.org/taverna-server/rest/runs/UUID/wd/out/FOO.OUT and the result of the GET on http://sandbox.rohub.org/taverna-server/rest/runs/UUID/wd/out would look something like this:

    <t2sr:directoryContents xmlns:xlink="http://www.w3.org/1999/xlink"
        <t2s:file xlink:href="http://sandbox.rohub.org/taverna-server/rest/runs/UUID/wd/out/FOO.OUT"
  7. The standard output and standard error from the T2 Command Line Executor subprocess can be read via properties of the special I/O listener. To do that, do a GET on http://sandbox.rohub.org/taverna-server/rest/runs/UUID/listeners/io/properties/stdout (or .../stderr). Once the subprocess has finished executing, the I/O listener will provide a third property containing the exit code of the subprocess, called exitcode.

    Note that the supported set of listeners and properties will be subject to change in future versions of the server, and should not be relied upon.

  8. Once you have finished, destroy the run by doing a DELETE on http://sandbox.rohub.org/taverna-server/rest/runs/UUID. Once you have done that, none of the resources associated with the run (including both input and output files) will exist any more. If the run is still executing, this will also cause it to be stopped.

All operations described above have equivalents in the SOAP service interface.

Copyright © 2010–2014. The University of Manchester.

Software Release ID: 2.5.4 (commit: d285a5fbfa86b6e7e8e33baffb54830ecec256af)