Submission Instructions
Access Token (JWT)
To submit a Job you must be authenticated. When you sign in you are given a JWT Token that can be used to authenticate all the actions you take.
You can access the token from the API Access Token page found in the main menu when you are signed in.
This token will expire overtime. Your token can also be renewed from the same page.
Message Format
The system uses the GA4GH TES message format to pass a job to the system in order to tell a TRE to download and execute an image.
In order for the system to align with the '5 Safes' requirement, the message must also contain a set number of parameters:
Key parameters
- Name: display name
- TAGS: project : name of the project as known on this system
- TAGS: TRE : blank (all) or pipe | separated lists of TREs the submission is going to
IMPORTANT: You can only submit requests if you are a valid user on the system, you are listed on the project you state and that the TRE(s) have been added to the project.
NOTE: When a submission is received by a TRE, the project and user must also have been authorised locally, otherwise the submission will be rejected at the parameter of the TRE.
Example
POST https://localhost:7163/v1/tasks
{
"state": 0,
"name": "Hello World",
"inputs": [],
"outputs": [
{
"name": "Stdout",
"description": "Stdout results",
"url": "s3://outputBucketName", // Set the output bucket
"path": "/outputs",
"type": "DIRECTORY"
}
],
"executors": [
{
"image": "ubuntu",
"command": [
"echo",
"Hello World"
],
"workdir": "/outputs",
"stdout": "/outputs/stdout",
}
],
"volumes": null,
"tags": {
"project": "ProjectName", // Project that you would like to submit to.
"tres": "TREName" // TRE related to that Project
},
"logs": null,
"creation_time": null
}
Calling the REST API
You will need a JWT Token (Found Here)
Example Command
curl -X 'POST' \
'https://localhost:7163/v1/tasks' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer **TOKEN-HERE**' \
-H 'Content-Type: application/json-patch+json' \
-d '{"state": 0,
"name": "Hello World",
"inputs": [],
"outputs": [
{"name": "Stdout","description": "Stdout results","url": "s3://outputBucketName","path": "/outputs","type": "DIRECTORY"}],"executors": [{"image": "ubuntu","command": ["echo","Hello World"],"workdir": "/outputs","stdout": "/outputs/stdout",}],"volumes": null,"tags": {"project": "ProjectName","tres": "TREName"},"logs": null,"creation_time": null}'
Calling the REST API through Swagger
Access Swagger URL at https://localhost:7163/swagger/index.html
- Click Authorize, enter Token into Value and press Authorize then Close
- Section TaskServiceApi, POST /v1/tasks
- Press "Try it out"
- Paste JSON message into textbox and then press Execute