import requests
url = "https://platform.ankra.app/api/v1/org/canvas-datasets/{dataset_id}/query"
payload = { "time_range": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
} }
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({time_range: {from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'}})
};
fetch('https://platform.ankra.app/api/v1/org/canvas-datasets/{dataset_id}/query', 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/canvas-datasets/{dataset_id}/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"time_range": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
}
}
'{
"state": "ok",
"observed_at": "<string>",
"source": "<string>",
"query_description": "<string>",
"reason": "<string>",
"series": [
{
"name": "<string>",
"points": [
[
123
]
]
}
],
"rows": {
"columns": [
{
"key": "<string>",
"label": "<string>",
"unit": "<string>"
}
],
"items": [
{}
]
},
"value": {
"number": 123,
"unit": "<string>"
},
"statuses": [
{
"label": "<string>",
"state": "<string>",
"detail": "<string>"
}
],
"truncated": true,
"previous": {
"state": "ok",
"observed_at": "<string>",
"source": "<string>",
"query_description": "<string>",
"reason": "<string>",
"series": [
{
"name": "<string>",
"points": [
[
123
]
]
}
],
"rows": {
"columns": [
{
"key": "<string>",
"label": "<string>",
"unit": "<string>"
}
],
"items": [
{}
]
},
"value": {
"number": 123,
"unit": "<string>"
},
"statuses": [
{
"label": "<string>",
"state": "<string>",
"detail": "<string>"
}
],
"truncated": true
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}Query a canvas dataset
Runs one dataset for a time range, pinned to the caller’s organisation and project, and with compare_previous also for the period of the same length just before it. Series are capped at 20 with at most 1000 points each and tables at 500 rows; truncated says when a cap applied.
import requests
url = "https://platform.ankra.app/api/v1/org/canvas-datasets/{dataset_id}/query"
payload = { "time_range": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
} }
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({time_range: {from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'}})
};
fetch('https://platform.ankra.app/api/v1/org/canvas-datasets/{dataset_id}/query', 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/canvas-datasets/{dataset_id}/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"time_range": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
}
}
'{
"state": "ok",
"observed_at": "<string>",
"source": "<string>",
"query_description": "<string>",
"reason": "<string>",
"series": [
{
"name": "<string>",
"points": [
[
123
]
]
}
],
"rows": {
"columns": [
{
"key": "<string>",
"label": "<string>",
"unit": "<string>"
}
],
"items": [
{}
]
},
"value": {
"number": 123,
"unit": "<string>"
},
"statuses": [
{
"label": "<string>",
"state": "<string>",
"detail": "<string>"
}
],
"truncated": true,
"previous": {
"state": "ok",
"observed_at": "<string>",
"source": "<string>",
"query_description": "<string>",
"reason": "<string>",
"series": [
{
"name": "<string>",
"points": [
[
123
]
]
}
],
"rows": {
"columns": [
{
"key": "<string>",
"label": "<string>",
"unit": "<string>"
}
],
"items": [
{}
]
},
"value": {
"number": 123,
"unit": "<string>"
},
"statuses": [
{
"label": "<string>",
"state": "<string>",
"detail": "<string>"
}
],
"truncated": true
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Response
The query ran. Its state says whether data came back: ok, empty, stale, unavailable (the source could not be read or did not answer within 10 seconds; reason says why) or denied (the cluster named in params is not visible to the caller).
ok, empty, stale, unavailable, denied RFC 3339 time of the newest observation the source holds for the answer; null when nothing was observed.
Why the state is not ok, when the source said.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
A series, point or row cap cut the answer short.
The same query over the previous period.
Show child attributes
Show child attributes