If you're not familiar with using REST webservices you should have
a closer look to our webservice related webpage.
Provided functions/methods (parameters and datatypes)
A function provides 4 public REST methods (request, response, status and statuscode) as
described in the introduction before. The table below gives an overview about the name, the supported http command,
the accepted and produced mime-type.
request |
POST |
application/json |
text/plain (job-id) |
response |
POST |
text/plain (job-id) |
depends on tool typical: text/plain |
status |
POST |
text/plain (job-id) |
text/plain (code + description) |
statuscode |
POST |
text/plain (job-id) |
text/plain (statuscode) |
The parameters and supported data types for each function are the
same as for the browser based interface.
Input
Input are supported in two different ways. The content can be given as
argument or as (Amazon-S3) URL. For Amazon-S3 there are three additional
parameters.
accesskey |
AWS access key for an Amazon S3 account |
secretkey |
AWS secret key for an Amazon S3 account. |
sessionkey |
AWS session token for temporary/session based account credentials. |
AWS-S3 support for REST webservice is currently in a non stable
status and may working or not.
- input (unwords_input) of type Fasta_DNA.
Example Usage
We use
cURL on the cmdline for an example usage of the service.
- Start a new job using the request method. All necessary data - input(s) and parameter(s) - are packed
into an JSON object.
curl -X POST -d @[[INPUT]] http://bibiserv2.cebitec.uni-bielefeld.de:80/rest/unwords/unwords_fct_1/request -H "Content-Type: application/json"
- Check status of job using status or statuscode method.
curl -X POST -d [[ID]] http://bibiserv2.cebitec.uni-bielefeld.de:80/rest/unwords/unwords_fct_1/statuscode -H "Content-Type: text/plain"
or
curl -X POST -d [[ID]] http://bibiserv2.cebitec.uni-bielefeld.de:80/rest/unwords/unwords_fct_1/status -H "Content-Type: text/plain"
Replace [[ID]] with the id you got from a previous request.
Both status functions returned current status of job. While
status is more human readable, statuscode
returns a machine readable 3 digit number. If the status is
"600 - finished ok" you can go to the next step. While any 6xx is
an non-error status that changes while the job is running, any 7xx
state is an (final) error state (see list of
status codes).
-
Get the result of your finished job using the response method.
>curl -X POST -d [[ID]] http://bibiserv2.cebitec.uni-bielefeld.de:80/rest/unwords/unwords_fct_1/response -H "Content-Type: text/plain";echo
Replace [[ID]] with the id you got from a previous request.
In the case the job isn't finished yet(non-error status > 600
and < 700 or error status >= 700) the status is coded into
the http response.