Where the alerts of the nodes a draft rule reaches would go across the week, with the draft saved as it stands (ADR-266 decision 5).
const url = 'https://example.com/api/v1/routing-rules/preview';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/api/v1/routing-rules/preview \ --header 'Authorization: Bearer <token>'The draft takes the edited rule’s place in the order, or lists last when rule_id is omitted,
and is read as switched on. Only the nodes it reaches are drawn, grouped by the rules that decide
for them and the zone they keep time in, and each week is judged every minute so the edge of the
draft’s hours is drawn where it is. Nothing is saved.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”The rule being edited: the draft takes its place in the order. Omitted for a new rule, which lists last.
unreachable, critical, warning or info. Omitted = any severity, and the week is drawn
for unreachable — node-down, the alert a person is woken for (ADR-277).
Tags the node must carry one of (or every one, by tag_match), one per line (the way
GET /node-tags takes reach).
Folder ids the node must be inside one of, comma-separated.
How a setting’s folders and its tags combine when it names both (ADR-262 decision 10). Inside
the folder list one entry is always enough, inside the tag list tag_match decides (ADR-267),
and this joins the two lists.
How folders and tags combine when both are given: or (the default) or and.
ISO weekdays of the window, comma-separated (1 = Monday .. 7 = Sunday).
Minutes after local midnight, 0 to 1439.
Minutes after local midnight, 0 to 1439.
The rule holds instead of sending while open. Omitted = false.
Channel ids, comma-separated.
Responses
Section titled “Responses”The nodes the draft reaches, grouped by the rules that decide for them, and where their alerts go across the week
Where the alerts of the nodes a draft rule reaches would go across the week (ADR-266 decision 5).
object
The catch-all’s channels, so a stretch drawn as catch_all can be named.
The zone a node whose folders name none keeps time in (a row whose zone is null).
One per set of deciding rules and zone among the nodes the draft reaches, the most nodes first. Empty when it reaches no node.
One group of the nodes a draft reaches, and its week, judged every minute.
object
The minute of the week at which where an alert goes next changes, from Monday 00:00 local;
null when it does not change within a week.
The minute of the week it is now in this zone, from Monday 00:00 local.
The rules that decide for these nodes, in order, the draft among them.
Stretches in minutes from Monday 00:00 local, each with the rule that decides.
One stretch of the week in which an alert goes to the same place (ADR-262 decision 8). Minutes are counted from Monday 00:00 local time.
object
The channels it goes to; empty when held or going nowhere.
Where an alert goes during a [CoverageSegment].
The rule that decides during the stretch (ADR-266 decision 4): the open rule that sends or
holds, or a closed rule that holds while closed. null when the catch-all takes the alert,
when it is held because no rule is open, and when it goes nowhere.
The zone these nodes keep time in; null for the deployment’s default.
The id the draft’s stretches carry in rule_id: the edited rule’s, or the nil id for a new
rule.
The severity the week is drawn for: the draft’s own, or unreachable (node-down) when it names none.
Example
{ "rows": [ { "segments": [ { "kind": "rules" } ] } ], "severity": "info"}A severity outside unreachable|critical|warning|info, a tag that is empty, too long or holds a control character, a malformed id, or a window with no weekday in 1..7 or a minute outside 0..1439 (invalid_rule)
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}No valid bearer token
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}Role lacks ManageSystem
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}rule_id names no rule (rule_not_found)
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}This core has no write side (skeleton mode)
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}