Node

TIR Notebooks are fully collaborative environments that make AI development possible. They combine power of containers, jupyter labs and AI/ML frameworks to create a readily usable workspace for you and your entire team.

List of OS Images

To get the list of os, send a GET request to the node Endpoint

https://api.e2enetworks.com/myaccount/api/v1/gpu/gpu_service/image/?category=notebook&is_jupyterlab_enabled=true&apikey={{tapi_key}}
import requests

url = "https://api.e2enetworks.com/myaccount/api/v1/gpu/gpu_service/image/?category=notebook&is_jupyterlab_enabled=true&apikey={{api_key}}"

payload={}
headers = {
'Authorization': 'Bearer {{Token}}',
'Content-Type': 'application/json',
 }


response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...

List of Plan

To get the list of plan, send a GET request to the node Endpoint

https://api.e2enetworks.com/myaccount/api/v1/gpu/gpu_service/sku/?apikey={{tapi_key}}&image_version_id={{Image_version_id}}&service=notebook
import requests

url = "https://api.e2enetworks.com/myaccount/api/v1/gpu/gpu_service/sku/?apikey={{tapi_key}}&image_version_id={{Image_version_id}}&service=notebook"

payload={}
headers = {
'Authorization': 'Bearer {{Token}}',
'Content-Type': 'application/json',
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...

List of Nodes

To get the list of Nodes, send a GET request to the node Endpoint

https://api.e2enetworks.com/myaccount/api/v1/gpu/teams/{{team_id}}/projects/{{project_id}}/notebooks/?apikey={{tapi_key}}&page_no=1&per_page=5
import requests

 url = "https://api.e2enetworks.com/myaccount/api/v1/gpu/teams/{{team_id}}/projects/{{project_id}}/notebooks/?apikey={{tapi_key}}&page_no=1&per_page=5"

 payload={}
 headers = {}

 response = requests.request("GET", url, headers=headers, data=payload)

 print(response.text)
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...

Create Node

To create a Node, send a POST request to the node Endpoint

https://api.e2enetworks.com/myaccount/api/v1/gpu/teams/{{team_id}}/projects/{{project_id}}/notebooks/?apikey={{tapi_key}}
import requests
import json

url = "https://api.e2enetworks.com/myaccount/api/v1/gpu/teams/{{team_id}}/projects/{{project_id}}/notebooks/?apikey={{tapi_key}}"

payload = "{\n    \"name\": \"container-aashish\",\n    \"image_type\": \"pre-built\",\n    \"notebook_type\": \"new\",\n    \"notebook_url\": \"\",\n    \"disk_size_in_gb\": 30,\n    \"dataset_id_list\": [],\n    \"enable_ssh\": false,\n    \"is_jupyterlab_enabled\": true,\n    \"image_version_id\": {{Image_version_id}},\n    \"sku_item_price_id\": {{CPUSkuItemPriceId}},\n    \"instance_type\": \"paid_usage\",\n    \"e2e_registry_image_url\": \"\",\n    \"next_sku_item_price_id\": null,\n    \"committed_instance_policy\": \"\"\n\n\n}\n\n"
headers = {
'Authorization': 'Bearer {{Token}}',
'Content-Type': 'application/json',
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
"name": "container-aashish",
"image_type": "pre-built",
"notebook_type": "new",
"notebook_url": "",
"disk_size_in_gb": 30,
"dataset_id_list": [],
"enable_ssh": false,
"is_jupyterlab_enabled": true,
"image_version_id": {{Image_version_id}},
"sku_item_price_id": {{CPUSkuItemPriceId}},
"instance_type": "paid_usage",
"e2e_registry_image_url": "",
"next_sku_item_price_id": null,
"committed_instance_policy": ""

}

Increase Disk Size

To increase the disk size of node, send a PUT request to the node Endpoint

https://api.e2enetworks.com/myaccount/api/v1/gpu/teams/{{team_id}}/projects/{{project_id}}/notebooks/{{container_id}}/pvc/upgrade/?apikey={{tapi_key}}
import requests

url = "https://api.e2enetworks.com/myaccount/api/v1/gpu/teams/{{team_id}}/projects/{{project_id}}/notebooks/{{container_id}}/pvc/upgrade/?apikey={{tapi_key}}"

payload = "{\n    \"size\": 76\n}"
headers = {}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
"size": 76
}

