Webservices (REST) for PSSH2

Create service
Submit new job:
post a sequece to http://drylab.rdpa.org/rest/pssh2/job/ in one of these formats:
application/x-www-form-urlencoded
multipart/form-data
application/json

Job submission returns report in json format.
If successful, it includes Status: succes, internal jobid, and URI for job status retrival.
Example:
{"Status":"success","Job ID":"hhsuite-pssh2-20150113062458","uri":"http://drylab.rdpa.org/rest/pssh2/job/hhsuite-pssh2-20150113062458"}

Client example (php):

<?php
$sequence ='>sp|P02769|ALBU_BOVIN Serum albumin OS=Bos taurus GN=ALB PE=1 SV=4
MKWVTFISLLLLFSSAYSRGVFRRDTHKSEIAHRFKDLGEEHFKGLVLIAFSQYLQQCPF
DEHVKLVNELTEFAKTCVADESHAGCEKSLHTLFGDELCKVASLRETYGDMADCCEKQEP
ERNECFLSHKDDSPDLPKLKPDPNTLCDEFKADEKKFWGKYLYEIARRHPYFYAPELLYY
ANKYNGVFQECCQAEDKGACLLPKIETMREKVLASSARQRLRCASIQKFGERALKAWSVA
RLSQKFPKAEFVEVTKLVTDLTKVHKECCHGDLLECADDRADLAKYICDNQDTISSKLKE
CCDKPLLEKSHCIAEVEKDAIPENLPPLTADFAEDKDVCKNYQEAKDAFLGSFLYEYSRR
HPEYAVSVLLRLAKEYEATLEECCAKDDPHACYSTVFDKLKHLVDEPQNLIKQNCDQFEK
LGEYGFQNALIVRYTRKVPQVSTPTLVEVSRSLGKVGTRCCTKPESERMPCTEDYLSLIL
NRLCVLHEKTPVSEKVTKCCTESLVNRRPCFSALTPDETYVPKAFDEKLFTFHADICTLP
DTEKQIKKQTALVELLKHKPKATEEQLKTVMENFVAFVDKCCAADDKEACFAVEGPKLVV
STQTALA';

$url = 'http://drylab.rdpa.org/rest/pssh2/job/';
$opts = array('http' => array(
'method' => 'POST',
'request_fulluri' => FALSE,
'timeout' => 300,
'header' => 'Content-type: application/x-www-form-urlencoded' . "\r\n" .
'User-agent: restetst' . "\r\n",
'content' => 'sequence=' .urlencode($sequence),
)
);
$context = stream_context_create($opts);
$res = file_get_contents($url, false, $context);
echo '' .$res . "";

Retirve service service

The URI from submission step serves as a job retrival endpoint.
It returns job status (running, finished, or missing), and uri for the job result download if the job is finished.
Example:
Job is running:

{"Status":"Success","Job status":"running"}

Live demo: http://drylab.rdpa.org/rest/pssh2/job/hhsuite-pssh2-20150112080630

Job is missing:
{"Status":"Fail","Job status":"missing"}
Live demo: http://drylab.rdpa.org/rest/pssh2/job/hhsuite-pssh2-20150112080631

Job is finished:
{"Status":"Success","Job status":"finished","uri":"http://drylab.rdpa.org/drylab/download/hhsuite-pssh2-20150113062458/query.pssh2"}
Live demo: http://drylab.rdpa.org/rest/pssh2/job/hhsuite-pssh2-20150113062458
Example job result download: http://drylab.rdpa.org/drylab/download/hhsuite-pssh2-20150113062458/query.pssh2
Substitute '.pssh2' file extention to '.fasta' to download original submitted sequence: http://drylab.rdpa.org/drylab/download/hhsuite-pssh2-20150113062458/query.fasta