Replace Slo
curl --request PUT \
--url https://api.coralogix.com/mgmt/openapi/4/slo/slos/v1 \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"apmSli": {
"errorConfig": {},
"filters": [
{
"key": "environment",
"value": "production"
}
],
"groupingKeys": [
"environment",
"region"
],
"services": [
"my-service",
"payment-service"
]
},
"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"
}
'import requests
url = "https://api.coralogix.com/mgmt/openapi/4/slo/slos/v1"
payload = {
"apmSli": {
"errorConfig": {},
"filters": [
{
"key": "environment",
"value": "production"
}
],
"groupingKeys": ["environment", "region"],
"services": ["my-service", "payment-service"]
},
"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"
}
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({
apmSli: {
errorConfig: {},
filters: [{key: 'environment', value: 'production'}],
groupingKeys: ['environment', 'region'],
services: ['my-service', 'payment-service']
},
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'
})
};
fetch('https://api.coralogix.com/mgmt/openapi/4/slo/slos/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/slos/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([
'apmSli' => [
'errorConfig' => [
],
'filters' => [
[
'key' => 'environment',
'value' => 'production'
]
],
'groupingKeys' => [
'environment',
'region'
],
'services' => [
'my-service',
'payment-service'
]
],
'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'
]),
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/slos/v1"
payload := strings.NewReader("{\n \"apmSli\": {\n \"errorConfig\": {},\n \"filters\": [\n {\n \"key\": \"environment\",\n \"value\": \"production\"\n }\n ],\n \"groupingKeys\": [\n \"environment\",\n \"region\"\n ],\n \"services\": [\n \"my-service\",\n \"payment-service\"\n ]\n },\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}")
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/slos/v1")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"apmSli\": {\n \"errorConfig\": {},\n \"filters\": [\n {\n \"key\": \"environment\",\n \"value\": \"production\"\n }\n ],\n \"groupingKeys\": [\n \"environment\",\n \"region\"\n ],\n \"services\": [\n \"my-service\",\n \"payment-service\"\n ]\n },\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}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coralogix.com/mgmt/openapi/4/slo/slos/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 \"apmSli\": {\n \"errorConfig\": {},\n \"filters\": [\n {\n \"key\": \"environment\",\n \"value\": \"production\"\n }\n ],\n \"groupingKeys\": [\n \"environment\",\n \"region\"\n ],\n \"services\": [\n \"my-service\",\n \"payment-service\"\n ]\n },\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}"
response = http.request(request)
puts response.read_body{
"slo": {
"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",
"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"
},
"targetThresholdPercentage": 99.999,
"type": "request",
"updateTime": "2023-11-07T05:31:56Z"
},
"effectedSloAlertIds": [
"<string>"
]
}SLOs Service
Replace Slo
No description available
Replace Slo
curl --request PUT \
--url https://api.coralogix.com/mgmt/openapi/4/slo/slos/v1 \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"apmSli": {
"errorConfig": {},
"filters": [
{
"key": "environment",
"value": "production"
}
],
"groupingKeys": [
"environment",
"region"
],
"services": [
"my-service",
"payment-service"
]
},
"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"
}
'import requests
url = "https://api.coralogix.com/mgmt/openapi/4/slo/slos/v1"
payload = {
"apmSli": {
"errorConfig": {},
"filters": [
{
"key": "environment",
"value": "production"
}
],
"groupingKeys": ["environment", "region"],
"services": ["my-service", "payment-service"]
},
"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"
}
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({
apmSli: {
errorConfig: {},
filters: [{key: 'environment', value: 'production'}],
groupingKeys: ['environment', 'region'],
services: ['my-service', 'payment-service']
},
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'
})
};
fetch('https://api.coralogix.com/mgmt/openapi/4/slo/slos/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/slos/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([
'apmSli' => [
'errorConfig' => [
],
'filters' => [
[
'key' => 'environment',
'value' => 'production'
]
],
'groupingKeys' => [
'environment',
'region'
],
'services' => [
'my-service',
'payment-service'
]
],
'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'
]),
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/slos/v1"
payload := strings.NewReader("{\n \"apmSli\": {\n \"errorConfig\": {},\n \"filters\": [\n {\n \"key\": \"environment\",\n \"value\": \"production\"\n }\n ],\n \"groupingKeys\": [\n \"environment\",\n \"region\"\n ],\n \"services\": [\n \"my-service\",\n \"payment-service\"\n ]\n },\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}")
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/slos/v1")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"apmSli\": {\n \"errorConfig\": {},\n \"filters\": [\n {\n \"key\": \"environment\",\n \"value\": \"production\"\n }\n ],\n \"groupingKeys\": [\n \"environment\",\n \"region\"\n ],\n \"services\": [\n \"my-service\",\n \"payment-service\"\n ]\n },\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}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coralogix.com/mgmt/openapi/4/slo/slos/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 \"apmSli\": {\n \"errorConfig\": {},\n \"filters\": [\n {\n \"key\": \"environment\",\n \"value\": \"production\"\n }\n ],\n \"groupingKeys\": [\n \"environment\",\n \"region\"\n ],\n \"services\": [\n \"my-service\",\n \"payment-service\"\n ]\n },\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}"
response = http.request(request)
puts response.read_body{
"slo": {
"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",
"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"
},
"targetThresholdPercentage": 99.999,
"type": "request",
"updateTime": "2023-11-07T05:31:56Z"
},
"effectedSloAlertIds": [
"<string>"
]
}Authorizations
API key authentication
Query Parameters
Body
application/json
- Slo
- Slo
- Slo
Definition of an SLO
Definition of an APM-based SLI with automatic query generation
- ApmSli
- ApmSli
Show child attributes
Show child attributes
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"
Was this page helpful?
⌘I