Add SSH Key

To add SSH Key to the node, send a PUT request to the node Endpoint

https://api.e2enetworks.com/myaccount/api/v1/gpu/teams/{{team_id}}/projects/{{project_id}}/notebooks/{{container_id}}/ssh-keys/?apikey={{tapi_key}}
import requests

url = "https://api.e2enetworks.com/myaccount/api/v1/gpu/teams/{{team_id}}/projects/{{project_id}}/notebooks/{{container_id}}/ssh-keys/?apikey={{tapi_key}}"

payload = "{\n    \"ssh_keys_to_add\": [\n        \"ssh-rsa AAAAB3NzbzRl.................\"\n    ]\n}"
headers = {}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
"ssh_keys_to_add": [
      "ssh-rsa AAAAB3NzaC1yc2..........................Enjr.local"
]
}

Stop Node

To stop the node, send a PUT request to the node Endpoint

https://api.e2enetworks.com/myaccount/api/v1/gpu/teams/{{team_id}}/projects/{{project_id}}/notebooks/{{container_id}}/actions/?action=stop&apikey={{tapi_key}}
import requests

url = "https://api.e2enetworks.com/myaccount/api/v1/gpu/teams/{{team_id}}/projects/{{project_id}}/notebooks/{{container_id}}/actions/?action=stop&apikey={{tapi_key}}"

payload={}
headers = {}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...

Start Node

To start the node, send a PUT request to the node Endpoint

https://api.e2enetworks.com/myaccount/api/v1/gpu/teams/{{team_id}}/projects/{{project_id}}/notebooks/{{container_id}}/actions/?action=start&apikey={{tapi_key}}
import requests

url = "https://api.e2enetworks.com/myaccount/api/v1/gpu/teams/{{team_id}}/projects/{{project_id}}/notebooks/{{container_id}}/actions/?action=start&apikey={{tapi_key}}"

payload={}
headers = {
'Authorization': 'Bearer {{Token}}',
'Content-Type': 'application/json',
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...

Update Node

To update the node, send a PUT request to the node Endpoint

https://api.e2enetworks.com/myaccount/api/v1/gpu/teams/{{team_id}}/projects/{{project_id}}/notebooks/{{container_id}}/?apikey={{tapi_key}}
import requests
import json

url = "https://api.e2enetworks.com/myaccount/api/v1/gpu/teams/{{team_id}}/projects/{{project_id}}/notebooks/{{container_id}}/?apikey={{tapi_key}}"

payload = json.dumps({
"sku_id": 4,
"sku_item_price_id": 4,
"committed_instance_policy": "",
"next_sku_item_price_id": None,
"name": "tir-container-012315481616",
"image_id": 9,
"auto_shutdown_timeout": None,
"disk_size_in_gb": 56
})
headers = {
'Authorization': 'Bearer {{Token}}',
'Content-Type': 'application/json',
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...
{
"sku_id": 4,
"sku_item_price_id": 4,
"committed_instance_policy": "",
"next_sku_item_price_id": null,
"name": "tir-container-012315481616",
"image_id": 9,
"auto_shutdown_timeout": null,
"disk_size_in_gb": 56
}

Delete Node

To delete the node, send a DELETE request to the node Endpoint

https://api.e2enetworks.com/myaccount/api/v1/gpu/teams/{{team_id}}/projects/{{project_id}}/notebooks/{{container_id}}/?apikey={{tapi_key}}
import requests

url = "https://api.e2enetworks.com/myaccount/api/v1/gpu/teams/{{team_id}}/projects/{{project_id}}/notebooks/{{container_id}}/?apikey={{tapi_key}}"

payload={}
headers = {
'Authorization': 'Bearer {{Token}}',
'Content-Type': 'application/json',
}

response = requests.request("DELETE", url, headers=headers, data=payload)

print(response.text)
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi...