The Kernel API allows you to automate repeated tasks programmatically.
To get started, have your Organization Owner generate an API key on the Organization Settings page.
External/Customer facing API
Routes for:
- All dataset IDs + metadata in a study
- Run a pipeline, given a dataset ID and pipeline name
- Status for most recent pipeline run and signed urls if present, given dataset ID and pipeline name
NOTE:
Each route requires an API key in the header, such as: An Organization Owner can generate an API key on the Organization Settings page.
Common ways to use Kernel API
To find yourstudy_id:
Navigate to the study in portal and notice the URL looks like:
https://portal.kernel.com/organizations/2d1fee1c-c2bc-4833-b560-afc673140f42/studies/b249e4b9-9108-4ce4-a7ce-41cc3bbd2bf2/datasets
The bold part b249e4b9-9108-4ce4-a7ce-41cc3bbd2bf2 is your study_id to use in the following routes.
List all dataset IDs and metadata in a study:
list_datasets(study_id : str)--> Dict[str, List[dict]]
/api/vi/study/{study_id}/datasets
- Parameters:
- study_id (str) - study id
- Returns:
- All dataset IDs and metadata in a study
- Return Type:
- Dict[str, List[dict]]
Examples
Available pipelines:
Get the status of the most recent pipeline run for a dataset and asset URLs if available:
pipeline_status(study_id : str, dataset_id: str, pipeline_name: str)
/api/vi/study/{study_id}/dataset/{dataset_id}/pipeline/{pipeline_name]/status
- Parameters:
- study_id (str) - study id
- dataset_id (str) - dataset id
- pipeline_name (str) - pipeline name
- Returns:
- Status of the most recent pipeline run and asset URLs if available
- Return Type:
- dict
Examples
Run a pipeline for a dataset:
run_pipeline(study_id : str, dataset_id: str, pipeline_name: str) --> Dict[str, Any]
/api/vi/study/{study_id}/dataset/{dataset_id}/pipeline/{pipeline_name}
- Parameters:
- study_id (str) - study id
- dataset_id (str) - dataset id
- pipeline_name (str) - pipeline name
- Returns:
- Job ID if the pipeline run
- Return Type:
- Dict
Examples
.