Skip to content

Update Auto Scaling Group SSH Keys

PUT
/notebooks/autoscale-groups/{group_id}/ssh-keys/
curl --request PUT \
--url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/autoscale-groups/{group_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-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyOnlyNotARealKey user@example.com"
],
"ssh_keys_to_remove": []
}'

Adds and removes SSH keys of an Auto Scaling Group. The change applies to the running VMs of the group and to the VMs the group adds later. The group must be Running or Stopped, and must have a Security Group when you add a key. If the cluster refuses the change, it is rolled back. Needs the permission to update.

group_id
required
integer

Auto Scaling Group 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

Public keys to add, each as the full text of the key. A key that is not yet saved in your account is saved. Send at least one of ssh_keys_to_add and ssh_keys_to_remove.

Array<string>
ssh_keys_to_remove
One of:
Array<string>

Example

{
"ssh_keys_to_add": [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyOnlyNotARealKey user@example.com"
],
"ssh_keys_to_remove": []
}

SSH keys updated

Media typeapplication/json
object
code
integer
message
string
data

The SSH keys of the group. Every VM in the group gets them.

object
ssh_keys
Array<object>
object
pk

ID of the SSH key.

integer
label
string
ssh_key

The public key.

string
errors
object

Example

{
"code": 200,
"message": "SSH keys updated",
"data": {
"ssh_keys": [
{
"pk": 88,
"label": "laptop",
"ssh_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyOnlyNotARealKey user@example.com"
}
]
},
"errors": {}
}

The group is not Running or Stopped, or neither list was sent, or keys were to be added to a group with no Security Group. errors is “Project ID is missing or invalid” when project_id is missing or not a number.

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

One of: “SSH keys can only be updated when the Node is in a Running or Stopped state. Please try again later.”, “No SSH keys provided. Please specify at least one SSH key to add or remove.”, “At least one security group must remain attached while SSH is enabled.”

string

Example

{
"code": 400,
"message": "Bad Request",
"data": {},
"errors": "SSH keys can only be updated when the Node is in a Running or Stopped state. Please try again later."
}

No Auto Scaling Group with that ID in the project and region.

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

Example

{
"code": 404,
"message": "Bad Request",
"data": {},
"errors": "Autoscale Group not found"
}

The change could not be applied. The keys are back as they were.

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

Example

{
"code": 412,
"message": "Precondition Failed",
"data": {},
"errors": "Failed to update SSH keys on the cluster."
}