import requests
url = "https://api.platform.ankra.app/org/credentials/transip"
payload = {
"login": "example-login",
"name": "transip-production",
"private_key": "<secret>"
}
headers = {
"cookie": "ankra_session=",
"X-Ankra-CSRF": "<x-ankra-csrf>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
cookie: 'ankra_session=',
'X-Ankra-CSRF': '<x-ankra-csrf>',
'Content-Type': 'application/json'
},
body: JSON.stringify({login: 'example-login', name: 'transip-production', private_key: '<secret>'})
};
fetch('https://api.platform.ankra.app/org/credentials/transip', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.platform.ankra.app/org/credentials/transip \
--header 'Content-Type: application/json' \
--header 'X-Ankra-CSRF: <x-ankra-csrf>' \
--cookie ankra_session= \
--data '
{
"login": "example-login",
"name": "transip-production",
"private_key": "<secret>"
}
'{
"errors": [],
"id": "6f1c2a43-3f3e-4c1e-9a55-0f4d1e2b7c10",
"name": "production",
"success": true
}{
"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"
}Create a TransIP credential (browser session)
Browser session authentication; RBAC permission credentials.write. Stores a TransIP API key pair: login is the control panel login and private_key the key pair’s private key in PEM. The key pair signs in to TransIP before anything is stored, and one that cannot answers 400 with the reason: a private key that is not PEM, a login or key pair TransIP refuses, a key pair that only accepts whitelisted IP addresses (the message names the address Ankra called from), or an account with the API switched off. The private key is stored in Vault and is never returned. A TransIP key pair is not limited to Kubernetes: it reaches the whole TransIP account, domains and invoices included, so use a TransIP account that holds only the clusters Ankra should manage. Answers 404 while the organisation’s transip_provider feature flag is off.
import requests
url = "https://api.platform.ankra.app/org/credentials/transip"
payload = {
"login": "example-login",
"name": "transip-production",
"private_key": "<secret>"
}
headers = {
"cookie": "ankra_session=",
"X-Ankra-CSRF": "<x-ankra-csrf>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
cookie: 'ankra_session=',
'X-Ankra-CSRF': '<x-ankra-csrf>',
'Content-Type': 'application/json'
},
body: JSON.stringify({login: 'example-login', name: 'transip-production', private_key: '<secret>'})
};
fetch('https://api.platform.ankra.app/org/credentials/transip', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.platform.ankra.app/org/credentials/transip \
--header 'Content-Type: application/json' \
--header 'X-Ankra-CSRF: <x-ankra-csrf>' \
--cookie ankra_session= \
--data '
{
"login": "example-login",
"name": "transip-production",
"private_key": "<secret>"
}
'{
"errors": [],
"id": "6f1c2a43-3f3e-4c1e-9a55-0f4d1e2b7c10",
"name": "production",
"success": true
}{
"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
Body
The private key of a TransIP API key pair, PEM encoded, with its BEGIN and END lines. TransIP shows it once, when the key pair is created. It reaches the whole TransIP account, domains and invoices included, so create it in an account that holds only the clusters Ankra should manage. A key pair that only accepts whitelisted IP addresses is refused unless the address Ankra calls from is on its list.