Computation API
Prerequisites
Generated 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
string
the Computational id
created
float64
Computation create time
name
string
the display name of the Computation
run_time
integer
the total run time in seconds
cloud_workstation
boolean
indicates whether this Computation is a cloud workstation
parameters
Optional - array
run parameters
name - string
parameter name
value - string
parameter value
has_results
boolean
indicates whether the Computation has results
state
string
initializing, running, finalizing, completed
end_status
stopped, failed, succeeded
data_assets
Optional - array
attached Data Assets
id - string
attached Data Asset ID
mount - string
attached Data Asset mount
processes
Optional - array
Pipeline processes information.
name
Pipeline process name.
capsule_id
string
the id of the Capsule executed in this process.
version
Optional - integer
Capsule version in case its a release.
public
Optional - boolean
indicates the Capsule is a public Code Ocean App.
parameters
Optional - array
run parameters
name - string
the parameter title
param_name - string
parameter name
value - string
parameter value
Get Computation
GET
https://{domain}/api/v1/computations/{computations_id}
This API allows for the retrieval of information from a computational run.
Path Parameters
Name | Type | Description |
---|---|---|
GET* |
| /computations/:computation_id |
Headers
Name | Type | Description |
---|---|---|
-u* |
| Authorize with Code Ocean API Secret: -u $API_SECRET : This is setting the "Authorization Basic" base64string header |
-H* |
| Set this to: Content - Type: application/json |
Request Body
Name | Type | Description |
---|---|---|
computational_id* | string | Identification of computational run |
List Files Computation URL
GET
https://{domain}/api/v1/computations/{computations_id}
This API allows for the generation of a URL to download a file from a Computation.
Path Parameters
Name | Type | Description |
---|---|---|
GET* |
| /computations/:computation_id |
Headers
Name | Type | Description |
---|---|---|
-u* |
| authorize with Code Ocean API Secret: -u $API_SECRET: This is setting the "Authorization Basic" base64string header |
-H* |
| Set this to: Content - Type: application/json |
Request Body
Name | Type | Description |
---|---|---|
computational_id* | string | identification of the computational run |
Run Computation
POST
https://{domain}/api/v1/computations
This API allows for the running of Capsules/Pipelines with Data Assets.
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.
Path Parameters
Name | Type | Description |
---|---|---|
POST* |
| /computations/ |
Headers
Name | Type | Description |
---|---|---|
-u:* |
| Authorize with Code Ocean API Secret: -u $API_SECRET : |
-H:* |
| Set this to: Content - Type: application/json |
--data-raw:* |
| JSON with parameters |
Request Body
Name | Type | Description |
---|---|---|
capsule_id* | string | identification of the capsule if both capsule_id and pipeline_id are used, only the capsule id will be used |
pipeline_id | string | identification of the pipeline |
data_assets* | array |
|
ID* | string | identification of the data asset to be used in the computational run |
Mount | string | name of the folder to mount the dataset into position |
Run Capsule
Run Pipeline
Last updated