/tasks/{task_id}
Change the details of the specified task, including its name, description, and inputs. The task is referred to by its ID, which you can obtain by making the call to list all tasks you can access.
Note that you can only modify tasks with a task status of DRAFT. Tasks which are RUNNING, QUEUED, ABORTED, COMPLETED or FAILEDcannot be modified in order to enable the reproducibility of analyses which have been queued for execution or has initiated executing.
See the section on task inputs for details on how to refer to a task's inputs.
https://api.sb.biodatacatalyst.nhlbi.nih.gov/v2/tasks/{task_id}Request
Example request
PATCH /v2/tasks/f0b89de2-45b6-789c-12b3-05b832c576c6 HTTP/1.1
Host: api.sb.biodatacatalyst.nhlbi.nih.gov
X-SBG-Auth-Token: 3259c50e1ac5426ea8f1273259740f74curl --data-binary "@modify-task.json" -s -H "X-SBG-Auth-Token: 6282d5e2121d43e7900e9d52b15845e7" -H "content-type: application/json" -X PATCH "https://api.sb.biodatacatalyst.nhlbi.nih.gov/v2/tasks/f0b89de2-45b6-789c-12b3-05b832c576c6"See below for an example of the content of the request, sent here as modify-task.json.
Header Fields
| Name | Description |
|---|---|
X-SBG-Auth-Tokenrequired | Your authentication token. |
Path parameters
| Name | Description |
|---|---|
task_idrequired | The ID of the task you are querying |
Query parameters
| Name | Data type | Description |
|---|---|---|
fields | string | Selector specifying a subset of fields to include in the response. |
Request body
In the body of the request you should enter key-value pairs, as explained below:
| Key | Datatype of value | Description of value |
|---|---|---|
"name" | string | The name of the task |
"description" | string | The description of the task |
"inputs" | dictionary | See the API Overview section on specifying inputs for information on creating input objects. |
"batch" | Boolean | This is set to false by default. Set to true to create a batch task and specify the batch_input and batch-by as described below. |
"batch_input" | string | The ID of the input on which you wish to batch. You would typically batch on the input consisting of a list of files. If this parameter is omitted, the default batching criteria defined for the app will be used. |
"batch_by" | dictionary | This specifies the criteria on which to batch. It can be in one of two formats.
|
There are two further things to note if you are editing a batch task:
If you want to change the input on which to batch and the batch criteria, you need to specify the batch_input and batch_by parameters together in the same PATCH request.
If you want to disable batching on a task, set the parameters batch_input and batch_by to the JSON null value, as follows:
{
"batch_input": null,
"batch_by" : null
}Example request body
{
"name": "new name for my task",
"description": "re-describing the task",
"inputs": {
"cuffdiff_zip": {
"class": "File",
"path": "567890abc8a5136ec6127063",
"name": "example_human_known_indels.vcf"
}
}Response
See a list of response codes that may be contained in the body of the response.
Example response body
{
"href": "https://api.sb.biodatacatalyst.nhlbi.nih.gov/v2/tasks/f0b89de2-45b6-789c-12b3-05b832c576c6",
"id": "f0b89de2-45b6-789c-12b3-05b832c576c6",
"name": "RFranklin, Experiment IV",
"description": "my draft task",
"status": "DRAFT",
"project": "RFranklin/my-project",
"use_interruptible_instances": true,
"app": "RFranklin/my-project/new-test-app/0",
"type": "v2",
"created_by": "RFranklin",
"start_time": "2016-01-12T19:20:10Z",
"inputs": {
"dispersion_threshold": null,
"cuffdiff_zip": {
"class": "File",
"path": "567890abc3d8130ea4047731",
"name": "example_human_known_indels.vcf"
},
"density_threshold": null,
"thresholds_off": null
},
"outputs": {
"archive": null,
"html": null
}
}