Computation
Prerequisites
Generated Access Token with Capsule Scope
The Computation ID
The Computation ID can only be accessed from the Computation Object.
A typical use case is to use:
Both methods will have the Computation ID in the Response that can be used in Computations API for further tracking and getting results.
id
stringComputational id
created
float64Computation create time
name
stringDisplay name of the Computation
run_time
integerTotal run time in seconds
cloud_workstation
booleanIndicates whether this Computation is a cloud workstationstate
enuminitializing, running, finalizing, completed
end_status
enumstopped, failed, succeeded
exit_code
integerValue will be 0 when the code runs successfully and non-zero when it doesn't. Any error in a Pipeline will have an exit code value of 1. Only exists once state (above) is completed.
has_results
booleanIndicates whether the Computation has results
parameters
array(Optional)Run parameters
name
stringParameter name
value
stringParameter value
data_assets
array<dictionary>(Optional)Attached Data Assets
id
stringAttached Data Asset ID
mount
stringAttached Data Asset mount
nextflow_profile
string(Optional) Pipeline Nextflow profileprocesses
array<dictionary>(Optional) Pipeline processes informationname
stringPipeline process name (as it appears in the main.nf)capsule_id
stringID of the Capsule executed in the processversion
booleanCapsule version in case it's Releasedpublic
booleanIndicates the Capsule is a Code Ocean Appparameters
array<dictionary>Run Parametersname
stringParameter Labelparam_name
stringParameter Namevalue
stringParameter Value
Get Computation
GET https://{codeocean-domain}/api/v1/computations/{computation_id}
This API allows for the retrieval of information from a Computational run.
Path Parameters
computation_id*
string
Scope
Capsule
Read
List Computation Result Files
POST https://{codeocean-domain}/api/v1/computations/{computation_id}/results
This API allows for listing of result files generated by a Computation.
Path Parameters
computation_id*
string
Request Body
path
string
The path of the folder. Empty path will retrieve the /results root folder.
Scope
Capsule
Read
Get Result File URLs
GET https://{codeocean-domain}/api/v1/computations/{computation_id}/results/urls?path={path_to_file}
This API allows for the generation of two URLs to a Computation result file:
download_url- signed URL for downloading the fileview_url- signed URL for viewing the file in the browser
Path Parameters
computation_id*
string
path_to_file*
string
Scope
Capsule
Read
Delete Computation
DELETE https://{domain}/api/v1/computations/{computation_id}
This API allows for the deletion of a Computational run. If it is running, the Computation will stop.
Path Parameters
computation_id*
string
Scope
Capsule
Read/Write
Rename Computation
PATCH https://{domain}/api/v1/computations/{computation_id}?name={computation_name}
This API allows for the renaming of an existing Computational run immediately after it has been initiated.
Request Body
computation_id*
string
computation_name
string
Scope
Capsule
Read/Write
Run Capsule
POST https://{domain}/api/v1/computations
This API allows for the running of Capsules/Pipelines with Data Assets and Ordered or Named Parameters.
Prerequisite
Before using this API call, you may need AWS Cloud Credentials configured as Secrets or an Assumable Role, if you are using Data Assets from Cloud Resources.
Request Body
capsule_id*
string
pipeline_id
string
nextflow_profile
string
data_assets*
array<dict>
id*
string
mount
string
parameters
array<string>
named_parameters
array<dict>
processes
array<dict>
Scope
Capsule
Read/Write
Data Asset
Read
Run Capsule with Data Assets and Ordered Parameters
Run Capsule with Data Assets and Named Parameters
Run Pipeline
Run Pipeline with Data Assets and Ordered Capsules
Run Pipeline with Data Asset and Named Capsules
Run Pipeline with Data Assets and Ordered + Named Capsules
Last updated
Was this helpful?