curl --request PUT \
--url https://sreagent.app/api/v1/config/outbound_rules/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cooldown_minutes": 123,
"enabled": true,
"escalate_after_minutes": 123,
"match_labels": {},
"match_severity": "<string>",
"match_source": "<string>",
"name": "<string>",
"outbound_config_id": "<string>",
"step_order": 123
}
'import requests
url = "https://sreagent.app/api/v1/config/outbound_rules/{id}"
payload = {
"cooldown_minutes": 123,
"enabled": True,
"escalate_after_minutes": 123,
"match_labels": {},
"match_severity": "<string>",
"match_source": "<string>",
"name": "<string>",
"outbound_config_id": "<string>",
"step_order": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cooldown_minutes: 123,
enabled: true,
escalate_after_minutes: 123,
match_labels: {},
match_severity: '<string>',
match_source: '<string>',
name: '<string>',
outbound_config_id: '<string>',
step_order: 123
})
};
fetch('https://sreagent.app/api/v1/config/outbound_rules/{id}', 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://sreagent.app/api/v1/config/outbound_rules/{id}",
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([
'cooldown_minutes' => 123,
'enabled' => true,
'escalate_after_minutes' => 123,
'match_labels' => [
],
'match_severity' => '<string>',
'match_source' => '<string>',
'name' => '<string>',
'outbound_config_id' => '<string>',
'step_order' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://sreagent.app/api/v1/config/outbound_rules/{id}"
payload := strings.NewReader("{\n \"cooldown_minutes\": 123,\n \"enabled\": true,\n \"escalate_after_minutes\": 123,\n \"match_labels\": {},\n \"match_severity\": \"<string>\",\n \"match_source\": \"<string>\",\n \"name\": \"<string>\",\n \"outbound_config_id\": \"<string>\",\n \"step_order\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://sreagent.app/api/v1/config/outbound_rules/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cooldown_minutes\": 123,\n \"enabled\": true,\n \"escalate_after_minutes\": 123,\n \"match_labels\": {},\n \"match_severity\": \"<string>\",\n \"match_source\": \"<string>\",\n \"name\": \"<string>\",\n \"outbound_config_id\": \"<string>\",\n \"step_order\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sreagent.app/api/v1/config/outbound_rules/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cooldown_minutes\": 123,\n \"enabled\": true,\n \"escalate_after_minutes\": 123,\n \"match_labels\": {},\n \"match_severity\": \"<string>\",\n \"match_source\": \"<string>\",\n \"name\": \"<string>\",\n \"outbound_config_id\": \"<string>\",\n \"step_order\": 123\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"message": "<string>"
}Update an outbound rule
Change one rule, named by the id list_outbound_rules reports; omitted fields keep their value.
curl --request PUT \
--url https://sreagent.app/api/v1/config/outbound_rules/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cooldown_minutes": 123,
"enabled": true,
"escalate_after_minutes": 123,
"match_labels": {},
"match_severity": "<string>",
"match_source": "<string>",
"name": "<string>",
"outbound_config_id": "<string>",
"step_order": 123
}
'import requests
url = "https://sreagent.app/api/v1/config/outbound_rules/{id}"
payload = {
"cooldown_minutes": 123,
"enabled": True,
"escalate_after_minutes": 123,
"match_labels": {},
"match_severity": "<string>",
"match_source": "<string>",
"name": "<string>",
"outbound_config_id": "<string>",
"step_order": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cooldown_minutes: 123,
enabled: true,
escalate_after_minutes: 123,
match_labels: {},
match_severity: '<string>',
match_source: '<string>',
name: '<string>',
outbound_config_id: '<string>',
step_order: 123
})
};
fetch('https://sreagent.app/api/v1/config/outbound_rules/{id}', 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://sreagent.app/api/v1/config/outbound_rules/{id}",
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([
'cooldown_minutes' => 123,
'enabled' => true,
'escalate_after_minutes' => 123,
'match_labels' => [
],
'match_severity' => '<string>',
'match_source' => '<string>',
'name' => '<string>',
'outbound_config_id' => '<string>',
'step_order' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://sreagent.app/api/v1/config/outbound_rules/{id}"
payload := strings.NewReader("{\n \"cooldown_minutes\": 123,\n \"enabled\": true,\n \"escalate_after_minutes\": 123,\n \"match_labels\": {},\n \"match_severity\": \"<string>\",\n \"match_source\": \"<string>\",\n \"name\": \"<string>\",\n \"outbound_config_id\": \"<string>\",\n \"step_order\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://sreagent.app/api/v1/config/outbound_rules/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cooldown_minutes\": 123,\n \"enabled\": true,\n \"escalate_after_minutes\": 123,\n \"match_labels\": {},\n \"match_severity\": \"<string>\",\n \"match_source\": \"<string>\",\n \"name\": \"<string>\",\n \"outbound_config_id\": \"<string>\",\n \"step_order\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sreagent.app/api/v1/config/outbound_rules/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cooldown_minutes\": 123,\n \"enabled\": true,\n \"escalate_after_minutes\": 123,\n \"match_labels\": {},\n \"match_severity\": \"<string>\",\n \"match_source\": \"<string>\",\n \"name\": \"<string>\",\n \"outbound_config_id\": \"<string>\",\n \"step_order\": 123\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"message": "<string>"
}Authorizations
Body
An immediate rule waits this long, at least 1, after a delivered page before it pages about a DIFFERENT alert; a page the target refused spends nothing, so every matching alert still gets its own attempt and its own row. A timed rule does not space its pages by this at all: one scheduled evaluation pages for every alert it matches whose firing has lasted long enough, and the number is read only as the seed of the retry wait below. Either kind of rule waits this long before re-attempting a page that could not be delivered, doubling the wait with each further failure up to one day; the immediate path makes that attempt on the next delivery of the alert that arrives after the wait, and the timed path on its next pass. Neither repeats a page that was delivered for the same firing. null leaves the default of 30 minutes.
Makes this a timed rule, at least 1, and it changes when the rule pages rather than what it pages for. A timed rule is run by a scheduled evaluation, which pages once per firing for the alerts it matches, and only once the firing has lasted this many minutes; an alert that cleared and fired again is firing since the moment it came back, however long it was open before that. match_source, match_severity and match_labels are read the same way as on an immediate rule. A page the target refuses is attempted again at growing intervals, starting at cooldown_minutes after the failure and doubling with each further failure up to one day, and one that was delivered is never repeated for that alert and rule in that firing. null leaves the rule immediate, and an immediate rule pages for the alerts it matches as they arrive: once per firing per alert, so a redelivery of an alert that is still active does not page again and an alert that cleared and fired again does.
Only alerts from this source, matched exactly, one of: grafana, pagerduty, opsgenie, prometheus, alertmanager, datadog, newrelic, cloudwatch, cloudtrail, custom, slo_breach, slo_tracking, certificate_monitor, cost_monitor, synthetic_check, slack, overseer, security, self_healing. null matches every source.
Response
Updated.
Was this page helpful?