import requests
url = "https://platform.ankra.app/api/v1/clusters/digitalocean/{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/digitalocean/{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/digitalocean/{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": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Update node-group host config
Sets the encrypted swap a node group’s new nodes are built with (swap_gibibytes, 0 clears it). Only OVH k3s workers can carry swap, so on a DigitalOcean cluster this path always answers 409 naming that; it is mounted on every provider so the node-group surface is the same everywhere. Requires clusters.write.
import requests
url = "https://platform.ankra.app/api/v1/clusters/digitalocean/{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/digitalocean/{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/digitalocean/{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": [
{
"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.
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
The setting as written
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.