Skip to main content
Version: 0.6.0

Environment REST API

Note: The Environment API is in the alpha stage which is subjected to incompatible changes in future releases.

Create Environment​

POST /api/v1/environment

Example Request

curl -X POST -H "Content-Type: application/json" -d '
{
"name": "my-submarine-env",
"dockerImage" : "continuumio/anaconda3",
"kernelSpec" : {
"name" : "team_default_python_3.7",
"channels" : ["defaults"],
"condaDependencies" :
["_ipyw_jlab_nb_ext_conf=0.1.0=py37_0",
"alabaster=0.7.12=py37_0",
"anaconda=2020.02=py37_0",
"anaconda-client=1.7.2=py37_0",
"anaconda-navigator=1.9.12=py37_0"],
"pipDependencies" :
["apache-submarine==0.5.0",
"pyarrow==0.17.0"]
}
}
' http://127.0.0.1:32080/api/v1/environment

Example Response:

{
"status": "OK",
"code": 200,
"result": {
"environmentId": "environment_1586156073228_0001",
"environmentSpec": {
"name": "my-submarine-env",
"dockerImage" : "continuumio/anaconda3",
"kernelSpec" : {
"name" : "team_default_python_3.7",
"channels" : ["defaults"],
"condaDependencies" :
["_ipyw_jlab_nb_ext_conf=0.1.0=py37_0",
"alabaster=0.7.12=py37_0",
"anaconda=2020.02=py37_0",
"anaconda-client=1.7.2=py37_0",
"anaconda-navigator=1.9.12=py37_0"],
"pipDependencies" :
["apache-submarine==0.5.0",
"pyarrow==0.17.0"]
}
}
}
}

List environment​

GET /api/v1/environment

Example Request:

curl -X GET http://127.0.0.1:32080/api/v1/environment

Example Response:

{
"status": "OK",
"code": 200,
"result": [
{
"environmentId": "environment_1586156073228_0001",
"environmentSpec": {
"name": "my-submarine-env",
"dockerImage" : "continuumio/anaconda3",
"kernelSpec" : {
"name" : "team_default_python_3.7",
"channels" : ["defaults"],
"condaDependencies" :
["_ipyw_jlab_nb_ext_conf=0.1.0=py37_0",
"alabaster=0.7.12=py37_0",
"anaconda=2020.02=py37_0",
"anaconda-client=1.7.2=py37_0",
"anaconda-navigator=1.9.12=py37_0"],
"pipDependencies" :
["apache-submarine==0.5.0",
"pyarrow==0.17.0"]
}
}
},
{
"environmentId": "environment_1586156073228_0002",
"environmentSpec": {
"name": "my-submarine-env-2",
"dockerImage" : "continuumio/miniconda",
"kernelSpec" : {
"name" : "team_miniconda_python_3.7",
"channels" : ["defaults"],
"condaDependencies" :
["_ipyw_jlab_nb_ext_conf=0.1.0=py37_0"],
"pipDependencies" :
[],
}
}
}
]
}

Get environment​

GET /api/v1/environment/{name}

Example Request:

curl -X GET http://127.0.0.1:32080/api/v1/environment/my-submarine-env

Example Response:

{
"status": "OK",
"code": 200,
"result": {
"environmentId": "environment_1586156073228_0001",
"environmentSpec": {
"name": "my-submarine-env",
"dockerImage" : "continuumio/anaconda3",
"kernelSpec" : {
"name" : "team_default_python_3.7",
"channels" : ["defaults"],
"condaDependencies" :
["_ipyw_jlab_nb_ext_conf=0.1.0=py37_0",
"alabaster=0.7.12=py37_0",
"anaconda=2020.02=py37_0",
"anaconda-client=1.7.2=py37_0",
"anaconda-navigator=1.9.12=py37_0"],
"pipDependencies" :
["apache-submarine==0.5.0",
"pyarrow==0.17.0"]
}
}
}
}

Patch environment​

PATCH /api/v1/environment/{name}

Example Request:

curl -X PATCH -H "Content-Type: application/json" -d '
{
"name": "my-submarine-env",
"dockerImage" : "continuumio/anaconda3",
"kernelSpec" : {
"name" : "team_default_python_3.7_updated",
"channels" : ["defaults"],
"condaDependencies" :
["_ipyw_jlab_nb_ext_conf=0.1.0=py37_0",
"alabaster=0.7.12=py37_0"],
"pipDependencies" :
[]
}
}
' http://127.0.0.1:32080/api/v1/environment/my-submarine-env

Example Response:

{
"status": "OK",
"code": 200,
"success": true,
"result": {
"environmentId": "environment_1586156073228_0001",
"environmentSpec": {
"name": "my-submarine-env",
"dockerImage" : "continuumio/anaconda3",
"kernelSpec" : {
"name" : "team_default_python_3.7_updated",
"channels" : ["defaults"],
"condaDependencies" :
["_ipyw_jlab_nb_ext_conf=0.1.0=py37_0",
"alabaster=0.7.12=py37_0"],
"pipDependencies" :
[]
}
}
}
}

dockerImage, "name" (of kernelSpec), "channels", "condaDependencies", "pipDependencies" etc can be updated using this API. "name" of EnvironmentSpec is not supported.

Delete environment​

GET /api/v1/environment/{name}

Example Request:

curl -X DELETE http://127.0.0.1:32080/api/v1/environment/my-submarine-env

Example Response:

{
"status": "OK",
"code": 200,
"result": {
"environmentId": "environment_1586156073228_0001",
"environmentSpec": {
"name": "my-submarine-env",
"dockerImage" : "continuumio/anaconda3",
"kernelSpec" : {
"name" : "team_default_python_3.7_updated",
"channels" : ["defaults"],
"condaDependencies" :
["_ipyw_jlab_nb_ext_conf=0.1.0=py37_0",
"alabaster=0.7.12=py37_0"],
"pipDependencies" :
[]
}
}
}
}