User Tools

Site Tools


manual:restif

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:restif [2013/01/22 10:53]
a.visegradi
manual:restif [2013/01/22 13:15]
a.visegradi [Admin Guide]
Line 30: Line 30:
  
 Example: Example:
-  http://​example.com/​download/​wss/​version+  http://​example.com/myproject/​download/​wss/​version
 <​file>​ <​file>​
 3G Bridge 1.9 3G Bridge 1.9
 </​file>​ </​file>​
-  http://​example.com/​download/​wss/​version?​hdr=1+  http://​example.com/myproject/​download/​wss/​version?​hdr=1
 <​file>​ <​file>​
 version version
 3G Bridge 1.9 3G Bridge 1.9
 </​file>​ </​file>​
-  http://​example.com/​download/​wss/​version?​format=json+  http://​example.com/myproject/​download/​wss/​version?​format=json
 <​file>​ <​file>​
 [{"​version":"​3G Bridge 1.9"}] [{"​version":"​3G Bridge 1.9"}]
Line 47: Line 47:
 argument. The record separator can be overridden with ''​rsep''​. argument. The record separator can be overridden with ''​rsep''​.
  
-  http://​example.com/​download/​wss/​jobs/​093fd32b-4604-4c06-9ba9-d3aae7a6b80d?​sep=|+  http://​example.com/myproject/​download/​wss/​jobs/​093fd32b-4604-4c06-9ba9-d3aae7a6b80d?​sep=|
 <​file>​ <​file>​
 093fd32b-4604-4c06-9ba9-d3aae7a6b80d|Cloud|cloud|CANCEL||--image=ami-00000021|||2012-09-11 11:20:06| 093fd32b-4604-4c06-9ba9-d3aae7a6b80d|Cloud|cloud|CANCEL||--image=ami-00000021|||2012-09-11 11:20:06|
Line 55: Line 55:
 the URL: the URL:
  
-  http://​example.com/​download/​wss/​jobs/​093fd32b-4604-4c06-9ba9-d3aae7a6b80d/​id+status+creation_time+  http://​example.com/myproject/​download/​wss/​jobs/​093fd32b-4604-4c06-9ba9-d3aae7a6b80d/​id+status+creation_time
 <​file>​ <​file>​
 93fd32b-4604-4c06-9ba9-d3aae7a6b80d CANCEL 2012-09-11 11:20:06 93fd32b-4604-4c06-9ba9-d3aae7a6b80d CANCEL 2012-09-11 11:20:06
Line 180: Line 180:
 == Submitting a job == == Submitting a job ==
  
-FIXME+A job can be submitted to the Bridge by ''​POST''​ing a job object to the ''​jobs''​ 
 +entity. Currently, there are two ways to do this; either by posting form-data 
 +(''​Content-Type:​ application/​x-www-form-urlencoded''​) or by posting a JSON 
 +object (''​application/​json''​). The following examples show how this can be 
 +achieved using **''​curl''​**. 
 + 
 +In both cases, by default, after a successful submission, the Bridge will 
 +respond with a redirect header to the newly created jobs 
 +(''​%%Location:​ http://​example.com/​myproject/​download/​wss/​jobs/<​new_uuid>​%%''​). The 
 +''​-L''​ switch tells ''​curl''​ to follow this redirection. 
 + 
 +Another possibility is to specify ''​ '​redir=0'​ ''​ in the URL 
 +(''​.../​wss/​jobs?​redir=0''​);​ in this case, no redirection occurs, only the unique 
 +id of the new job is printed. This is the same behaviour as that of the SOAP 
 +interface. 
 + 
 +To submit a job, the same information has to be supplied as in case of the 
 +[[manual:​soapif|SOAP interface]]. Notice that---unlike the SOAP interface---the 
 +URL, MD5 and size parts of a specification are specified separately, not in a 
 +single string joined with ''​ '​='​ ''​. 
 + 
 +== Submitting using form data == 
 + 
 +<code bash Submitting a job using CURL> 
 +curl \ 
 +    -d name=dsp \ 
 +    -d grid=NULL \ 
 +    -d args='​-dpf=docking.dpf'​ \ 
 +    -d tag='​Test job' \ 
 +    -d input[docking.dpf][url]=http://​example.com/​myproject/​download/​inputs/​publicautodock423/​docking.dpf \ 
 +    -d input[docking.dpf][md5]=a7bac5a941a85660cd87bf83f93b852a \ 
 +    -d input[docking.dpf][size]=2933 \ 
 +    -d input[inputs.zip][url]=http://​example.com/​myproject/​download/​inputs/​publicautodock423/​inputs.zip \ 
 +    -d input[inputs.zip][md5]=cbb8c0ada8e197d6db707e6ce4f03ca6 \ 
 +    -d input[inputs.zip][size]=3270896 \ 
 +    -d output[0]=log.dlg \ 
 +    http://​example.com/​myproject/​download/​wss/​jobs?​hdr=1 -L 
 +</​code>​ 
 +<​file>​ 
 +id grid alg status gridid args griddata tag creation_time metajobid userid error_info 
 +022a9b75-8a08-4f5d-8188-c8687659e60d NULL dsp INIT  -dpf=docking.dpf ​ Test job 2013-01-22 13:​30:​32 ​   
 +</​file>​ 
 + 
 +Alternatively:​ 
 + 
 +<code bash Submitting a job using CURL> 
 +curl \ 
 +    # [ same as above ] \ 
 +    http://​example.com/​myproject/​download/​wss/​jobs?​redir=0 
 +</​code>​ 
 +<​file>​ 
 +022a9b75-8a08-4f5d-8188-c8687659e60d 
 +</​file>​ 
 + 
 +== Submitting using JSON == 
 + 
 +This is an example job description in JSON: 
 + 
 +<file json example-job.json>​ 
 +
 +    { 
 +        "​name":​ "​dsp",​ 
 +        "​grid":​ "​NULL",​ 
 +        "​args":​ "​-dpf=docking.dpf",​ 
 +        "​tag":​ "Test job",​ 
 +        "​input":​ { 
 +            "​docking.dpf":​ { 
 +                "​url":​ "​http://​example.com/​myproject/​download/​inputs/​publicautodock423/​docking.dpf",​ 
 +                "​md5":​ "​a7bac5a941a85660cd87bf83f93b852a",​ 
 +                "​size":​ 2933 
 +            }, 
 +            "​inputs.zip":​ { 
 +                "​url":​ "​http://​example.com/​myproject/​download/​inputs/​publicautodock423/​inputs.zip",​ 
 +                "​md5":​ "​cbb8c0ada8e197d6db707e6ce4f03ca6",​ 
 +                "​size":​ 3270896 
 +            } 
 +        }, 
 +        "​output":​ [ 
 +            "​log.dlg"​ 
 +        ] 
 +    } 
 +
 +</​file>​ 
 + 
 +This example job can be submitted with the following command. 
 + 
 +<code bash Submitting a JSON job> 
 +curl \ 
 +    --header '​Content-Type:​ application/​json'​ \ 
 +    --data @example-job.json \ 
 +    http://​example.com/​myproject/​download/​wss/​jobs 
 +</​code>​
  
 ===== Admin Guide ===== ===== Admin Guide =====
Line 201: Line 292:
 <​IfModule mod_rewrite.c>​ <​IfModule mod_rewrite.c>​
 RewriteEngine On RewriteEngine On
-RewriteBase /edgidemo/​download/​wss/​+RewriteBase /[project_name]/​download/​wss/​
 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-d
manual/restif.txt · Last modified: 2013/05/13 12:16 (external edit)