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": []}'import requests
response = requests.put( "https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/autoscale-groups/{group_id}/ssh-keys/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "ssh_keys_to_add": [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyOnlyNotARealKey user@example.com", ], "ssh_keys_to_remove": [], },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/autoscale-groups/{group_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-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyOnlyNotARealKey user@example.com" ], "ssh_keys_to_remove": [] }),});console.log(await response.json());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.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Auto Scaling Group 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
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.
Example
allExample
{ "ssh_keys_to_add": [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExampleKeyOnlyNotARealKey user@example.com" ], "ssh_keys_to_remove": []}Responses
Section titled “Responses”SSH keys updated
object
The SSH keys of the group. Every VM in the group gets them.
object
object
ID of the SSH key.
The public key.
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.
object
object
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.”
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.
object
object
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.
object
object
Example
{ "code": 412, "message": "Precondition Failed", "data": {}, "errors": "Failed to update SSH keys on the cluster."}