Skip to content

Add Or Remove SSH Keys

PUT
/notebooks/{Instance_id}/ssh-keys/
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"
]
}'

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.

Instance_id
required
integer

Instance ID

project_id
required
integer

Project ID

active_iam
integer

Active IAM ID (To access contact person account) Find your Active IAM ID here

location
required
string
Allowed values: Delhi Chennai

Location

Media typeapplication/json
object
ssh_keys_to_add

SSH public keys to add, as the key text.

Array<string>
ssh_keys_to_remove

SSH public keys to remove, as the key text. all removes every key.

Array<string>

Example

{
"ssh_keys_to_add": [
"ssh-rsa AAAAB3NzaC1yc2..........................Enjr.local"
]
}

Operation successful, but no data returned

Media typeapplication/json
object
code
integer
message
string
data
object
errors
object

Example

{
"code": 200,
"message": "Success",
"data": {},
"errors": {}
}