import requests
url = "https://platform.ankra.app/api/v1/clusters/digitalocean/{cluster_id}/ssh-keys"
payload = { "ssh_key_credential_ids": ["<string>"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ssh_key_credential_ids: ['<string>']})
};
fetch('https://platform.ankra.app/api/v1/clusters/digitalocean/{cluster_id}/ssh-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/clusters/digitalocean/{cluster_id}/ssh-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ssh_key_credential_ids": [
"<string>"
]
}
'{
"ssh_key_credential_ids": [
"<string>"
],
"operation_id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Update SSH keys
Replaces the SSH key credentials authorised on the cluster’s servers with ssh_key_credential_ids and starts rolling the keys out. Every node and the jump host get the new set as their whole authorized_keys. A standalone VM’s authorized_keys is edited, not replaced: a key this change removes is deleted from it wherever Ankra finds it, a copy someone added by hand included, whatever its options or comment; a listed key the VM lacks is added back on every rotation and resync, even one its owner took off; and every other line is kept. A machine the cluster’s stop or pause keeps powered off gets the new set once the cluster has started and the machine is up again. However the cluster is started, and whenever the change is saved, the rotation waits while a machine under the cluster’s key is still being created (one the start brings back, or a node being added), for at most 30 minutes after the start or the change, and then runs. A machine that is up but does not answer SSH yet is tried again every 15 seconds for up to 3 minutes, within the job’s time limit. A machine still not written is named on the failed job, and the rotation stays open and is retried, its retries counting only the failures since the start or the change. An unknown or repeated credential, or two credentials carrying the same public key, is refused with 409.
import requests
url = "https://platform.ankra.app/api/v1/clusters/digitalocean/{cluster_id}/ssh-keys"
payload = { "ssh_key_credential_ids": ["<string>"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ssh_key_credential_ids: ['<string>']})
};
fetch('https://platform.ankra.app/api/v1/clusters/digitalocean/{cluster_id}/ssh-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/clusters/digitalocean/{cluster_id}/ssh-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ssh_key_credential_ids": [
"<string>"
]
}
'{
"ssh_key_credential_ids": [
"<string>"
],
"operation_id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Response
Successful Response
The operation that applies the change: it re-registers the keys with the provider where the provider keeps a copy and rewrites authorized_keys on every node, standalone VM and the bastion, failing by name on a host it cannot reach. Null when none was created with this request; the platform then starts it from the SSH key resource's updating state. Follow it to learn whether a removed key has stopped working.