Skip to content

Get an event rule's live state

GET
/event-rules/{name}/state
curl --request GET \
--url https://example.com/api/v1/event-rules/example/state

What a rule holds right now: the conditions it holds in force (one per component and instance, whether or not it raises an alarm), the alarms it raised that are still open, each on a component and instance, its streaks waiting out a sustain, and when it last judged an ingested sample. Only conditions, alarms and streaks on components the caller may read are listed. Gated by rule:read.

name
required

The rule’s name

string

The rule’s name

OK

Media type application/json
object
$schema

A URL to the JSON Schema for this object.

string format: uri
conditions
required

The conditions the rule holds in force, informational or not

Array<object> | null
object
component
required

The component, by name

string
component_id
required

The component’s uuid

string
instance

The sample instance (an endpoint) the condition is on

string
since
required

When the condition came into force

string format: date-time
criteria_error

Why the rule’s stored criteria do not compile; absent when they compile. While present the rule holds

object
code

The registered diagnostic that gave it, when one did (documented on the expressions page)

string
column

The 1-based column of the fault, when it has one

integer format: int64
field
required

Which criteria

string
Allowed values: fire_criteria clear_criteria
line

The 1-based line of the fault, when it has one

integer format: int64
message
required
string
last_judged_at

When an ingested sample was last judged by the rule, to within 5s; absent when it never has been

string format: date-time
open
required

The alarms the rule raised that are still open

Array<object> | null
object
alarm_id
required
string
component
required

The component, by name

string
component_id
required

The component’s uuid

string
instance

The sample instance (an endpoint) the alarm is about

string
raised_at
required
string format: date-time
severity
required
string
pending
required

The rule’s streaks waiting out a sustain

Array<object> | null
object
component
required

The component, by name

string
component_id
required

The component’s uuid

string
instance
string
pending
required

The action the rule’s samples point at, waiting out its sustain

string
Allowed values: fire clear
since
required

When the streak began

string format: date-time
Example
{
"$schema": "/api/v1/schemas/EventRuleStateOutputBody.json",
"criteria_error": {
"field": "fire_criteria"
},
"pending": [
{
"pending": "fire"
}
]
}

Error

Media type application/problem+json
object
$schema

A URL to the JSON Schema for this object.

string format: uri
detail

A human-readable explanation specific to this occurrence of the problem.

string
errors

Optional list of individual error details

Array<object> | null
object
location

Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’

string
message

Error message text

string
value

The value at the given location

instance

A URI reference that identifies the specific occurrence of the problem.

string format: uri
status

HTTP status code

integer format: int64
title

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

string
type

A URI reference to human-readable documentation for the error.

string format: uri
default: about:blank
Example
{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}