Create a Ankra Cloud credential
import requests
url = "https://platform.ankra.app/api/v1/credentials/ankracloud"
payload = {
"api_token": "<secret>",
"name": "ankra-cloud-production"
}
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({api_token: '<secret>', name: 'ankra-cloud-production'})
};
fetch('https://platform.ankra.app/api/v1/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/api/v1/credentials/ankracloud \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--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 a Ankra Cloud credential
Bearer PAT 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
/
api
/
v1
/
credentials
/
ankracloud
Create a Ankra Cloud credential
import requests
url = "https://platform.ankra.app/api/v1/credentials/ankracloud"
payload = {
"api_token": "<secret>",
"name": "ankra-cloud-production"
}
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({api_token: '<secret>', name: 'ankra-cloud-production'})
};
fetch('https://platform.ankra.app/api/v1/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/api/v1/credentials/ankracloud \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
PAT organisation override.
Body
application/json