import requests
url = "https://platform.ankra.app/api/v1/clusters/hetzner"
payload = {
"credential_id": "<string>",
"location": "<string>",
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({credential_id: '<string>', location: '<string>', name: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/clusters/hetzner', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/clusters/hetzner \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credential_id": "<string>",
"location": "<string>",
"name": "<string>"
}
'{
"cluster_id": "<string>",
"name": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create a Hetzner cluster
import requests
url = "https://platform.ankra.app/api/v1/clusters/hetzner"
payload = {
"credential_id": "<string>",
"location": "<string>",
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({credential_id: '<string>', location: '<string>', name: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/clusters/hetzner', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/clusters/hetzner \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credential_id": "<string>",
"location": "<string>",
"name": "<string>"
}
'{
"cluster_id": "<string>",
"name": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
11Omit to let the platform pick the cheapest x86 type the target location can currently provision that meets the role's minimum size.
1Container network. Omitted resolves to cilium on kubeadm (the default distribution) and flannel on k3s.
flannel, calico, cilium 1 <= x <= 5Omit to let the platform pick the cheapest x86 type the target location can currently provision that meets the role's minimum size.
1production, staging, development, disposable 1 - 50Omit to let the platform pick the cheapest x86 type the target location can currently provision that meets the role's minimum size.
k3s packaged components to keep disabled (k3s --disable), for example ["traefik"] on a cluster that brings its own ingress. k3s distribution only: the list is rendered into the server config at install and re-asserted by the maintenance pass, so the entries stay off across restarts.
coredns, servicelb, traefik, local-storage, metrics-server, runtimes Show child attributes
Show child attributes
0 <= x <= 50Omit to let the platform pick the cheapest x86 type the target location can currently provision that meets the role's minimum size.
1