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