cURL
curl --request POST \
--url https://{tenant}.chronosphere.io/api/v1/config/slos \
--header 'API-Token: <api-key>' \
--header 'Content-Type: application/json' \
--data '{}'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenant}.chronosphere.io/api/v1/config/slos"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-Token", "<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://{tenant}.chronosphere.io/api/v1/config/slos")
.header("API-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();const options = {
method: 'POST',
headers: {'API-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://{tenant}.chronosphere.io/api/v1/config/slos', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{tenant}.chronosphere.io/api/v1/config/slos"
payload = {}
headers = {
"API-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"slo": {
"name": "<string>",
"annotations": {},
"collection_ref": {
"slug": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"definition": {
"burn_rate_alerting_config": [
{
"window": "<string>",
"budget": "50.0",
"labels": {},
"severity": "<string>"
}
],
"enable_burn_rate_alerting": true,
"objective": "99.9995",
"time_window": "4w"
},
"description": "<string>",
"labels": {},
"notification_policy_slug": "alerting_notification_policy",
"signal_grouping": {
"label_names": [
"<string>"
],
"signal_per_series": true
},
"sli": {
"additional_promql_filters": "cluster!~\"dev\"",
"custom_dimension_labels": [
"<string>"
],
"custom_indicator": {
"total_query_template": "<string>",
"bad_query_template": "<string>",
"good_query_template": "<string>"
},
"custom_timeslice_indicator": {
"condition": {
"value": 123
},
"query_template": "<string>"
}
},
"slug": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{}POST
/
api
/
v1
/
config
/
slos
cURL
curl --request POST \
--url https://{tenant}.chronosphere.io/api/v1/config/slos \
--header 'API-Token: <api-key>' \
--header 'Content-Type: application/json' \
--data '{}'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenant}.chronosphere.io/api/v1/config/slos"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("API-Token", "<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://{tenant}.chronosphere.io/api/v1/config/slos")
.header("API-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();const options = {
method: 'POST',
headers: {'API-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://{tenant}.chronosphere.io/api/v1/config/slos', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{tenant}.chronosphere.io/api/v1/config/slos"
payload = {}
headers = {
"API-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"slo": {
"name": "<string>",
"annotations": {},
"collection_ref": {
"slug": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"definition": {
"burn_rate_alerting_config": [
{
"window": "<string>",
"budget": "50.0",
"labels": {},
"severity": "<string>"
}
],
"enable_burn_rate_alerting": true,
"objective": "99.9995",
"time_window": "4w"
},
"description": "<string>",
"labels": {},
"notification_policy_slug": "alerting_notification_policy",
"signal_grouping": {
"label_names": [
"<string>"
],
"signal_per_series": true
},
"sli": {
"additional_promql_filters": "cluster!~\"dev\"",
"custom_dimension_labels": [
"<string>"
],
"custom_indicator": {
"total_query_template": "<string>",
"bad_query_template": "<string>",
"good_query_template": "<string>"
},
"custom_timeslice_indicator": {
"condition": {
"value": 123
},
"query_template": "<string>"
}
},
"slug": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{}Authorizations
Chronosphere API token
Body
application/json
If true, validates the specified configuration without creating the SLO. If the specified configuration is valid, the endpoint returns a partial response without the SLO. If the specified configuration is invalid, the endpoint returns an error.
The SLO to create.
Show child attributes
Show child attributes
Response
A successful response containing the created SLO.
Show child attributes
Show child attributes
⌘I

