import requests
url = "https://platform.ankra.app/api/v1/clusters/ovh/{cluster_id}/node-groups/{group_name}/host-config"
payload = { "swap_gibibytes": 512 }
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({swap_gibibytes: 512})
};
fetch('https://platform.ankra.app/api/v1/clusters/ovh/{cluster_id}/node-groups/{group_name}/host-config', 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/ovh/{cluster_id}/node-groups/{group_name}/host-config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"swap_gibibytes": 512
}
'{
"group_name": "<string>",
"swap_gibibytes": 123,
"existing_workers": 123,
"message": "<string>",
"swap_behavior": "<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 node-group host config
Sets the encrypted swap the group’s new nodes are built with: swap_gibibytes (0 clears the setting, and the field is required so that an omitted value cannot clear it) and swap_behavior (LimitedSwap, the only value and the default). Existing nodes are not changed: the setting is read once, on a new node’s way in, so this call starts no work on any node and answers once the definitions are written. A node that cannot take swap still joins without it, and the node-group listing names it in workers_without_swap; a node the platform has no answer from is in workers_swap_unknown and may have swap. OVH k3s workers on Kubernetes v1.36 or newer only: kubeadm clusters, older releases and groups with no live workers answer 409, as does this path on every other provider. A group’s swap is stored on its workers, so for a group with no live workers, set it when adding the group, or, for a group its autoscaler parked at zero, here once a node is back.
import requests
url = "https://platform.ankra.app/api/v1/clusters/ovh/{cluster_id}/node-groups/{group_name}/host-config"
payload = { "swap_gibibytes": 512 }
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({swap_gibibytes: 512})
};
fetch('https://platform.ankra.app/api/v1/clusters/ovh/{cluster_id}/node-groups/{group_name}/host-config', 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/ovh/{cluster_id}/node-groups/{group_name}/host-config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"swap_gibibytes": 512
}
'{
"group_name": "<string>",
"swap_gibibytes": 123,
"existing_workers": 123,
"message": "<string>",
"swap_behavior": "<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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
PAT organisation override.
Body
Size in GiB of the encrypted swap the group's new nodes are built with, 1 to 1024. 0 clears the setting.
0 <= x <= 1024Kubelet swap behaviour of those nodes. Defaults to LimitedSwap when a size is set; refused with 0.
LimitedSwap Response
Successful response
The size now set, 0 when the setting was cleared.
Workers already in the group, none of which were changed.
Plain statement of what changed, and that existing nodes did not.
The behaviour now set. Omitted when the setting was cleared.