curl --request PUT \ --url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/{Instance_id}/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "cluster_type": "string", "sku_id": 0, "sku_item_price_id": 0, "committed_instance_policy": "auto_renew", "next_sku_item_price_id": 0}'import requests
response = requests.put( "https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/{Instance_id}/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "cluster_type": "string", "sku_id": 0, "sku_item_price_id": 0, "committed_instance_policy": "auto_renew", "next_sku_item_price_id": 0, },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/{Instance_id}/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", location: "<LOCATION>", apikey: "<API_KEY>" });
const response = await fetch(url, { method: "PUT", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "cluster_type": "string", "sku_id": 0, "sku_item_price_id": 0, "committed_instance_policy": "auto_renew", "next_sku_item_price_id": 0 }),});console.log(await response.json());Changes the plan of an hourly Instance or Virtual Machine, or converts it to a committed plan. The VM must be stopped before its plan changes (“Please stop your notebook before Updation.”); a conversion to a committed plan works in any state except stopped, stopping or error. A plan change is refused when the new plan is the current plan (“This plan is already selected”) or a free plan (“You cannot update notebook to a free plan”). After the change, a VM that was stopped starts again. To convert, send a committed sku_item_price_id with committed_instance_policy. A private cluster VM cannot be converted (“Compute resources running on Private Cloud cannot be converted to a Committed Plan”). The plan of a committed VM cannot change; sending committed_instance_policy and next_sku_item_price_id changes only what happens when its term ends.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Instance ID
Query Parameters
Section titled “Query Parameters”Project ID
Active IAM ID (To access contact person account) Find your Active IAM ID here
Location
Request Bodyrequired
Section titled “Request Bodyrequired”object
The type of the cluster
The SKU ID
The SKU item price ID. A committed one converts the VM to that committed plan.
What happens when the committed term ends: auto_renew, convert_to_hourly_billing or auto_terminate. Required with a committed sku_item_price_id. Anything else is refused with “Invalid Updation policy chosen for committed instance”.
The plan to continue on after the term, for auto_renew and convert_to_hourly_billing. Not used with auto_terminate.
Responses
Section titled “Responses”Notebook details retrieved successfully
object
object
object
object
object
object
object
object
object
Example
{ "code": 200, "message": "Success", "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": 5, "sku_type": "hourly", "committed_days": 0, "unit_price": 3.1, "currency": "INR", "is_active": true, "description": null } }, "status": "stopped", "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-13T12:04:13.981427Z", "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": {}}