create_threshold
const url = 'https://example.com/api/v1/thresholds';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"critical":1,"critical_above":1,"critical_below":1,"direction":"example","dwell_samples":1,"metric":"example","row_match":"example","scope_id":"example","scope_ids":["example"],"scope_level":"example","warning":1,"warning_above":1,"warning_below":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/thresholds \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "critical": 1, "critical_above": 1, "critical_below": 1, "direction": "example", "dwell_samples": 1, "metric": "example", "row_match": "example", "scope_id": "example", "scope_ids": [ "example" ], "scope_level": "example", "warning": 1, "warning_above": 1, "warning_below": 1 }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”A threshold rule as the caller states it — the body of both POST and PUT.
One type for both, the shape ProfileBody already uses. Two would be two validators, and this
repo has paid for that: URL-check and DNS-check CRUD were two copies of one writer, so the “a
node is exactly one kind” rule shipped enforced on only one of them.
object
The primary side’s critical bound, read through direction. See the four bounds below.
Value at/above which the node is Critical.
Value at/below which the node is Critical.
Which way the rule’s warning/critical bounds trip. Superseded by the four
*_below/*_above bounds, which win if any of them is sent; still accepted so that a
client written against the earlier shape keeps working.
Apply the rule only to the rows of a table metric whose name matches — a memory pool (I/O),
a board (MPU Board *). Case-insensitive; * matches any run of characters. Omit it for
every row. At the same scope, a rule with a pattern wins for the rows it matches, so a looser
bound for one pool can sit beside the rule for all of them. Not allowed on an interface
rule, which already names one port.
The rule’s target when it has exactly one. Superseded by scope_ids, which wins if both
are sent; still accepted so that a client written against the earlier shape keeps working.
Every profile, folder group or node the rule applies to — scope_level says which of those
they are. Omit it (or send an empty list) for a global rule, which applies to every node.
At most 32, no repeats; an interface rule names exactly one port.
The primary side’s warning bound, read through direction. See the four bounds below.
Value at/above which the node is Warning.
Value at/below which the node is Warning. Send this and warning_above together to
alert outside a band — a dark optical link and an overdriven one, from one rule.
Examplegenerated
{ "critical": 1, "critical_above": 1, "critical_below": 1, "direction": "example", "dwell_samples": 1, "metric": "example", "row_match": "example", "scope_id": "example", "scope_ids": [ "example" ], "scope_level": "example", "warning": 1, "warning_above": 1, "warning_below": 1}Responses
Section titled “Responses”Rule created
The id of a freshly created resource — the whole body of a 201.
Deliberately one shape for every creator. The json!({"id": …}) literal it replaces was written
out per handler, which is how {"id": …} and {"node_id": …} both ended up in this API for the
same idea; a client then needs to know which creator it called to read the id back.
object
Examplegenerated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}The metric is not an identifier, scope_level/direction is outside its vocabulary, or the metric is a raw counter (a monotonic value has no meaningful fixed bound). A global rule ignores scope_id — it targets every node
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 ManageConfig
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" }}Skeleton mode has no write side
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" }}