curl --request PUT \ --url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/{Instance_id}/ssh-keys/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "ssh_keys_to_add": [ "ssh-rsa AAAAB3NzaC1yc2..........................Enjr.local" ]}'import requests
response = requests.put( "https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/{Instance_id}/ssh-keys/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "ssh_keys_to_add": [ "ssh-rsa AAAAB3NzaC1yc2..........................Enjr.local", ], },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/{Instance_id}/ssh-keys/");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({ "ssh_keys_to_add": [ "ssh-rsa AAAAB3NzaC1yc2..........................Enjr.local" ] }),});console.log(await response.json());Adds SSH public keys to an Instance or Virtual Machine, removes keys, or both in one request. A key you add must already be saved in your account’s SSH keys. A key change does not restart the VM. It works while the VM is running or stopped; in any other state it is refused with “SSH keys can only be updated when the Node is in a Running or Stopped state. Please try again later.” Adding a key needs a security group on the VM (“At least one security group must be attached to the node when SSH is enabled.”). A request with nothing to add or remove is refused with “No SSH keys provided. Please specify at least one SSH key to add or remove.” When the image requires SSH, the last key cannot be removed.
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
SSH public keys to add, as the key text.
SSH public keys to remove, as the key text. all removes every key.
Example
{ "ssh_keys_to_add": [ "ssh-rsa AAAAB3NzaC1yc2..........................Enjr.local" ]}Responses
Section titled “Responses”Operation successful, but no data returned
object
object
object
Example
{ "code": 200, "message": "Success", "data": {}, "errors": {}}