curl --request PUT \
--url https://api.eu.bronto.io/monitors/templates/{templateId} \
--header 'Content-Type: application/json' \
--header 'X-BRONTO-API-KEY: <api-key>' \
--data @- <<EOF
{
"name": "High Error Rate",
"comparison_operator": "ABOVE",
"threshold": 1000,
"window": "'Last 20 minutes', 'Last 2 hours', 'Last 3 days'",
"metric": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"arguments": {}
},
"description": "Average response time is over 1 seconds in the last 20 minutes",
"warning_threshold": 1000,
"no_data_status": "OK",
"group_retention": 600000,
"aux": {},
"type": "PATTERN",
"compare_to": "'2 hours ago', '1 days ago'",
"this_template_tags": [
{
"name": "parser",
"value": "apache_web_access_log"
}
],
"parameters": {}
}
EOFimport requests
url = "https://api.eu.bronto.io/monitors/templates/{templateId}"
payload = {
"name": "High Error Rate",
"comparison_operator": "ABOVE",
"threshold": 1000,
"window": "'Last 20 minutes', 'Last 2 hours', 'Last 3 days'",
"metric": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"arguments": {}
},
"description": "Average response time is over 1 seconds in the last 20 minutes",
"warning_threshold": 1000,
"no_data_status": "OK",
"group_retention": 600000,
"aux": {},
"type": "PATTERN",
"compare_to": "'2 hours ago', '1 days ago'",
"this_template_tags": [
{
"name": "parser",
"value": "apache_web_access_log"
}
],
"parameters": {}
}
headers = {
"X-BRONTO-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-BRONTO-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'High Error Rate',
comparison_operator: 'ABOVE',
threshold: 1000,
window: '\'Last 20 minutes\', \'Last 2 hours\', \'Last 3 days\'',
metric: {id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', arguments: {}},
description: 'Average response time is over 1 seconds in the last 20 minutes',
warning_threshold: 1000,
no_data_status: 'OK',
group_retention: 600000,
aux: {},
type: 'PATTERN',
compare_to: '\'2 hours ago\', \'1 days ago\'',
this_template_tags: [{name: 'parser', value: 'apache_web_access_log'}],
parameters: {}
})
};
fetch('https://api.eu.bronto.io/monitors/templates/{templateId}', 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.eu.bronto.io/monitors/templates/{templateId}",
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([
'name' => 'High Error Rate',
'comparison_operator' => 'ABOVE',
'threshold' => 1000,
'window' => '\'Last 20 minutes\', \'Last 2 hours\', \'Last 3 days\'',
'metric' => [
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'arguments' => [
]
],
'description' => 'Average response time is over 1 seconds in the last 20 minutes',
'warning_threshold' => 1000,
'no_data_status' => 'OK',
'group_retention' => 600000,
'aux' => [
],
'type' => 'PATTERN',
'compare_to' => '\'2 hours ago\', \'1 days ago\'',
'this_template_tags' => [
[
'name' => 'parser',
'value' => 'apache_web_access_log'
]
],
'parameters' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-BRONTO-API-KEY: <api-key>"
],
]);
$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.eu.bronto.io/monitors/templates/{templateId}"
payload := strings.NewReader("{\n \"name\": \"High Error Rate\",\n \"comparison_operator\": \"ABOVE\",\n \"threshold\": 1000,\n \"window\": \"'Last 20 minutes', 'Last 2 hours', 'Last 3 days'\",\n \"metric\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"arguments\": {}\n },\n \"description\": \"Average response time is over 1 seconds in the last 20 minutes\",\n \"warning_threshold\": 1000,\n \"no_data_status\": \"OK\",\n \"group_retention\": 600000,\n \"aux\": {},\n \"type\": \"PATTERN\",\n \"compare_to\": \"'2 hours ago', '1 days ago'\",\n \"this_template_tags\": [\n {\n \"name\": \"parser\",\n \"value\": \"apache_web_access_log\"\n }\n ],\n \"parameters\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-BRONTO-API-KEY", "<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.eu.bronto.io/monitors/templates/{templateId}")
.header("X-BRONTO-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"High Error Rate\",\n \"comparison_operator\": \"ABOVE\",\n \"threshold\": 1000,\n \"window\": \"'Last 20 minutes', 'Last 2 hours', 'Last 3 days'\",\n \"metric\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"arguments\": {}\n },\n \"description\": \"Average response time is over 1 seconds in the last 20 minutes\",\n \"warning_threshold\": 1000,\n \"no_data_status\": \"OK\",\n \"group_retention\": 600000,\n \"aux\": {},\n \"type\": \"PATTERN\",\n \"compare_to\": \"'2 hours ago', '1 days ago'\",\n \"this_template_tags\": [\n {\n \"name\": \"parser\",\n \"value\": \"apache_web_access_log\"\n }\n ],\n \"parameters\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eu.bronto.io/monitors/templates/{templateId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-BRONTO-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"High Error Rate\",\n \"comparison_operator\": \"ABOVE\",\n \"threshold\": 1000,\n \"window\": \"'Last 20 minutes', 'Last 2 hours', 'Last 3 days'\",\n \"metric\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"arguments\": {}\n },\n \"description\": \"Average response time is over 1 seconds in the last 20 minutes\",\n \"warning_threshold\": 1000,\n \"no_data_status\": \"OK\",\n \"group_retention\": 600000,\n \"aux\": {},\n \"type\": \"PATTERN\",\n \"compare_to\": \"'2 hours ago', '1 days ago'\",\n \"this_template_tags\": [\n {\n \"name\": \"parser\",\n \"value\": \"apache_web_access_log\"\n }\n ],\n \"parameters\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "High Error Rate",
"comparison_operator": "ABOVE",
"threshold": "1000",
"window": "'Last 20 minutes', 'Last 2 hours', 'Last 1 days'",
"type": "PATTERN",
"metadata": {
"created_at": 123,
"created_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"modified_at": 123,
"modified_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"deleted_at": 123,
"deleted_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"last_heartbeat_at": 123
},
"description": "Average response time is over 1 seconds in the last 20 minutes",
"warning_threshold": "900",
"actions": "<string>",
"notify_once": "false",
"no_data_status": "OK",
"group_retention": 600000,
"aux": {},
"compare_to": "2 hours ago",
"metric_id": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"arguments": {}
},
"parameters": {}
}{
"bad_request_validation": {
"summary": "Bad Request - Validation Error",
"description": "Example error when request validation fails",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "95c6a974e3ab01209b6b0dfedb1b16c5",
"details": "Validation failed: 'name' field is required and cannot be empty"
}
},
"bad_request_invalid_type": {
"summary": "Bad Request - Invalid Metric Type",
"description": "Example error when an invalid metric type is provided",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "00d8a51bb2874f2583670317a4fb8db7",
"details": "Invalid metric_type 'INVALID'. Must be one of: COUNTER, GAUGE, HISTOGRAM"
}
},
"forbidden": {
"summary": "Forbidden Access",
"description": "Example error when user lacks required permissions",
"value": {
"code": 403,
"type": "Forbidden",
"correlation_id": "40276639de0f49d586e32edd8c4f6b34",
"details": "Access denied. User does not have permission to create metric definition templates"
}
},
"not_found": {
"summary": "Resource Not Found",
"description": "Example error when requested resource doesn't exist",
"value": {
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Metric definition template with id '550e8400-e29b-41d4-a716-446655440000' not found"
}
},
"rate_limit": {
"summary": "Rate Limit Exceeded",
"description": "Example error when API rate limit is exceeded",
"value": {
"code": 429,
"type": "Too Many Requests",
"correlation_id": "53909ed43c544531b7a555e295960437",
"details": "Rate limit exceeded. Maximum 100 requests are allowed within a 5-minute window"
}
},
"internal_server_error": {
"summary": "Internal Server Error",
"description": "Example error for unexpected server-side failures",
"value": {
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "An unexpected error occurred while processing your request"
}
}
}{
"bad_request_validation": {
"summary": "Bad Request - Validation Error",
"description": "Example error when request validation fails",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "95c6a974e3ab01209b6b0dfedb1b16c5",
"details": "Validation failed: 'name' field is required and cannot be empty"
}
},
"bad_request_invalid_type": {
"summary": "Bad Request - Invalid Metric Type",
"description": "Example error when an invalid metric type is provided",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "00d8a51bb2874f2583670317a4fb8db7",
"details": "Invalid metric_type 'INVALID'. Must be one of: COUNTER, GAUGE, HISTOGRAM"
}
},
"forbidden": {
"summary": "Forbidden Access",
"description": "Example error when user lacks required permissions",
"value": {
"code": 403,
"type": "Forbidden",
"correlation_id": "40276639de0f49d586e32edd8c4f6b34",
"details": "Access denied. User does not have permission to create metric definition templates"
}
},
"not_found": {
"summary": "Resource Not Found",
"description": "Example error when requested resource doesn't exist",
"value": {
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Metric definition template with id '550e8400-e29b-41d4-a716-446655440000' not found"
}
},
"rate_limit": {
"summary": "Rate Limit Exceeded",
"description": "Example error when API rate limit is exceeded",
"value": {
"code": 429,
"type": "Too Many Requests",
"correlation_id": "53909ed43c544531b7a555e295960437",
"details": "Rate limit exceeded. Maximum 100 requests are allowed within a 5-minute window"
}
},
"internal_server_error": {
"summary": "Internal Server Error",
"description": "Example error for unexpected server-side failures",
"value": {
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "An unexpected error occurred while processing your request"
}
}
}{
"bad_request_validation": {
"summary": "Bad Request - Validation Error",
"description": "Example error when request validation fails",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "95c6a974e3ab01209b6b0dfedb1b16c5",
"details": "Validation failed: 'name' field is required and cannot be empty"
}
},
"bad_request_invalid_type": {
"summary": "Bad Request - Invalid Metric Type",
"description": "Example error when an invalid metric type is provided",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "00d8a51bb2874f2583670317a4fb8db7",
"details": "Invalid metric_type 'INVALID'. Must be one of: COUNTER, GAUGE, HISTOGRAM"
}
},
"forbidden": {
"summary": "Forbidden Access",
"description": "Example error when user lacks required permissions",
"value": {
"code": 403,
"type": "Forbidden",
"correlation_id": "40276639de0f49d586e32edd8c4f6b34",
"details": "Access denied. User does not have permission to create metric definition templates"
}
},
"not_found": {
"summary": "Resource Not Found",
"description": "Example error when requested resource doesn't exist",
"value": {
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Metric definition template with id '550e8400-e29b-41d4-a716-446655440000' not found"
}
},
"rate_limit": {
"summary": "Rate Limit Exceeded",
"description": "Example error when API rate limit is exceeded",
"value": {
"code": 429,
"type": "Too Many Requests",
"correlation_id": "53909ed43c544531b7a555e295960437",
"details": "Rate limit exceeded. Maximum 100 requests are allowed within a 5-minute window"
}
},
"internal_server_error": {
"summary": "Internal Server Error",
"description": "Example error for unexpected server-side failures",
"value": {
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "An unexpected error occurred while processing your request"
}
}
}{
"bad_request_validation": {
"summary": "Bad Request - Validation Error",
"description": "Example error when request validation fails",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "95c6a974e3ab01209b6b0dfedb1b16c5",
"details": "Validation failed: 'name' field is required and cannot be empty"
}
},
"bad_request_invalid_type": {
"summary": "Bad Request - Invalid Metric Type",
"description": "Example error when an invalid metric type is provided",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "00d8a51bb2874f2583670317a4fb8db7",
"details": "Invalid metric_type 'INVALID'. Must be one of: COUNTER, GAUGE, HISTOGRAM"
}
},
"forbidden": {
"summary": "Forbidden Access",
"description": "Example error when user lacks required permissions",
"value": {
"code": 403,
"type": "Forbidden",
"correlation_id": "40276639de0f49d586e32edd8c4f6b34",
"details": "Access denied. User does not have permission to create metric definition templates"
}
},
"not_found": {
"summary": "Resource Not Found",
"description": "Example error when requested resource doesn't exist",
"value": {
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Metric definition template with id '550e8400-e29b-41d4-a716-446655440000' not found"
}
},
"rate_limit": {
"summary": "Rate Limit Exceeded",
"description": "Example error when API rate limit is exceeded",
"value": {
"code": 429,
"type": "Too Many Requests",
"correlation_id": "53909ed43c544531b7a555e295960437",
"details": "Rate limit exceeded. Maximum 100 requests are allowed within a 5-minute window"
}
},
"internal_server_error": {
"summary": "Internal Server Error",
"description": "Example error for unexpected server-side failures",
"value": {
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "An unexpected error occurred while processing your request"
}
}
}{
"bad_request_validation": {
"summary": "Bad Request - Validation Error",
"description": "Example error when request validation fails",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "95c6a974e3ab01209b6b0dfedb1b16c5",
"details": "Validation failed: 'name' field is required and cannot be empty"
}
},
"bad_request_invalid_type": {
"summary": "Bad Request - Invalid Metric Type",
"description": "Example error when an invalid metric type is provided",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "00d8a51bb2874f2583670317a4fb8db7",
"details": "Invalid metric_type 'INVALID'. Must be one of: COUNTER, GAUGE, HISTOGRAM"
}
},
"forbidden": {
"summary": "Forbidden Access",
"description": "Example error when user lacks required permissions",
"value": {
"code": 403,
"type": "Forbidden",
"correlation_id": "40276639de0f49d586e32edd8c4f6b34",
"details": "Access denied. User does not have permission to create metric definition templates"
}
},
"not_found": {
"summary": "Resource Not Found",
"description": "Example error when requested resource doesn't exist",
"value": {
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Metric definition template with id '550e8400-e29b-41d4-a716-446655440000' not found"
}
},
"rate_limit": {
"summary": "Rate Limit Exceeded",
"description": "Example error when API rate limit is exceeded",
"value": {
"code": 429,
"type": "Too Many Requests",
"correlation_id": "53909ed43c544531b7a555e295960437",
"details": "Rate limit exceeded. Maximum 100 requests are allowed within a 5-minute window"
}
},
"internal_server_error": {
"summary": "Internal Server Error",
"description": "Example error for unexpected server-side failures",
"value": {
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "An unexpected error occurred while processing your request"
}
}
}{
"bad_request_validation": {
"summary": "Bad Request - Validation Error",
"description": "Example error when request validation fails",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "95c6a974e3ab01209b6b0dfedb1b16c5",
"details": "Validation failed: 'name' field is required and cannot be empty"
}
},
"bad_request_invalid_type": {
"summary": "Bad Request - Invalid Metric Type",
"description": "Example error when an invalid metric type is provided",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "00d8a51bb2874f2583670317a4fb8db7",
"details": "Invalid metric_type 'INVALID'. Must be one of: COUNTER, GAUGE, HISTOGRAM"
}
},
"forbidden": {
"summary": "Forbidden Access",
"description": "Example error when user lacks required permissions",
"value": {
"code": 403,
"type": "Forbidden",
"correlation_id": "40276639de0f49d586e32edd8c4f6b34",
"details": "Access denied. User does not have permission to create metric definition templates"
}
},
"not_found": {
"summary": "Resource Not Found",
"description": "Example error when requested resource doesn't exist",
"value": {
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Metric definition template with id '550e8400-e29b-41d4-a716-446655440000' not found"
}
},
"rate_limit": {
"summary": "Rate Limit Exceeded",
"description": "Example error when API rate limit is exceeded",
"value": {
"code": 429,
"type": "Too Many Requests",
"correlation_id": "53909ed43c544531b7a555e295960437",
"details": "Rate limit exceeded. Maximum 100 requests are allowed within a 5-minute window"
}
},
"internal_server_error": {
"summary": "Internal Server Error",
"description": "Example error for unexpected server-side failures",
"value": {
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "An unexpected error occurred while processing your request"
}
}
}Update a monitor template
Update an existing monitor template
curl --request PUT \
--url https://api.eu.bronto.io/monitors/templates/{templateId} \
--header 'Content-Type: application/json' \
--header 'X-BRONTO-API-KEY: <api-key>' \
--data @- <<EOF
{
"name": "High Error Rate",
"comparison_operator": "ABOVE",
"threshold": 1000,
"window": "'Last 20 minutes', 'Last 2 hours', 'Last 3 days'",
"metric": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"arguments": {}
},
"description": "Average response time is over 1 seconds in the last 20 minutes",
"warning_threshold": 1000,
"no_data_status": "OK",
"group_retention": 600000,
"aux": {},
"type": "PATTERN",
"compare_to": "'2 hours ago', '1 days ago'",
"this_template_tags": [
{
"name": "parser",
"value": "apache_web_access_log"
}
],
"parameters": {}
}
EOFimport requests
url = "https://api.eu.bronto.io/monitors/templates/{templateId}"
payload = {
"name": "High Error Rate",
"comparison_operator": "ABOVE",
"threshold": 1000,
"window": "'Last 20 minutes', 'Last 2 hours', 'Last 3 days'",
"metric": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"arguments": {}
},
"description": "Average response time is over 1 seconds in the last 20 minutes",
"warning_threshold": 1000,
"no_data_status": "OK",
"group_retention": 600000,
"aux": {},
"type": "PATTERN",
"compare_to": "'2 hours ago', '1 days ago'",
"this_template_tags": [
{
"name": "parser",
"value": "apache_web_access_log"
}
],
"parameters": {}
}
headers = {
"X-BRONTO-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-BRONTO-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'High Error Rate',
comparison_operator: 'ABOVE',
threshold: 1000,
window: '\'Last 20 minutes\', \'Last 2 hours\', \'Last 3 days\'',
metric: {id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', arguments: {}},
description: 'Average response time is over 1 seconds in the last 20 minutes',
warning_threshold: 1000,
no_data_status: 'OK',
group_retention: 600000,
aux: {},
type: 'PATTERN',
compare_to: '\'2 hours ago\', \'1 days ago\'',
this_template_tags: [{name: 'parser', value: 'apache_web_access_log'}],
parameters: {}
})
};
fetch('https://api.eu.bronto.io/monitors/templates/{templateId}', 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.eu.bronto.io/monitors/templates/{templateId}",
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([
'name' => 'High Error Rate',
'comparison_operator' => 'ABOVE',
'threshold' => 1000,
'window' => '\'Last 20 minutes\', \'Last 2 hours\', \'Last 3 days\'',
'metric' => [
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'arguments' => [
]
],
'description' => 'Average response time is over 1 seconds in the last 20 minutes',
'warning_threshold' => 1000,
'no_data_status' => 'OK',
'group_retention' => 600000,
'aux' => [
],
'type' => 'PATTERN',
'compare_to' => '\'2 hours ago\', \'1 days ago\'',
'this_template_tags' => [
[
'name' => 'parser',
'value' => 'apache_web_access_log'
]
],
'parameters' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-BRONTO-API-KEY: <api-key>"
],
]);
$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.eu.bronto.io/monitors/templates/{templateId}"
payload := strings.NewReader("{\n \"name\": \"High Error Rate\",\n \"comparison_operator\": \"ABOVE\",\n \"threshold\": 1000,\n \"window\": \"'Last 20 minutes', 'Last 2 hours', 'Last 3 days'\",\n \"metric\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"arguments\": {}\n },\n \"description\": \"Average response time is over 1 seconds in the last 20 minutes\",\n \"warning_threshold\": 1000,\n \"no_data_status\": \"OK\",\n \"group_retention\": 600000,\n \"aux\": {},\n \"type\": \"PATTERN\",\n \"compare_to\": \"'2 hours ago', '1 days ago'\",\n \"this_template_tags\": [\n {\n \"name\": \"parser\",\n \"value\": \"apache_web_access_log\"\n }\n ],\n \"parameters\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-BRONTO-API-KEY", "<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.eu.bronto.io/monitors/templates/{templateId}")
.header("X-BRONTO-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"High Error Rate\",\n \"comparison_operator\": \"ABOVE\",\n \"threshold\": 1000,\n \"window\": \"'Last 20 minutes', 'Last 2 hours', 'Last 3 days'\",\n \"metric\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"arguments\": {}\n },\n \"description\": \"Average response time is over 1 seconds in the last 20 minutes\",\n \"warning_threshold\": 1000,\n \"no_data_status\": \"OK\",\n \"group_retention\": 600000,\n \"aux\": {},\n \"type\": \"PATTERN\",\n \"compare_to\": \"'2 hours ago', '1 days ago'\",\n \"this_template_tags\": [\n {\n \"name\": \"parser\",\n \"value\": \"apache_web_access_log\"\n }\n ],\n \"parameters\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eu.bronto.io/monitors/templates/{templateId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-BRONTO-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"High Error Rate\",\n \"comparison_operator\": \"ABOVE\",\n \"threshold\": 1000,\n \"window\": \"'Last 20 minutes', 'Last 2 hours', 'Last 3 days'\",\n \"metric\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"arguments\": {}\n },\n \"description\": \"Average response time is over 1 seconds in the last 20 minutes\",\n \"warning_threshold\": 1000,\n \"no_data_status\": \"OK\",\n \"group_retention\": 600000,\n \"aux\": {},\n \"type\": \"PATTERN\",\n \"compare_to\": \"'2 hours ago', '1 days ago'\",\n \"this_template_tags\": [\n {\n \"name\": \"parser\",\n \"value\": \"apache_web_access_log\"\n }\n ],\n \"parameters\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "High Error Rate",
"comparison_operator": "ABOVE",
"threshold": "1000",
"window": "'Last 20 minutes', 'Last 2 hours', 'Last 1 days'",
"type": "PATTERN",
"metadata": {
"created_at": 123,
"created_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"modified_at": 123,
"modified_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"deleted_at": 123,
"deleted_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"last_heartbeat_at": 123
},
"description": "Average response time is over 1 seconds in the last 20 minutes",
"warning_threshold": "900",
"actions": "<string>",
"notify_once": "false",
"no_data_status": "OK",
"group_retention": 600000,
"aux": {},
"compare_to": "2 hours ago",
"metric_id": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"arguments": {}
},
"parameters": {}
}{
"bad_request_validation": {
"summary": "Bad Request - Validation Error",
"description": "Example error when request validation fails",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "95c6a974e3ab01209b6b0dfedb1b16c5",
"details": "Validation failed: 'name' field is required and cannot be empty"
}
},
"bad_request_invalid_type": {
"summary": "Bad Request - Invalid Metric Type",
"description": "Example error when an invalid metric type is provided",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "00d8a51bb2874f2583670317a4fb8db7",
"details": "Invalid metric_type 'INVALID'. Must be one of: COUNTER, GAUGE, HISTOGRAM"
}
},
"forbidden": {
"summary": "Forbidden Access",
"description": "Example error when user lacks required permissions",
"value": {
"code": 403,
"type": "Forbidden",
"correlation_id": "40276639de0f49d586e32edd8c4f6b34",
"details": "Access denied. User does not have permission to create metric definition templates"
}
},
"not_found": {
"summary": "Resource Not Found",
"description": "Example error when requested resource doesn't exist",
"value": {
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Metric definition template with id '550e8400-e29b-41d4-a716-446655440000' not found"
}
},
"rate_limit": {
"summary": "Rate Limit Exceeded",
"description": "Example error when API rate limit is exceeded",
"value": {
"code": 429,
"type": "Too Many Requests",
"correlation_id": "53909ed43c544531b7a555e295960437",
"details": "Rate limit exceeded. Maximum 100 requests are allowed within a 5-minute window"
}
},
"internal_server_error": {
"summary": "Internal Server Error",
"description": "Example error for unexpected server-side failures",
"value": {
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "An unexpected error occurred while processing your request"
}
}
}{
"bad_request_validation": {
"summary": "Bad Request - Validation Error",
"description": "Example error when request validation fails",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "95c6a974e3ab01209b6b0dfedb1b16c5",
"details": "Validation failed: 'name' field is required and cannot be empty"
}
},
"bad_request_invalid_type": {
"summary": "Bad Request - Invalid Metric Type",
"description": "Example error when an invalid metric type is provided",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "00d8a51bb2874f2583670317a4fb8db7",
"details": "Invalid metric_type 'INVALID'. Must be one of: COUNTER, GAUGE, HISTOGRAM"
}
},
"forbidden": {
"summary": "Forbidden Access",
"description": "Example error when user lacks required permissions",
"value": {
"code": 403,
"type": "Forbidden",
"correlation_id": "40276639de0f49d586e32edd8c4f6b34",
"details": "Access denied. User does not have permission to create metric definition templates"
}
},
"not_found": {
"summary": "Resource Not Found",
"description": "Example error when requested resource doesn't exist",
"value": {
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Metric definition template with id '550e8400-e29b-41d4-a716-446655440000' not found"
}
},
"rate_limit": {
"summary": "Rate Limit Exceeded",
"description": "Example error when API rate limit is exceeded",
"value": {
"code": 429,
"type": "Too Many Requests",
"correlation_id": "53909ed43c544531b7a555e295960437",
"details": "Rate limit exceeded. Maximum 100 requests are allowed within a 5-minute window"
}
},
"internal_server_error": {
"summary": "Internal Server Error",
"description": "Example error for unexpected server-side failures",
"value": {
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "An unexpected error occurred while processing your request"
}
}
}{
"bad_request_validation": {
"summary": "Bad Request - Validation Error",
"description": "Example error when request validation fails",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "95c6a974e3ab01209b6b0dfedb1b16c5",
"details": "Validation failed: 'name' field is required and cannot be empty"
}
},
"bad_request_invalid_type": {
"summary": "Bad Request - Invalid Metric Type",
"description": "Example error when an invalid metric type is provided",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "00d8a51bb2874f2583670317a4fb8db7",
"details": "Invalid metric_type 'INVALID'. Must be one of: COUNTER, GAUGE, HISTOGRAM"
}
},
"forbidden": {
"summary": "Forbidden Access",
"description": "Example error when user lacks required permissions",
"value": {
"code": 403,
"type": "Forbidden",
"correlation_id": "40276639de0f49d586e32edd8c4f6b34",
"details": "Access denied. User does not have permission to create metric definition templates"
}
},
"not_found": {
"summary": "Resource Not Found",
"description": "Example error when requested resource doesn't exist",
"value": {
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Metric definition template with id '550e8400-e29b-41d4-a716-446655440000' not found"
}
},
"rate_limit": {
"summary": "Rate Limit Exceeded",
"description": "Example error when API rate limit is exceeded",
"value": {
"code": 429,
"type": "Too Many Requests",
"correlation_id": "53909ed43c544531b7a555e295960437",
"details": "Rate limit exceeded. Maximum 100 requests are allowed within a 5-minute window"
}
},
"internal_server_error": {
"summary": "Internal Server Error",
"description": "Example error for unexpected server-side failures",
"value": {
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "An unexpected error occurred while processing your request"
}
}
}{
"bad_request_validation": {
"summary": "Bad Request - Validation Error",
"description": "Example error when request validation fails",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "95c6a974e3ab01209b6b0dfedb1b16c5",
"details": "Validation failed: 'name' field is required and cannot be empty"
}
},
"bad_request_invalid_type": {
"summary": "Bad Request - Invalid Metric Type",
"description": "Example error when an invalid metric type is provided",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "00d8a51bb2874f2583670317a4fb8db7",
"details": "Invalid metric_type 'INVALID'. Must be one of: COUNTER, GAUGE, HISTOGRAM"
}
},
"forbidden": {
"summary": "Forbidden Access",
"description": "Example error when user lacks required permissions",
"value": {
"code": 403,
"type": "Forbidden",
"correlation_id": "40276639de0f49d586e32edd8c4f6b34",
"details": "Access denied. User does not have permission to create metric definition templates"
}
},
"not_found": {
"summary": "Resource Not Found",
"description": "Example error when requested resource doesn't exist",
"value": {
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Metric definition template with id '550e8400-e29b-41d4-a716-446655440000' not found"
}
},
"rate_limit": {
"summary": "Rate Limit Exceeded",
"description": "Example error when API rate limit is exceeded",
"value": {
"code": 429,
"type": "Too Many Requests",
"correlation_id": "53909ed43c544531b7a555e295960437",
"details": "Rate limit exceeded. Maximum 100 requests are allowed within a 5-minute window"
}
},
"internal_server_error": {
"summary": "Internal Server Error",
"description": "Example error for unexpected server-side failures",
"value": {
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "An unexpected error occurred while processing your request"
}
}
}{
"bad_request_validation": {
"summary": "Bad Request - Validation Error",
"description": "Example error when request validation fails",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "95c6a974e3ab01209b6b0dfedb1b16c5",
"details": "Validation failed: 'name' field is required and cannot be empty"
}
},
"bad_request_invalid_type": {
"summary": "Bad Request - Invalid Metric Type",
"description": "Example error when an invalid metric type is provided",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "00d8a51bb2874f2583670317a4fb8db7",
"details": "Invalid metric_type 'INVALID'. Must be one of: COUNTER, GAUGE, HISTOGRAM"
}
},
"forbidden": {
"summary": "Forbidden Access",
"description": "Example error when user lacks required permissions",
"value": {
"code": 403,
"type": "Forbidden",
"correlation_id": "40276639de0f49d586e32edd8c4f6b34",
"details": "Access denied. User does not have permission to create metric definition templates"
}
},
"not_found": {
"summary": "Resource Not Found",
"description": "Example error when requested resource doesn't exist",
"value": {
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Metric definition template with id '550e8400-e29b-41d4-a716-446655440000' not found"
}
},
"rate_limit": {
"summary": "Rate Limit Exceeded",
"description": "Example error when API rate limit is exceeded",
"value": {
"code": 429,
"type": "Too Many Requests",
"correlation_id": "53909ed43c544531b7a555e295960437",
"details": "Rate limit exceeded. Maximum 100 requests are allowed within a 5-minute window"
}
},
"internal_server_error": {
"summary": "Internal Server Error",
"description": "Example error for unexpected server-side failures",
"value": {
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "An unexpected error occurred while processing your request"
}
}
}{
"bad_request_validation": {
"summary": "Bad Request - Validation Error",
"description": "Example error when request validation fails",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "95c6a974e3ab01209b6b0dfedb1b16c5",
"details": "Validation failed: 'name' field is required and cannot be empty"
}
},
"bad_request_invalid_type": {
"summary": "Bad Request - Invalid Metric Type",
"description": "Example error when an invalid metric type is provided",
"value": {
"code": 400,
"type": "Bad Request",
"correlation_id": "00d8a51bb2874f2583670317a4fb8db7",
"details": "Invalid metric_type 'INVALID'. Must be one of: COUNTER, GAUGE, HISTOGRAM"
}
},
"forbidden": {
"summary": "Forbidden Access",
"description": "Example error when user lacks required permissions",
"value": {
"code": 403,
"type": "Forbidden",
"correlation_id": "40276639de0f49d586e32edd8c4f6b34",
"details": "Access denied. User does not have permission to create metric definition templates"
}
},
"not_found": {
"summary": "Resource Not Found",
"description": "Example error when requested resource doesn't exist",
"value": {
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Metric definition template with id '550e8400-e29b-41d4-a716-446655440000' not found"
}
},
"rate_limit": {
"summary": "Rate Limit Exceeded",
"description": "Example error when API rate limit is exceeded",
"value": {
"code": 429,
"type": "Too Many Requests",
"correlation_id": "53909ed43c544531b7a555e295960437",
"details": "Rate limit exceeded. Maximum 100 requests are allowed within a 5-minute window"
}
},
"internal_server_error": {
"summary": "Internal Server Error",
"description": "Example error for unexpected server-side failures",
"value": {
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "An unexpected error occurred while processing your request"
}
}
}Authorizations
Path Parameters
The ID of the monitor template to update
Body
The name of the monitor template
1 - 255"High Error Rate"
the comparison operator of the monitor (ABOVE, ABOVE_OR_EQUAL, BELOW, BELOW_OR_EQUAL, EQUAL, NOT_EQUAL)
BELOW, BELOW_OR_EQUAL, ABOVE, ABOVE_OR_EQUAL, EQUAL, NOT_EQUAL "ABOVE"
the threshold value of the monitor
1000
The time window to evaluate the monitor; minimum five minutes, maximum one day
"'Last 20 minutes', 'Last 2 hours', 'Last 3 days'"
Show child attributes
Show child attributes
Extra contextual information to add to the monitor template.
1 - 4000"Average response time is over 1 seconds in the last 20 minutes"
the warning threshold value
1000
Specify the status to use in case of no data (no events matched in a time window)
OK, NO_DATA, ALERT, WARN "OK"
Remove groups with no data after the provided time in milliseconds
0 <= x <= 604800000600000
Additional monitor configuration
PATTERN, USAGE, CHANGE_DETECTION For change detection monitors only. How far back in time the comparison query should be run. Minimum "5 mins ago", maximum "1 month".
"'2 hours ago', '1 days ago'"
For change detection monitors only. Specifies how the change values are calculated, as described in the Bronto documentation.
DIFFERENCE, PERCENTAGE Show child attributes
Show child attributes
Map of parameter names to their definitions. Each key represents the parameter name used within the template.
Show child attributes
Show child attributes
Response
Monitor template is successfully updated
The unique identifier for the monitor
The name of the monitor
1 - 255"High Error Rate"
the comparison operator of the monitor (ABOVE, ABOVE_OR_EQUAL, BELOW, BELOW_OR_EQUAL, EQUAL, NOT_EQUAL)
BELOW, BELOW_OR_EQUAL, ABOVE, ABOVE_OR_EQUAL, EQUAL, NOT_EQUAL "ABOVE"
the threshold value of the monitor
"1000"
The time window to evaluate the monitor; minimum five minutes, maximum one day
"'Last 20 minutes', 'Last 2 hours', 'Last 1 days'"
PATTERN, USAGE, CHANGE_DETECTION Common metadata attached to all persisted resources.
Show child attributes
Show child attributes
Extra contextual information to add to the monitor
4000"Average response time is over 1 seconds in the last 20 minutes"
the warning threshold value
"900"
The list of actions (notifications) to take when the monitor fires or resolves
Notify only the groups changing the global monitor status, i.e. notifications are sent only for the first group entering ALERT status or for the last group resolving
"false"
Specify the status to use if a group has no data (no events matched in a time window)
OK, NO_DATA, ALERT, WARN "OK"
Remove groups with no data after the provided time in milliseconds
0 <= x <= 604800000600000
Additional monitor configuration
For change detection monitors only. How far back in time the comparison query should be run. Minimum "5 mins ago", maximum "1 month".
"2 hours ago"
For change detection monitors only. Specifies how the change values are calculated, as described in the Bronto documentation.
DIFFERENCE, PERCENTAGE Show child attributes
Show child attributes
Map of parameter names to their definitions. Each key represents the parameter name used within the template.
Show child attributes
Show child attributes

