const fetch = require('node-fetch');
let url = 'https://api.coralogix.com/mgmt/openapi/v1/slo/slos/validate';
let options = {
method: 'POST',
headers: {Authorization: 'Bearer <API_KEY>', 'content-type': 'application/json'},
body: '{"createTime":"2019-08-24T14:15:22Z","creator":"test@domain.com","description":"A brief description of my SLO","grouping":{"labels":["string"]},"id":"b11919d5-ef85-4bb1-8655-02640dbe94d9","labels":[{"key":"string","value":"string"}],"name":"Example Slo Name","requestBasedMetricSli":{"goodEvents":{"query":"sum(rate(http_requests_total{status=\"200\"}[5m]))"},"totalEvents":{"query":"sum(rate(http_requests_total{status=\"200\"}[5m]))"}},"revision":{"revision":1,"updateTime":"2019-08-24T14:15:22Z"},"sloTimeFrame":"SLO_TIME_FRAME_UNSPECIFIED","targetThresholdPercentage":99.999,"type":"request","updateTime":"2019-08-24T14:15:22Z"}'
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
{
"alertsValidationResult": [
{
"alertVersionId": "<string>",
"errorMessage": "<string>",
"id": "<string>",
"name": "<string>"
}
]
}
No description available
const fetch = require('node-fetch');
let url = 'https://api.coralogix.com/mgmt/openapi/v1/slo/slos/validate';
let options = {
method: 'POST',
headers: {Authorization: 'Bearer <API_KEY>', 'content-type': 'application/json'},
body: '{"createTime":"2019-08-24T14:15:22Z","creator":"test@domain.com","description":"A brief description of my SLO","grouping":{"labels":["string"]},"id":"b11919d5-ef85-4bb1-8655-02640dbe94d9","labels":[{"key":"string","value":"string"}],"name":"Example Slo Name","requestBasedMetricSli":{"goodEvents":{"query":"sum(rate(http_requests_total{status=\"200\"}[5m]))"},"totalEvents":{"query":"sum(rate(http_requests_total{status=\"200\"}[5m]))"}},"revision":{"revision":1,"updateTime":"2019-08-24T14:15:22Z"},"sloTimeFrame":"SLO_TIME_FRAME_UNSPECIFIED","targetThresholdPercentage":99.999,"type":"request","updateTime":"2019-08-24T14:15:22Z"}'
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
{
"alertsValidationResult": [
{
"alertVersionId": "<string>",
"errorMessage": "<string>",
"id": "<string>",
"name": "<string>"
}
]
}
API key authentication
Definition of an SLO
Response with validated alerts before replacing an existing SLO.
Was this page helpful?