コンテンツにスキップ

create_threshold

POST
/api/v1/thresholds
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 }'
Media typeapplication/json

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
critical

The primary side’s critical bound, read through direction. See the four bounds below.

number | null format: double
critical_above

Value at/above which the node is Critical.

number | null format: double
critical_below

Value at/below which the node is Critical.

number | null format: double
direction
required

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.

string
dwell_samples
integer | null format: int32
metric
required
string
row_match

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.

string | null
scope_id

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.

string | null
scope_ids

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.

Array<string> | null
scope_level
required
string
warning

The primary side’s warning bound, read through direction. See the four bounds below.

number | null format: double
warning_above

Value at/above which the node is Warning.

number | null format: double
warning_below

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.

number | null format: double
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
}

Rule created

Media typeapplication/json

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
id
required
string format: uuid
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

Media typeapplication/json

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
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

No valid bearer token

Media typeapplication/json

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
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

Role lacks ManageConfig

Media typeapplication/json

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
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

Skeleton mode has no write side

Media typeapplication/json

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
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}