import requests
url = "https://api.platform.ankra.app/org/clusters/scaleway/{cluster_id}/ssh-keys"
payload = { "ssh_key_credential_ids": ["<string>"] }
headers = {
"cookie": "ankra_session=",
"X-Ankra-CSRF": "<x-ankra-csrf>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
cookie: 'ankra_session=',
'X-Ankra-CSRF': '<x-ankra-csrf>',
'Content-Type': 'application/json'
},
body: JSON.stringify({ssh_key_credential_ids: ['<string>']})
};
fetch('https://api.platform.ankra.app/org/clusters/scaleway/{cluster_id}/ssh-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://api.platform.ankra.app/org/clusters/scaleway/{cluster_id}/ssh-keys \
--header 'Content-Type: application/json' \
--header 'X-Ankra-CSRF: <x-ankra-csrf>' \
--cookie ankra_session= \
--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 (browser session)
Replaces the cluster’s SSH keys. Every node gets the new set as its whole authorized_keys. Nothing is written on the Public Gateway, a managed appliance with no shell: it takes its SSH keys from the Scaleway project’s IAM keys, which this change does not update, so a key removed here can still open the gateway, though no longer a node behind it. 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. Browser session authentication; RBAC permission clusters.write. PAT mutations support wait=false where implemented; browser mutations require CSRF.
import requests
url = "https://api.platform.ankra.app/org/clusters/scaleway/{cluster_id}/ssh-keys"
payload = { "ssh_key_credential_ids": ["<string>"] }
headers = {
"cookie": "ankra_session=",
"X-Ankra-CSRF": "<x-ankra-csrf>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
cookie: 'ankra_session=',
'X-Ankra-CSRF': '<x-ankra-csrf>',
'Content-Type': 'application/json'
},
body: JSON.stringify({ssh_key_credential_ids: ['<string>']})
};
fetch('https://api.platform.ankra.app/org/clusters/scaleway/{cluster_id}/ssh-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://api.platform.ankra.app/org/clusters/scaleway/{cluster_id}/ssh-keys \
--header 'Content-Type: application/json' \
--header 'X-Ankra-CSRF: <x-ankra-csrf>' \
--cookie ankra_session= \
--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.