Replace Slo Pre-Validate Alerts
curl --request PUT \
--url https://api.coralogix.com/mgmt/openapi/4/slo/validated/v1 \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"createTime": "2023-11-07T05:31:56Z",
"creator": "test@domain.com",
"description": "A brief description of my SLO",
"grouping": {
"labels": [
"<string>"
]
},
"id": "b11919d5-ef85-4bb1-8655-02640dbe94d9",
"labels": {},
"name": "Example Slo Name",
"revision": {
"revision": 1,
"updateTime": "2023-11-07T05:31:56Z"
},
"targetThresholdPercentage": 99.999,
"type": "request",
"updateTime": "2023-11-07T05:31:56Z",
"windowBasedMetricSli": {
"query": {
"query": "sum(rate(http_requests_total{status=\"200\"}[5m]))"
},
"threshold": 0.95
}
}
'import requests
url = "https://api.coralogix.com/mgmt/openapi/4/slo/validated/v1"
payload = {
"createTime": "2023-11-07T05:31:56Z",
"creator": "test@domain.com",
"description": "A brief description of my SLO",
"grouping": { "labels": ["<string>"] },
"id": "b11919d5-ef85-4bb1-8655-02640dbe94d9",
"labels": {},
"name": "Example Slo Name",
"revision": {
"revision": 1,
"updateTime": "2023-11-07T05:31:56Z"
},
"targetThresholdPercentage": 99.999,
"type": "request",
"updateTime": "2023-11-07T05:31:56Z",
"windowBasedMetricSli": {
"query": { "query": "sum(rate(http_requests_total{status=\"200\"}[5m]))" },
"threshold": 0.95
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
createTime: '2023-11-07T05:31:56Z',
creator: 'test@domain.com',
description: 'A brief description of my SLO',
grouping: {labels: ['<string>']},
id: 'b11919d5-ef85-4bb1-8655-02640dbe94d9',
labels: {},
name: 'Example Slo Name',
revision: {revision: 1, updateTime: '2023-11-07T05:31:56Z'},
targetThresholdPercentage: 99.999,
type: 'request',
updateTime: '2023-11-07T05:31:56Z',
windowBasedMetricSli: {
query: {query: 'sum(rate(http_requests_total{status="200"}[5m]))'},
threshold: 0.95
}
})
};
fetch('https://api.coralogix.com/mgmt/openapi/4/slo/validated/v1', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coralogix.com/mgmt/openapi/4/slo/validated/v1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'createTime' => '2023-11-07T05:31:56Z',
'creator' => 'test@domain.com',
'description' => 'A brief description of my SLO',
'grouping' => [
'labels' => [
'<string>'
]
],
'id' => 'b11919d5-ef85-4bb1-8655-02640dbe94d9',
'labels' => [
],
'name' => 'Example Slo Name',
'revision' => [
'revision' => 1,
'updateTime' => '2023-11-07T05:31:56Z'
],
'targetThresholdPercentage' => 99.999,
'type' => 'request',
'updateTime' => '2023-11-07T05:31:56Z',
'windowBasedMetricSli' => [
'query' => [
'query' => 'sum(rate(http_requests_total{status="200"}[5m]))'
],
'threshold' => 0.95
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.coralogix.com/mgmt/openapi/4/slo/validated/v1"
payload := strings.NewReader("{\n \"createTime\": \"2023-11-07T05:31:56Z\",\n \"creator\": \"test@domain.com\",\n \"description\": \"A brief description of my SLO\",\n \"grouping\": {\n \"labels\": [\n \"<string>\"\n ]\n },\n \"id\": \"b11919d5-ef85-4bb1-8655-02640dbe94d9\",\n \"labels\": {},\n \"name\": \"Example Slo Name\",\n \"revision\": {\n \"revision\": 1,\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"targetThresholdPercentage\": 99.999,\n \"type\": \"request\",\n \"updateTime\": \"2023-11-07T05:31:56Z\",\n \"windowBasedMetricSli\": {\n \"query\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n },\n \"threshold\": 0.95\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.coralogix.com/mgmt/openapi/4/slo/validated/v1")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"createTime\": \"2023-11-07T05:31:56Z\",\n \"creator\": \"test@domain.com\",\n \"description\": \"A brief description of my SLO\",\n \"grouping\": {\n \"labels\": [\n \"<string>\"\n ]\n },\n \"id\": \"b11919d5-ef85-4bb1-8655-02640dbe94d9\",\n \"labels\": {},\n \"name\": \"Example Slo Name\",\n \"revision\": {\n \"revision\": 1,\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"targetThresholdPercentage\": 99.999,\n \"type\": \"request\",\n \"updateTime\": \"2023-11-07T05:31:56Z\",\n \"windowBasedMetricSli\": {\n \"query\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n },\n \"threshold\": 0.95\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coralogix.com/mgmt/openapi/4/slo/validated/v1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"createTime\": \"2023-11-07T05:31:56Z\",\n \"creator\": \"test@domain.com\",\n \"description\": \"A brief description of my SLO\",\n \"grouping\": {\n \"labels\": [\n \"<string>\"\n ]\n },\n \"id\": \"b11919d5-ef85-4bb1-8655-02640dbe94d9\",\n \"labels\": {},\n \"name\": \"Example Slo Name\",\n \"revision\": {\n \"revision\": 1,\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"targetThresholdPercentage\": 99.999,\n \"type\": \"request\",\n \"updateTime\": \"2023-11-07T05:31:56Z\",\n \"windowBasedMetricSli\": {\n \"query\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n },\n \"threshold\": 0.95\n }\n}"
response = http.request(request)
puts response.read_body{
"alertsValidationResult": [
{
"alertVersionId": "<string>",
"errorMessage": "<string>",
"id": "<string>",
"name": "<string>"
}
]
}SLOs Service
Replace Slo Pre-Validate Alerts
No description available
Replace Slo Pre-Validate Alerts
curl --request PUT \
--url https://api.coralogix.com/mgmt/openapi/4/slo/validated/v1 \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"createTime": "2023-11-07T05:31:56Z",
"creator": "test@domain.com",
"description": "A brief description of my SLO",
"grouping": {
"labels": [
"<string>"
]
},
"id": "b11919d5-ef85-4bb1-8655-02640dbe94d9",
"labels": {},
"name": "Example Slo Name",
"revision": {
"revision": 1,
"updateTime": "2023-11-07T05:31:56Z"
},
"targetThresholdPercentage": 99.999,
"type": "request",
"updateTime": "2023-11-07T05:31:56Z",
"windowBasedMetricSli": {
"query": {
"query": "sum(rate(http_requests_total{status=\"200\"}[5m]))"
},
"threshold": 0.95
}
}
'import requests
url = "https://api.coralogix.com/mgmt/openapi/4/slo/validated/v1"
payload = {
"createTime": "2023-11-07T05:31:56Z",
"creator": "test@domain.com",
"description": "A brief description of my SLO",
"grouping": { "labels": ["<string>"] },
"id": "b11919d5-ef85-4bb1-8655-02640dbe94d9",
"labels": {},
"name": "Example Slo Name",
"revision": {
"revision": 1,
"updateTime": "2023-11-07T05:31:56Z"
},
"targetThresholdPercentage": 99.999,
"type": "request",
"updateTime": "2023-11-07T05:31:56Z",
"windowBasedMetricSli": {
"query": { "query": "sum(rate(http_requests_total{status=\"200\"}[5m]))" },
"threshold": 0.95
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
createTime: '2023-11-07T05:31:56Z',
creator: 'test@domain.com',
description: 'A brief description of my SLO',
grouping: {labels: ['<string>']},
id: 'b11919d5-ef85-4bb1-8655-02640dbe94d9',
labels: {},
name: 'Example Slo Name',
revision: {revision: 1, updateTime: '2023-11-07T05:31:56Z'},
targetThresholdPercentage: 99.999,
type: 'request',
updateTime: '2023-11-07T05:31:56Z',
windowBasedMetricSli: {
query: {query: 'sum(rate(http_requests_total{status="200"}[5m]))'},
threshold: 0.95
}
})
};
fetch('https://api.coralogix.com/mgmt/openapi/4/slo/validated/v1', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coralogix.com/mgmt/openapi/4/slo/validated/v1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'createTime' => '2023-11-07T05:31:56Z',
'creator' => 'test@domain.com',
'description' => 'A brief description of my SLO',
'grouping' => [
'labels' => [
'<string>'
]
],
'id' => 'b11919d5-ef85-4bb1-8655-02640dbe94d9',
'labels' => [
],
'name' => 'Example Slo Name',
'revision' => [
'revision' => 1,
'updateTime' => '2023-11-07T05:31:56Z'
],
'targetThresholdPercentage' => 99.999,
'type' => 'request',
'updateTime' => '2023-11-07T05:31:56Z',
'windowBasedMetricSli' => [
'query' => [
'query' => 'sum(rate(http_requests_total{status="200"}[5m]))'
],
'threshold' => 0.95
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.coralogix.com/mgmt/openapi/4/slo/validated/v1"
payload := strings.NewReader("{\n \"createTime\": \"2023-11-07T05:31:56Z\",\n \"creator\": \"test@domain.com\",\n \"description\": \"A brief description of my SLO\",\n \"grouping\": {\n \"labels\": [\n \"<string>\"\n ]\n },\n \"id\": \"b11919d5-ef85-4bb1-8655-02640dbe94d9\",\n \"labels\": {},\n \"name\": \"Example Slo Name\",\n \"revision\": {\n \"revision\": 1,\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"targetThresholdPercentage\": 99.999,\n \"type\": \"request\",\n \"updateTime\": \"2023-11-07T05:31:56Z\",\n \"windowBasedMetricSli\": {\n \"query\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n },\n \"threshold\": 0.95\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.coralogix.com/mgmt/openapi/4/slo/validated/v1")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"createTime\": \"2023-11-07T05:31:56Z\",\n \"creator\": \"test@domain.com\",\n \"description\": \"A brief description of my SLO\",\n \"grouping\": {\n \"labels\": [\n \"<string>\"\n ]\n },\n \"id\": \"b11919d5-ef85-4bb1-8655-02640dbe94d9\",\n \"labels\": {},\n \"name\": \"Example Slo Name\",\n \"revision\": {\n \"revision\": 1,\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"targetThresholdPercentage\": 99.999,\n \"type\": \"request\",\n \"updateTime\": \"2023-11-07T05:31:56Z\",\n \"windowBasedMetricSli\": {\n \"query\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n },\n \"threshold\": 0.95\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coralogix.com/mgmt/openapi/4/slo/validated/v1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"createTime\": \"2023-11-07T05:31:56Z\",\n \"creator\": \"test@domain.com\",\n \"description\": \"A brief description of my SLO\",\n \"grouping\": {\n \"labels\": [\n \"<string>\"\n ]\n },\n \"id\": \"b11919d5-ef85-4bb1-8655-02640dbe94d9\",\n \"labels\": {},\n \"name\": \"Example Slo Name\",\n \"revision\": {\n \"revision\": 1,\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"targetThresholdPercentage\": 99.999,\n \"type\": \"request\",\n \"updateTime\": \"2023-11-07T05:31:56Z\",\n \"windowBasedMetricSli\": {\n \"query\": {\n \"query\": \"sum(rate(http_requests_total{status=\\\"200\\\"}[5m]))\"\n },\n \"threshold\": 0.95\n }\n}"
response = http.request(request)
puts response.read_body{
"alertsValidationResult": [
{
"alertVersionId": "<string>",
"errorMessage": "<string>",
"id": "<string>",
"name": "<string>"
}
]
}Authorizations
API key authentication
Body
application/json
- Slo
- Slo
- Slo
Definition of an SLO
Example:
"test@domain.com"
Example:
"A brief description of my SLO"
Definition of the SLO grouping fields
Show child attributes
Show child attributes
Example:
"b11919d5-ef85-4bb1-8655-02640dbe94d9"
Show child attributes
Show child attributes
Example:
"Example Slo Name"
Available options:
SLO_PRODUCT_TYPE_UNSPECIFIED, SLO_PRODUCT_TYPE_APM The revision of the slo, used to differentiate between different versions of the same SLO
Show child attributes
Show child attributes
Available options:
SLO_TIME_FRAME_UNSPECIFIED, SLO_TIME_FRAME_7_DAYS, SLO_TIME_FRAME_14_DAYS, SLO_TIME_FRAME_21_DAYS, SLO_TIME_FRAME_28_DAYS Available options:
SLO_TYPE_REQUEST, SLO_TYPE_WINDOW Example:
99.999
Example:
"request"
Definition of a window-based SLI based on metrics
Show child attributes
Show child attributes
Response
Response with validated alerts before replacing an existing SLO.
Show child attributes
Show child attributes
Was this page helpful?
⌘I