QCG job submitter


Allows for easy grid job management via a REST interface through the QocCosGrid middleware. User is able to start, monitor, get results and delete running or finished grid jobs.

Security note! All the methods described below are secured. Authentication requires sending a user proxy certificate (support for SimpleCA signed proxies only) through a request header with the PROXY name and a Base64 encoded proxy as the value.
URL /api/qcgjobs
Method POST
URL params None
Data params

application/x-www-form-urlencoded or multipart/form-data:

executable=[string (required; automatically added to inputSandbox)]
arguments=[string[] (optional)]
stdOutput=[string (optional; automatically added to outputSandbox)]
stdError=[string (optional; automatically added to outputSandbox)]
candidateHosts=[string[] (optional)]
outputSandbox=[string[] (optional)]
files=[file[] (optional; all submitted files are automatically added to inputSandbox)]
tag=[string (optional)]
Success response

Code: 201

Example:

{
  "status":"RUNNING",
  "job_id":"56cd0b82-2db4-4dd7-ad77-4ceb922f9a7a",
  "native_job_id":"J1435215723375__9256"
}
Error response

Error response: 408 | 422 | 500

Example:

{
  "status":"error",
  "exit_code":-1,
  "error_message":"error message...",
  "tag":null
}
  					
Sample call

Bash (with base64, tr and curl)

proxy="`cat {path-to-proxy-file} | base64 | tr -d '\n'`"

echo First file contents > in1.txt
echo Second file contents > in2.txt
echo -e '#!/bin/bash\ncat in1.txt in2.txt > result.txt' > run.sh

curl -k -X POST --header "PROXY:$proxy" --form files=@run.sh --form files=@in1.txt --form files=@in2.txt \
--form executable=run.sh --form outputSandbox=result.txt --form stdOutput=out.txt \
--form stdError=error.txt https://submit.plgrid.pl/api/qcgjobs
  					
Notes None
URL /api/qcgjobs/{job_id}/jobdescription
Method GET
URL params job_id - Job identifier
Data params None
Success response

Code: 200

Example:

<?xml version="1.0" encoding="UTF-8"?>
<qcgJob appId="">
   <task taskId="task">
      <execution type="single">
      <!-- ... -->
      </execution>
   </task>
</qcgJob>
Error response

Error response: 408 | 422 | 500

Example:

{
  "status":"error",
  "exit_code":0,
  "error_message":"error message...",
}
Sample call

Bash (with base64, tr and curl)

proxy="`cat {path-to-proxy-file} | base64 | tr -d '\n'`"

curl -k -X GET --header "PROXY:$proxy" https://submit.plgrid.pl/api/qcgjobs/56cd0b82-2db4-4dd7-ad77-4ceb922f9a7a/jobdescription
Notes None
URL /api/qcgjobs?tag={tag}
Method GET
URL params tag - Tag (optional)
Data params None
Success response

Code: 200

Example:

[
  {
    "status":"RUNNING",
    "job_id":"295a49d3-b261-4acb-a508-fce3e1684494",
    "native_job_id":"J1435215723375__9256"
  },
  {
    "status":"RUNNING",
    "job_id":"56cd0b82-2db4-4dd7-ad77-4ceb922f9a7a",
    "native_job_id":"J1435215723375__9256"
  }
]
Error response

Error response: 408 | 404 | 500

Example:

{
  "status": "error",
  "exit_code": -1,
  "error_message": "error message...",
  "tag":null
}
Sample call

Bash (with base64, tr and curl)

proxy="`cat {path-to-proxy-file} | base64 | tr -d '\n'`"

curl -k -X GET --header "PROXY:$proxy" https://submit.plgrid.pl/api/qcgjobs
Notes None
URL /api/qcgjobs/{job_id}
Method GET
URL params job_id - Job identifier
Data params None
Success response

Code: 200

Example:

{
  "status":"RUNNING",
  "job_id":"56cd0b82-2db4-4dd7-ad77-4ceb922f9a7a",
  "native_job_id":"J1435215723375__9256"
}
Error response

Error response: 408 | 404 | 500

Example:

{
  "status": "error",
  "exit_code": -1,
  "error_message": "error message...",
  "tag":null
}
Sample call

Bash (with base64, tr and curl)

proxy="`cat {path-to-proxy-file} | base64 | tr -d '\n'`"

curl -k -X GET --header "PROXY:$proxy" https://submit.plgrid.pl/api/qcgjobs/56cd0b82-2db4-4dd7-ad77-4ceb922f9a7a
Notes None
URL /api/qcgjobs/{job_id}/files/{file_name}
Method GET
URL params job_id - Job identifier
file_name - File path relative to sandbox
Data params None
Success response

Code: 200

Example:

File contents
Error response

Error response: 408 | 422 | 500

Example:

{
  "status":"error",
  "exit_code":0,
  "error_message":"error message...",
}
Sample call

Bash (with base64, tr and curl)

proxy="`cat {path-to-proxy-file} | base64 | tr -d '\n'`"

curl -k -X GET --header "PROXY:$proxy" https://submit.plgrid.pl/api/qcgjobs/56cd0b82-2db4-4dd7-ad77-4ceb922f9a7a/files/result.txt
Notes None
URL /api/qcgjobs/{job_id}
Method DELETE
URL params job_id - Job identifier
Data params None
Success response Code: 204
Error response

Error response: 408 | 404 | 500

Example:

{
  "status": "error",
  "exit_code": 0,
  "error_message": "error message",
  "tag":null
}
Sample call

Bash (with base64, tr and curl)

proxy="`cat {path-to-proxy-file} | base64 | tr -d '\n'`"

curl -k -X DELETE --header "PROXY:$proxy" https://submit.plgrid.pl/api/qcgjobs/56cd0b82-2db4-4dd7-ad77-4ceb922f9a7a
Notes None
URL /api/qcgjobs/{job_id}
Method PUT
URL params job_id - Job identifier
Data params

JSON:

{
  "action": [string (required)]
}

Example:

{
  "action": "abort"
}
Success response Code: 204
Error response

Error response: 408 | 404 | 500

Example:

{
  "status": "error",
  "exit_code": 0,
  "error_message": "error message...",
  "tag":null
}
Sample call

Bash (with base64, tr and curl)

proxy="`cat {path-to-proxy-file} | base64 | tr -d '\n'`"

curl -k -X PUT --data '{"action":"abort"}' --header "Content-Type:application/json" \
--header "PROXY:$proxy" https://submit.plgrid.pl/api/qcgjobs/56cd0b82-2db4-4dd7-ad77-4ceb922f9a7a
Notes None