import requests
url = "https://platform.ankra.app/api/v1/org/custom-dns-zones"
payload = {
"credential_name": "smartoptics-dns",
"zone": "smartoptics.dev"
}
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_name: 'smartoptics-dns', zone: 'smartoptics.dev'})
};
fetch('https://platform.ankra.app/api/v1/org/custom-dns-zones', 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/org/custom-dns-zones \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credential_name": "smartoptics-dns",
"zone": "smartoptics.dev"
}
'{
"success": true,
"zone": "<string>",
"credential_name": "<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"
}Declare a custom DNS zone for every cluster in the organisation
The DNS zones every cluster in the organisation serves with the organisation’s own external-dns webhook credential, alongside the delegated zone Ankra serves itself. A zone declared here behaves like the generated domain: each cluster - the ones that exist and the ones created later - gets its own external-dns deployment for it, pinned to that zone with its own cluster-derived txt owner id. A cluster’s own declaration of the same zone (the per-cluster custom-dns-zones route) takes precedence over the organisation-wide one on that cluster. A zone that overlaps the zone Ankra already serves for the organisation - its delegated zone on the shared platform root, or the whole domain when a custom Ankra domain is registered - is refused with 400.
import requests
url = "https://platform.ankra.app/api/v1/org/custom-dns-zones"
payload = {
"credential_name": "smartoptics-dns",
"zone": "smartoptics.dev"
}
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_name: 'smartoptics-dns', zone: 'smartoptics.dev'})
};
fetch('https://platform.ankra.app/api/v1/org/custom-dns-zones', 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/org/custom-dns-zones \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credential_name": "smartoptics-dns",
"zone": "smartoptics.dev"
}
'{
"success": true,
"zone": "<string>",
"credential_name": "<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.
Headers
PAT organisation override.