Create data source credential
import requests
url = "https://platform.ankra.app/org/credentials/datasource"
payload = { "name": "infra-opensearch" }
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({name: 'infra-opensearch'})
};
fetch('https://platform.ankra.app/org/credentials/datasource', 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/datasource \
--header 'Content-Type: application/json' \
--header 'X-Ankra-CSRF: <x-ankra-csrf>' \
--cookie ankra_session= \
--data '
{
"name": "infra-opensearch"
}
'{
"errors": [],
"id": "00000000-0000-0000-0000-000000000001",
"name": "infra-opensearch",
"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"
}Data Source Credentials
Create data source credential
Browser session authentication; RBAC permission credentials.write. Creates the org-scoped credential the metrics and log data sources reference by credential_name; the secret is stored in Vault and never echoed.
POST
/
org
/
credentials
/
datasource
Create data source credential
import requests
url = "https://platform.ankra.app/org/credentials/datasource"
payload = { "name": "infra-opensearch" }
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({name: 'infra-opensearch'})
};
fetch('https://platform.ankra.app/org/credentials/datasource', 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/datasource \
--header 'Content-Type: application/json' \
--header 'X-Ankra-CSRF: <x-ankra-csrf>' \
--cookie ankra_session= \
--data '
{
"name": "infra-opensearch"
}
'{
"errors": [],
"id": "00000000-0000-0000-0000-000000000001",
"name": "infra-opensearch",
"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