Create an Ankra Cloud credential (browser session)
import requests
url = "https://platform.ankra.app/org/credentials/ankracloud"
payload = {
"api_token": "<secret>",
"name": "ankra-cloud-production"
}
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({api_token: '<secret>', name: 'ankra-cloud-production'})
};
fetch('https://platform.ankra.app/org/credentials/ankracloud', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/org/credentials/ankracloud \
--header 'Content-Type: application/json' \
--header 'X-Ankra-CSRF: <x-ankra-csrf>' \
--cookie ankra_session= \
--data '
{
"api_token": "<secret>",
"name": "ankra-cloud-production"
}
'{
"errors": [],
"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"
}Ankra Cloud Credentials
Create an Ankra Cloud credential (browser session)
Browser session authentication; RBAC permission credentials.write. The secret is stored in Vault and connection-tested without echoing key material. Answers 404 while the organisation’s ankra_cloud_provider feature flag is off.
POST
/
org
/
credentials
/
ankracloud
Create an Ankra Cloud credential (browser session)
import requests
url = "https://platform.ankra.app/org/credentials/ankracloud"
payload = {
"api_token": "<secret>",
"name": "ankra-cloud-production"
}
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({api_token: '<secret>', name: 'ankra-cloud-production'})
};
fetch('https://platform.ankra.app/org/credentials/ankracloud', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/org/credentials/ankracloud \
--header 'Content-Type: application/json' \
--header 'X-Ankra-CSRF: <x-ankra-csrf>' \
--cookie ankra_session= \
--data '
{
"api_token": "<secret>",
"name": "ankra-cloud-production"
}
'{
"errors": [],
"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
Browser session. Mutations also require X-Ankra-CSRF.
Headers
Must match the ankra_csrf browser cookie.
Body
application/json