import requests
url = "https://platform.ankra.app/api/v1/clusters/ankracloud/{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/ankracloud/{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/ankracloud/{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": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Update SSH keys
Replaces the cluster’s SSH keys and rewrites authorized_keys on every node and the bastion as the whole file, for root and for the debian and ubuntu login accounts: a line someone added by hand to one of those files on a node is not 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. Bearer PAT authentication; RBAC permission clusters.write. PAT mutations support wait=false where implemented; browser mutations require CSRF. Answers 404 while the organisation’s aws_provider feature flag is off.
import requests
url = "https://platform.ankra.app/api/v1/clusters/ankracloud/{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/ankracloud/{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/ankracloud/{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": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}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.