Create Slo
curl --request POST \
--url https://api.coralogix.com/mgmt/openapi/3/v1/slo/slos \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Example Slo Name",
"targetThresholdPercentage": 99.999,
"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": {},
"revision": {
"revision": 1,
"updateTime": "2023-11-07T05:31:56Z"
},
"type": "request",
"updateTime": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.coralogix.com/mgmt/openapi/3/v1/slo/slos"
payload = {
"name": "Example Slo Name",
"targetThresholdPercentage": 99.999,
"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": {},
"revision": {
"revision": 1,
"updateTime": "2023-11-07T05:31:56Z"
},
"type": "request",
"updateTime": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Example Slo Name',
targetThresholdPercentage: 99.999,
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: {},
revision: {revision: 1, updateTime: '2023-11-07T05:31:56Z'},
type: 'request',
updateTime: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.coralogix.com/mgmt/openapi/3/v1/slo/slos', 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/3/v1/slo/slos",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Example Slo Name',
'targetThresholdPercentage' => 99.999,
'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' => [
],
'revision' => [
'revision' => 1,
'updateTime' => '2023-11-07T05:31:56Z'
],
'type' => 'request',
'updateTime' => '2023-11-07T05:31:56Z'
]),
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/3/v1/slo/slos"
payload := strings.NewReader("{\n \"name\": \"Example Slo Name\",\n \"targetThresholdPercentage\": 99.999,\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 \"revision\": {\n \"revision\": 1,\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"type\": \"request\",\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.coralogix.com/mgmt/openapi/3/v1/slo/slos")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Example Slo Name\",\n \"targetThresholdPercentage\": 99.999,\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 \"revision\": {\n \"revision\": 1,\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"type\": \"request\",\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coralogix.com/mgmt/openapi/3/v1/slo/slos")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Example Slo Name\",\n \"targetThresholdPercentage\": 99.999,\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 \"revision\": {\n \"revision\": 1,\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"type\": \"request\",\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"slo": {
"name": "Example Slo Name",
"targetThresholdPercentage": 99.999,
"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": {},
"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": "2023-11-07T05:31:56Z"
},
"type": "request",
"updateTime": "2023-11-07T05:31:56Z"
}
}SLOs Service
Create Slo
No description available
Create Slo
curl --request POST \
--url https://api.coralogix.com/mgmt/openapi/3/v1/slo/slos \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Example Slo Name",
"targetThresholdPercentage": 99.999,
"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": {},
"revision": {
"revision": 1,
"updateTime": "2023-11-07T05:31:56Z"
},
"type": "request",
"updateTime": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.coralogix.com/mgmt/openapi/3/v1/slo/slos"
payload = {
"name": "Example Slo Name",
"targetThresholdPercentage": 99.999,
"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": {},
"revision": {
"revision": 1,
"updateTime": "2023-11-07T05:31:56Z"
},
"type": "request",
"updateTime": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Example Slo Name',
targetThresholdPercentage: 99.999,
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: {},
revision: {revision: 1, updateTime: '2023-11-07T05:31:56Z'},
type: 'request',
updateTime: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.coralogix.com/mgmt/openapi/3/v1/slo/slos', 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/3/v1/slo/slos",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Example Slo Name',
'targetThresholdPercentage' => 99.999,
'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' => [
],
'revision' => [
'revision' => 1,
'updateTime' => '2023-11-07T05:31:56Z'
],
'type' => 'request',
'updateTime' => '2023-11-07T05:31:56Z'
]),
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/3/v1/slo/slos"
payload := strings.NewReader("{\n \"name\": \"Example Slo Name\",\n \"targetThresholdPercentage\": 99.999,\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 \"revision\": {\n \"revision\": 1,\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"type\": \"request\",\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.coralogix.com/mgmt/openapi/3/v1/slo/slos")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Example Slo Name\",\n \"targetThresholdPercentage\": 99.999,\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 \"revision\": {\n \"revision\": 1,\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"type\": \"request\",\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coralogix.com/mgmt/openapi/3/v1/slo/slos")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Example Slo Name\",\n \"targetThresholdPercentage\": 99.999,\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 \"revision\": {\n \"revision\": 1,\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n },\n \"type\": \"request\",\n \"updateTime\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"slo": {
"name": "Example Slo Name",
"targetThresholdPercentage": 99.999,
"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": {},
"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": "2023-11-07T05:31:56Z"
},
"type": "request",
"updateTime": "2023-11-07T05:31:56Z"
}
}Authorizations
API key authentication
Query Parameters
Body
application/json
- Slo
- Slo
Definition of an SLO
Example:
"Example Slo Name"
Example:
99.999
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
Definition of a request-based SLI based on metrics
Show child attributes
Show child attributes
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 Example:
"request"
Response
Response after creating a new SLO.
Definition of an SLO
- Slo
- Slo
Show child attributes
Show child attributes
Was this page helpful?
⌘I