Modify a task
Navigation
- Set output destinations via the visual interface
- Use output destinations in API calls:
- Create a new draft task
- Get details of a task
- Modify a task
- Run a task
- Rerun a task
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 FAILED cannot be modified in order to enable the reproducibility of analyses which have been queued for execution or has initiated executing.
https://cavatica-api.sbgenomics.com/v2/tasks/{task_id}The task details include its creator, its start and end time, the number of jobs completed in it, and its input and output files. You can also see the status of the task.
Header fields
Name | Description |
|---|---|
| Your CAVATICA authentication token. |
Path parameters
Name | Data type | Description |
|---|---|---|
| string | The ID of the task you are querying. |
Query parameters
Name | Data type | Description |
|---|---|---|
| string | Selector specifying a subset of fields to include in the response. |
Request
Request body
The request body should be a JSON object specifying the app that you want to run, and assigning input files to its input nodes. It is entered as a list of key-value pairs. The keys specify the name and description of the task to be created, the app to executed, and details of its inputs files. The keys, and their permitted values, are described below.
You can see a list of the app's input nodes on CAVATICA on the apps page for the project. Specify the files to input to the nodes using the files' IDs, which you can obtain using the call to get files.
Key | Data type | Description |
|---|---|---|
| string | The name of the task. |
| string | An optional description of the task. |
| string | The short name of the project that you want to create the task in. |
| dictionary | Detailed task execution parameters. Includes the instance type setting ( • |
| string | The specification of the app that you want to run. Recall that apps are specified by their projects, in the form |
| dictionary | See the section on specifying task inputs for information on creating task input objects. |
| dictionary | Detailed parameters related to the output location where task outputs will be stored. |
| boolean | This is set to |
| 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. |
| dictionary | This specifies the criteria on which to batch. It can be in one of two formats.
|
| boolean | This field can be true or false. Set this field to true to allow the use of spot instances. |
Output location
The output_location dictionary allows you to define the exact location where your task outputs will be stored. The location can either be defined for the entire project using the main_location parameter, or individually per each output node, by setting the nodes_override parameter to true and defining individual output node locations within nodes_location. See the table below for more details.
Key | Data type | Description |
|---|---|---|
| string | Defines the output location for all output nodes in the task. Can be a path within the project in which the task is created, for example |
| string | The location (path) in the project that will point to the actual location where the outputs are stored. Used if |
| boolean | Enables defining of output locations for output nodes individually through Even if |
| dictionary | Contains output paths for individual task output nodes in the following format for each output node: `"{output-node-id}": { "b64html": { In the example above, • |
Example request body
{
"description": "my draft task",
"name": "RFranklin, Experiment IV",
"use_interruptible_instances": false,
"execution_settings": {
"instance_type": "c4.2xlarge;ebs-gp2;2000",
"max_parallel_instances": 1
},
"inputs": {
"cuffdiff_zip": {
"class": "File",
"path": "567895e6e4b00a1d67a8b1aa",
"name": "example_human_known_indels.vcf"
}
},
"output_location": {
"main_location": "volumes://rfranklin/task-outputs/mar_19",
"main_location_alias": "/outputs/<app_name>/mar_19",
"nodes_override": true,
"nodes_location": {
"archive": {
"output_location": "volumes://rfranklin/task-outputs/mar_19",
"output_location_alias": "/outputs/<app_name>/mar_19/vcf"
},
"html": {
"output_location": "/outputs/<app_name>/mar_19/html_reports"
}
}
}
}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_inputandbatch_byparameters together in the same PATCH request. - If you want to disable batching on a task, set
batchtofalse. Or, you can also set the parametersbatch_inputandbatch_bytonull.
{
"batch":false
}Response
See a list of CAVATICA-specific response codes that may be contained in the body of the response.
Example response body
{
"href": "https://cavatica-api.sbgenomics.com/v2/tasks/ea078c48-12c3-5460-a43b-4a1ab89e7f15",
"id": "ea078c48-12c3-5460-a43b-4a1ab89e7f15",
"name": "RFranklin, Experiment IV",
"description": "my draft task",
"status": "DRAFT",
"project": "RFranklin/my-project",
"use_interruptible_instances": false,
"execution_settings": {
"instance_type": "c4.2xlarge;ebs-gp2;2000",
"max_parallel_instances": 1
},
"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": "567895e6e4b00a1d67a8b1cc",
"name": "example_human_known_indels.vcf"
},
"density_threshold": null,
"thresholds_off": null
},
"outputs": {
"archive": null,
"html": null
},
"output_location": {
"main_location": "volumes://rfranklin/task-outputs/mar_19",
"main_location_alias": "/outputs/<app_name>/mar_19",
"nodes_override": true,
"nodes_location": {
"html": {
"output_location": "/outputs/<app_name>/mar_19/html_reports"
},
"archive": {
"output_location": "volumes://rfranklin/task-outputs/mar_19",
"output_location_alias": "/outputs/<app_name>/mar_19/vcf"
}
}
}
}