curl --request PUT \ --url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/distributed_jobs_v2/cluster/{Cluster_Id}/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "action": "update_ssh_keys", "ssh_key_ids": [ 0 ], "image_version_id": 0, "additional_nodes": 0, "reserved_ip_id": 0, "ip_type": "reserved", "security_groups_ids": [ 0 ], "security_group_id": 0}'import requests
response = requests.put( "https://api.e2enetworks.com/myaccount/api/v1/gpu/distributed_jobs_v2/cluster/{Cluster_Id}/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "action": "update_ssh_keys", "ssh_key_ids": [ 0, ], "image_version_id": 0, "additional_nodes": 0, "reserved_ip_id": 0, "ip_type": "reserved", "security_groups_ids": [ 0, ], "security_group_id": 0, },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/gpu/distributed_jobs_v2/cluster/{Cluster_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({ "action": "update_ssh_keys", "ssh_key_ids": [ 0 ], "image_version_id": 0, "additional_nodes": 0, "reserved_ip_id": 0, "ip_type": "reserved", "security_groups_ids": [ 0 ], "security_group_id": 0 }),});console.log(await response.json());Performs an action on a running Training Cluster. The action field in the request body determines the operation. Additional fields are required depending on the action:
| Action | Required Fields | Description |
|---|---|---|
update_ssh_keys |
ssh_key_ids |
Replace SSH keys on all cluster nodes |
update_image |
image_version_id |
Update the container image on all cluster nodes |
restart_workers |
— | Restart all compute (worker) nodes without restarting the Slurm controller |
restart_cluster |
— | Restart the full cluster including the Slurm controller and all nodes |
scale_cluster |
additional_nodes |
Add nodes to a running cluster without teardown or workload disruption |
attach_ip |
reserved_ip_id |
Attach a reserved public IP to the cluster. Returns a Reserved IP object instead of a cluster object. |
detach_ip |
reserved_ip_id, ip_type |
Detach a reserved public IP from the cluster. Returns an empty data object. |
add_security_group |
security_groups_ids |
Attach one or more security groups to the cluster. Returns a success string. |
remove_security_group |
security_group_id |
Remove a security group from the cluster. Returns a success string. |
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Cluster 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
Action to perform on the cluster. Each action may require additional fields.
Required for update_ssh_keys. List of SSH key IDs to attach to all cluster nodes.
Required for update_image. ID of the image version to apply to all cluster nodes.
Required for scale_cluster. Number of nodes to add to the running cluster.
Required for attach_ip and detach_ip. ID of the reserved IP.
Required for detach_ip. Type of IP being detached.
Required for add_security_group. List of security group IDs to attach to the cluster.
Required for remove_security_group. ID of the security group to remove from the cluster.
Responses
Section titled “Responses”Action performed successfully. Returns the updated cluster object.
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
Example
{ "code": 200, "data": { "id": 101, "name": "training-cluster-010125103045", "created_by": { "id": 1001, "name": "John Doe", "email": "user@example.com", "username": "user@example.com", "is_primary_contact": true, "currency": "INR", "is_suspended": false }, "no_of_nodes": 1, "created_at": "2025-01-15T10:30:00Z", "private_cloud_id": null, "private_cloud_name": null, "sku_details": { "specs": { "sku_id": 139, "name": "C3.32GB", "series": "CPU", "cpu": 8, "gpu": 0, "memory": 32, "ephemeral_storage": 0, "gpu_memory": 0, "is_free": false, "is_active": true, "local_storage_in_gb": 0, "sku_type": "C3-250GB", "gpu_card_type": null, "category": "distributed_job", "variant": "e2e", "no_of_nodes": 1 }, "plan": { "sku_item_price_id": 645, "sku_type": "hourly", "committed_days": 0, "unit_price": 12.3, "currency": "INR", "is_active": true, "description": null, "location": "Delhi" } }, "total_gpu": 0, "total_cpu": 0, "total_memory": "0 GB", "available_gpu": 0, "available_cpu": 0, "available_memory": "0 GB", "worker_nodes": [], "has_local_storage": false, "local_storage_per_node": null, "status": "Running", "image_pull_policy": "IfNotPresent", "image_version": { "id": 2, "version": "v2-slurm25.11-ubuntu24.04", "description": "", "tags": [], "name": "Ubuntu Slurm", "slug_name": "ubuntu-slurm", "framework": "Slurm", "is_internal": false }, "ssh_keys": [ { "pk": 1001, "label": "my-ssh-key", "ssh_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAB... user@example.com" } ], "ssh_public_ip": "203.0.113.10", "has_floating_ip": true, "reserve_ip": [], "clone_data": { "name": "training-cluster-010125103045", "sku_id": 139, "project_id": 10001, "no_of_nodes": 1, "ssh_key_ids": [ 1001, 1002 ], "script_added": false, "pfs_mount_list": [], "sfs_mount_list": [], "image_version_id": 2, "lifecycle_script": "", "security_group_id": 1001, "sku_item_price_id": 645, "dataset_mount_list": [] } }, "errors": {}, "message": "Cluster updated successfully"}