Listing runtimes

The first step to working with projects using runtimes is to query the available runtimes using the cdswctl runtimes list command.

The cdswctl runtimes list command returns all runtimes in a large JSON result. For easier consumption, you can post-process this result with some 3rd-party tool, such as jq or Python's json.tool.
To query the available runtimes, use the cdswctl runtimes list command.
The following example pipes the cdswctl runtimes list result through Python's json.tool to produce a more readable output:
user@host:~ $ cdswctl runtimes list | python3 -m json.tool
{
    "runtimes": [
        {
            "id": 1,
            "imageIdentifier": "docker.repository.cloudera.com/cdsw/ml-runtime-workbench-python3.6-standard:2020.11.1-b6",
            "editor": "Workbench",
            "kernel": "Python 3.6",
            "edition": "Standard",
            "shortVersion": "2020.11",
            "fullVersion": "2020.11.1-b6",
            "maintenanceVersion": 1,
            "description": "Standard edition Python runtime provided by Cloudera"
        },
        {
            "id": 2,
            "imageIdentifier": "docker.repository.cloudera.com/cdsw/ml-runtime-jupyterlab-python3.7-standard:2020.11.1-b6",
            "editor": "JupyterLab",
            "kernel": "Python 3.7",
            "edition": "Technical Preview",
            "shortVersion": "2020.11",
            "fullVersion": "2020.11.1-b6",
            "maintenanceVersion": 1,
            "description": "Technical Preview JupyterLab Python runtime provided by Cloudera"
        }
    ]
}

The following example pipes the cdswctl runtimes list result through jq to transform the JSON output into arbitrary formats:
user@host:~ $ cdswctl runtimes list | jq -r '.runtimes[] | "\(.id) \(.imageIdentifier)"'
1
docker.repository.cloudera.com/cdsw/ml-runtime-workbench-python3.6-standard:2020.11.1-b6
2
docker.repository.cloudera.com/cdsw/ml-runtime-jupyterlab-python3.7-standard:2020.11.1-b6
The following example filters the cdswctl runtimes list result using jq to only show runtimes with specific editors and kernels:
user@host:~ $ cdswctl runtimes list | jq  '.runtimes[] | select((.editor == "Workbench") and (.kernel | contains("Python")))'

{
  "id": 1,
  "imageIdentifier": "docker.repository.cloudera.com/cdsw/ml-runtime-workbench-python3.6-standard:2020.11.1-b6",
  "editor": "Workbench",
  "kernel": "Python 3.6",
  "edition": "Standard",
  "shortVersion": "2020.11",
  "fullVersion": "2020.11.1-b6",
  "maintenanceVersion": 1,
  "description": "Standard edition Python runtime provided by Cloudera"
}