import requests
url = "https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/log-source/test"
payload = {
"provider": "<string>",
"endpoint": "<string>",
"credential_name": "<string>",
"tenant_id": "<string>",
"index_pattern": "<string>",
"credential": {
"token": "<string>",
"username": "<string>",
"password": "<string>",
"auth_scheme": "<string>"
},
"verify_ssl": False
}
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({
provider: '<string>',
endpoint: '<string>',
credential_name: '<string>',
tenant_id: '<string>',
index_pattern: '<string>',
credential: {
token: '<string>',
username: '<string>',
password: '<string>',
auth_scheme: '<string>'
},
verify_ssl: false
})
};
fetch('https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/log-source/test', 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/org/clusters/imported/{cluster_id}/log-source/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"provider": "<string>",
"endpoint": "<string>",
"credential_name": "<string>",
"tenant_id": "<string>",
"index_pattern": "<string>",
"credential": {
"token": "<string>",
"username": "<string>",
"password": "<string>",
"auth_scheme": "<string>"
},
"verify_ssl": false
}
'{
"ok": true,
"message": "<string>",
"sample_count": 123,
"error_code": "<string>",
"upstream_status_code": 123
}{
"detail": "Cluster not found"
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Test a cluster log source
The bearer twin of the portal’s log store connection test, for the Ankra app and scripts. Runs a read-only query against the log store through the cluster’s agent before you save it; nothing is stored. A probe outcome, success or a classified failure, answers 200 with ok and, on failure, error_code, message and upstream_status_code: a probe result is data, so it never answers a 5xx a proxy could rewrite. Requires clusters.write on the cluster. To save the source, send it in an ImportCluster document’s spec.log_source to POST /api/v1/clusters/import.
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/log-source/test"
payload = {
"provider": "<string>",
"endpoint": "<string>",
"credential_name": "<string>",
"tenant_id": "<string>",
"index_pattern": "<string>",
"credential": {
"token": "<string>",
"username": "<string>",
"password": "<string>",
"auth_scheme": "<string>"
},
"verify_ssl": False
}
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({
provider: '<string>',
endpoint: '<string>',
credential_name: '<string>',
tenant_id: '<string>',
index_pattern: '<string>',
credential: {
token: '<string>',
username: '<string>',
password: '<string>',
auth_scheme: '<string>'
},
verify_ssl: false
})
};
fetch('https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/log-source/test', 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/org/clusters/imported/{cluster_id}/log-source/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"provider": "<string>",
"endpoint": "<string>",
"credential_name": "<string>",
"tenant_id": "<string>",
"index_pattern": "<string>",
"credential": {
"token": "<string>",
"username": "<string>",
"password": "<string>",
"auth_scheme": "<string>"
},
"verify_ssl": false
}
'{
"ok": true,
"message": "<string>",
"sample_count": 123,
"error_code": "<string>",
"upstream_status_code": 123
}{
"detail": "Cluster not found"
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Authorizations
Body
A log store to probe. Name a stored credential with credential_name, or send a new one in credential; nothing is stored.
Response
The probe outcome.
The outcome of a read-only connection probe through the cluster's agent.