curl --request POST \ --url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "name": "my-vm", "cluster_type": "tir-cluster", "image_type": "pre-built", "is_jupyterlab_enabled": true, "notebook_type": "new", "notebook_url": "", "disk_size_in_gb": 30, "dataset_id_list": [], "enable_ssh": false, "add_ons": [], "init_script_id_list": [ 120 ], "sfs_id": 62, "sfs_path": "/mnt/sfs", "image_version_id": 59, "sku_id": 4, "sku_item_price_id": 4, "app_id": 1, "instance_type": "paid_usage", "kind": "vm", "public_key": [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGEGHcYy..." ], "security_group_id": 11442, "is_pvc_encrypted": false, "pfs_id": 18, "pfs_path": "/mnt/pfs", "pfs_read_only": false, "snapshot_id": 212, "quantity": 1, "reserve_ip_id": 330, "vpc_id": 12, "subnet_id": 20}'import requests
response = requests.post( "https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "name": "my-vm", "cluster_type": "tir-cluster", "image_type": "pre-built", "is_jupyterlab_enabled": True, "notebook_type": "new", "notebook_url": "", "disk_size_in_gb": 30, "dataset_id_list": [], "enable_ssh": False, "add_ons": [], "init_script_id_list": [ 120, ], "sfs_id": 62, "sfs_path": "/mnt/sfs", "image_version_id": 59, "sku_id": 4, "sku_item_price_id": 4, "app_id": 1, "instance_type": "paid_usage", "kind": "vm", "public_key": [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGEGHcYy...", ], "security_group_id": 11442, "is_pvc_encrypted": False, "pfs_id": 18, "pfs_path": "/mnt/pfs", "pfs_read_only": False, "snapshot_id": 212, "quantity": 1, "reserve_ip_id": 330, "vpc_id": 12, "subnet_id": 20, },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", location: "<LOCATION>", apikey: "<API_KEY>" });
const response = await fetch(url, { method: "POST", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "name": "my-vm", "cluster_type": "tir-cluster", "image_type": "pre-built", "is_jupyterlab_enabled": true, "notebook_type": "new", "notebook_url": "", "disk_size_in_gb": 30, "dataset_id_list": [], "enable_ssh": false, "add_ons": [], "init_script_id_list": [ 120 ], "sfs_id": 62, "sfs_path": "/mnt/sfs", "image_version_id": 59, "sku_id": 4, "sku_item_price_id": 4, "app_id": 1, "instance_type": "paid_usage", "kind": "vm", "public_key": [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGEGHcYy..." ], "security_group_id": 11442, "is_pvc_encrypted": false, "pfs_id": 18, "pfs_path": "/mnt/pfs", "pfs_read_only": false, "snapshot_id": 212, "quantity": 1, "reserve_ip_id": 330, "vpc_id": 12, "subnet_id": 20 }),});console.log(await response.json());Creates a new compute resource.
To create a Virtual Machine, set "kind": "vm" in the request body along with "image_type": "pre-built" and a valid sku_item_price_id from the Plans List API.
Omitting kind (or setting it to any other value) creates a container-based Instance.
A VM refuses is_spot_instance (“Spot instances are not supported for VM notebooks”) and local_pv_id (“Invalid data provided”). A VM’s disk is 30 GB to 2000 GB. Set quantity to launch several identical VMs in one request.
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Project ID
Active IAM ID (To access contact person account) Find your Active IAM ID here
Location
Request Body
Section titled “Request Body”object
Up to 50 characters. It starts with a letter, ends with a letter or digit, uses only letters, digits, hyphens and underscores, and differs from every other VM and Instance in the project.
Example
my-vmExample
tir-clusterExample
pre-builtNot used for a VM.
Example
trueNot used for a VM.
Example
newExample
Size of the VM’s disk in GB. The default and the minimum are 30. A VM’s disk is at most 2000 GB, or less if the account has a smaller storage limit; a size outside the range is refused with “Notebook disk size must be between 30 and 2000 GB.” With snapshot_id, it must be at least the size of the snapshot’s source disk.
Example
30Example
[]Ignored by the backend. SSH access is determined solely by whether public_key is provided. Include this field for compatibility but it has no effect.
Example
falseExample
[]List of initialization script IDs
Example
[ 120]ID of a Shared File System to mount. Send sfs_path with it.
Example
62Mount path of the Shared File System. Read only when sfs_id is sent.
Example
/mnt/sfsExample
59Not needed. The plan comes from sku_item_price_id.
Example
4Example
4Not needed for a pre-built image. It is taken from image_version_id.
Example
1Example
paid_usageSet to "vm" to create a full OS Virtual Machine instead of a container-based Instance. Omit or leave empty for Instances.
Example
vmSSH public key strings to authorize at creation time. The key must already be saved in your TIR account (via Security → SSH Keys) — the backend looks up keys by exact string match against your saved keys. Providing an unregistered key string is silently ignored and SSH will remain disabled. This is the only way to enable SSH; enable_ssh has no effect. Send security_group_id with it, or the request is refused with “At least one security group must be attached to the node when SSH is enabled.”
Example
[ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGEGHcYy..."]ID of a Security Group to attach at creation time. Required when public_key is sent. The group must allow port 22 for SSH to work.
Example
11442Whether to encrypt the workspace disk. Defaults to false.
Example
falseID of a Parallel File System to mount. Available in Delhi. Send pfs_path with it.
Example
18Mount path of the Parallel File System. Read only when pfs_id is sent.
Example
/mnt/pfsWhether to mount the Parallel File System read-only. Defaults to false.
Example
falseID of a snapshot to launch the VM’s disk from, instead of a fresh image. The snapshot must be in the same project and its status must be ready; otherwise the request is refused with “Snapshot not found in this project.” or “Snapshot is not ready; wait for it to finish before launching from it.” A disk_size_in_gb smaller than the snapshot’s source disk is refused with “Disk size N GB is smaller than the snapshot’s source disk (M GB). Choose M GB or more.”
Example
212Number of identical VMs to launch, 1 to 10. Defaults to 1. With more than one, the names get a -1, -2 suffix and the response lists the VMs in created and the ones that failed in failed; some can succeed while others fail. A VM-only field.
Example
1ID of a reserved IP to attach. Without it the VM gets a public IP of its own.
Example
330ID of an active VPC to attach the VM to. Only a CPU VM in Delhi or Chennai can join a VPC; a GPU VM and a private cluster VM are refused. With no vpc_id, a CPU VM there joins the project’s default private network.
Example
12Subnet of that VPC. Without it, the VPC’s first subnet is used.
Example
20Responses
Section titled “Responses”Node created successfully
object
object
object
object
object
object
object
object
object
Example
{ "code": 201, "message": "Created Successfully", "data": { "id": 5633, "name": "node-11131656asd3232", "project_id": 124, "image_type": "pre-built", "image_details": { "image_id": 9, "version_id": 56, "name": "Transformers", "icon_url": "/notebook_images/hf-logo.png", "image_description": "Transformers v4.31.0 with Python 3.10 and NVIDIA Cuda 12.1 pre-installed on Ubuntu 22.04", "version_description": "Transformers v4.45.2 with Python 3.10 and NVIDIA Cuda 12.4 pre-installed on Ubuntu 22.04" }, "sku_details": { "specs": { "sku_id": 4, "name": "C3.8GB", "series": "CPU", "cpu": 4, "gpu": 0, "memory": 8, "is_free": false, "is_active": true, "gpu_switch_type": null, "local_storage_in_gb": 0 }, "plan": { "sku_item_price_id": 4, "sku_type": "hourly", "committed_days": 0, "unit_price": 3.1, "currency": "INR", "is_active": true, "description": null } }, "status": "waiting", "last_activity": null, "created_by": { "id": 3573, "name": "Nipun", "email": "nipun.arora@e2enetworks.com", "username": "nipun.arora@e2enetworks.com" }, "created_at": "2024-11-13T11:30:13.267193Z", "updated_at": "2024-11-13T11:30:13.327815Z", "lab_url": null, "disk_size_in_gb": 30, "instance_type": "paid_usage", "ssh_keys": [], "disable_ssh_login_password": true, "public_ip": "", "e2e_registry_image_url": null, "egress_gateway_ip": "116.204.174.145", "add_ons": {}, "is_jupyterlab_enabled": true, "is_ssh_enabled": false, "custom_ports": [], "private_cloud_id": null, "custom_sku": null }, "errors": {}}