Saltar al contenido principal

Referencia GraphQL: event-processing

Generada a partir del esquema que sirve este servicio, así que no puede quedarse atrás. El mismo esquema se publica como archivo para herramientas y agentes.

Endpointhttps://<your-host>/api/event-processing/graphql
Plano de autenticacióntenant — The ordinary application plane. Obtain a tenant access token by calling login then selectTenant on user-management, and authorize each call with the capability it names (for example device:write).
Autorizacióntenant access token
Archivo del esquema/schema/event-processing.graphql
Descritos331 de 331 elementos
nota

La referencia que sigue se genera a partir del esquema y está solo en inglés.

Queries​

compareRuleVersions · compileCanvas · evaluateRules · eventProcessingInfo · previewRule · ruleHealth · validateDetectionRules

compareRuleVersions​

(Preview: may change in a minor release.) Only device-management's service identity may call this comparison engine behind reviewing an automation change. It replays two recorded windows once each through the active and the draft rule and returns the differences and expectation verdicts, executing nothing.

Returns CompareRuleVersionsResult

ArgumentTypeDescription
inputCompareRuleVersionsInput!(Preview: may change in a minor release.) The profile, rules, recorded windows and expectations to compare.

compileCanvas​

Compiles a visual automation canvas into its detection-rule definition, without saving anything. A canvas must author exactly one rule; a graph with zero or several condition nodes is rejected with a diagnostic. The same compiler and cost check as the form builder are used, so the definition is equivalent to the form-authored rule. Problems are reported as diagnostics with ok=false, not as GraphQL errors. Requires device:read.

Returns CanvasCompileResult!

ArgumentTypeDescription
graphString!The canvas definition, as the JSON document the console editor emits, serialized to a string.
profileTokenString!Token of the device profile the rule belongs to; every source node in the graph must be scoped to this profile.

evaluateRules​

(Preview: may change in a minor release.) Tests a profile's detection rules against events you supply, in event time, and reports what they would do. It returns the edges the rules derive (each raised or resolved) and, for each edge, the side effects the rules' action chains would request: the alarm raise or clear, the command with its key and arguments, and the webhook or published message with its rendered body. Nothing is executed: no alarm is raised, no command enqueued, no request sent.

The rules are either the profile's PUBLISHED rules or a DRAFT given as a canvas graph or a rule definition. The events are the ones in the request, handed to the detection engine in the order given, which is the order of delivery: list an event after one with a later time and it arrives late. After the last event the engine's clock is moved to advanceTo, which is how a rule that waits for silence is decided without waiting: a rule that fires after seven days of silence is tested by advancing seven days. The run reads no clock, so the same request always returns the same answer, and it touches no live stream, so it cannot move the live watermark or disturb live detection.

The engine holds its clock behind the newest event by the same lateness live detection uses, so a reading delivered out of order is used or declined exactly as live would use or decline it.

What it does not model: device attributes (a rule that reads one is evaluated without them and the result is marked degraded with ATTRIBUTE_REFERENCES), group-scoped published rules (skipped and listed in skippedRules, because an event here carries no group memberships), correlation rules (skipped when published and refused in a draft, because an event here carries no anchor memberships), geofence rules (refused), and whether a command exists on the device or a connector exists in the tenant (the intent is what the rule asks for).

A run that evaluates nothing is never a success: no events, no rule to evaluate, no free slot or no time left is a refusal (ok false, with the reason in refusal). The size of the request replaces the preview's 24-hour window as the bound. It shares the preview's per-tenant concurrency limit, and the service runs at most a few evaluations at once. Requires device:read.

Returns EvaluateRulesResult

ArgumentTypeDescription
inputEvaluateRulesInput!(Preview: may change in a minor release.) The profile, the rule set, the events to evaluate and the limits.

eventProcessingInfo​

Returns the identity of the event-processing service. Useful as a liveness check; it reads no tenant data.

Returns EventProcessingInfo!

previewRule​

Runs a draft detection rule against replayed history and reports the raise and resolve edges it would have produced: what the rule would have done. The draft is named by exactly one of graph and ruleDefinition. Nothing is saved or published and live detection is not affected.

Problems with the request or the draft (bad window, compile failure, both or neither draft given) come back as ok=false with diagnostics. An unpublished profile, history that has aged out, a scan limit or too many concurrent previews return ok=true with the reason in degraded. Requires device:read, and also location:read when the draft tests geofence containment, because the result reveals when a device was inside a region.

Returns PreviewResult!

ArgumentTypeDescription
inputPreviewRuleInput!The draft rule, the profile and the time window to replay.

ruleHealth​

Returns the health of each live detection rule of a profile's active published version: status, last fire and lifetime fire count. Returns an empty list for a profile with no published version. Read-only. Requires device:read.

Returns [RuleHealth!]!

ArgumentTypeDescription
profileTokenString!Token of the device profile.

validateDetectionRules​

Checks a batch of detection-rule definitions by decoding, compiling and cost-checking each one, without saving anything. Returns valid=false with one error per rejected rule; rules that compile may still produce advisory warnings. Pure validation: no state is read or written, so it is safe to call repeatedly. Requires device:read. At most 1,000 rules per call; a longer list is refused with LIMIT_EXCEEDED before any rule is compiled.

Returns DetectionRuleValidationResult!

ArgumentTypeDescription
rules[DetectionRuleInput!]!The rules to check, in order; the index in each error and warning refers to this list. At most 1,000.

Mutations​

draftDetectionRuleFromText

draftDetectionRuleFromText​

Drafts a detection rule from a plain-language description using the tenant's configured AI provider. The candidate is run through the same compiler as every other authoring path and, if it does not compile, repaired up to three inference rounds in total. Nothing is saved: you review the returned draft and save it through the normal rule-creation path.

When inference is not enabled on the deployment, no provider is active, the tenant has not opted in to external AI, the inference service could not be reached, or the tenant is over its drafting rate limit before a first candidate is produced, the result has unavailable=true rather than a GraphQL error. Each call spends inference budget, so it is a mutation and should not be retried blindly. Requires device:write.

Returns DraftRuleResult!

ArgumentTypeDescription
inputDraftRuleFromTextInput!The description to draft from, the target profile, and optional metric hints.

Subscriptions​

detectionStream

detectionStream​

Streams a device profile's detections as they fire: every raised or resolved edge of a rule belonging to the profile, including rules with no alarm action. Live from the moment of subscription, with no backfill; use ruleHealth or previewRule for history. Scoped to the caller's tenant. An empty profileToken is an error. Requires device:read; detections of rules that test geofence containment are delivered only to a caller that also holds location:read.

Returns DetectionEvent!

ArgumentTypeDescription
profileTokenString!Token of the device profile whose detections to stream.

Objects​

CanvasCompileResult · CanvasDiagnostic · CompareChangeCounts · CompareExpectationResult · CompareRefusal · CompareReplayFidelity · CompareReviewWindow · CompareRuleVersionsResult · DetectionEvent · DetectionRuleValidationError · DetectionRuleValidationResult · DetectionRuleValidationWarning · DraftDiagnostic · DraftRuleResult · EvaluateDegradation · EvaluateRulesResult · EvaluateStats · EvaluatedEdge · EvaluatedIntent · EventProcessingInfo · NodeTraceStep · PreviewFiring · PreviewResult · PreviewStats · RuleHealth · SkippedRule

CanvasCompileResult​

object

The outcome of compiling one automation canvas.

FieldTypeDescription
definitionStringThe compiled rule definition, as a JSON document serialized to a string. Null when ok is false.
diagnostics[CanvasDiagnostic!]!One entry per problem or advisory finding. Empty when there is nothing to report.
estimatedCostIntThe compiled predicate's worst-case evaluation cost, in the engine's cost units. Null when ok is false.
okBoolean!True only if the graph compiled to exactly one rule and passed the cost check. Save or publish only when true.

CanvasDiagnostic​

object

A compile diagnostic about a canvas or a draft rule, anchored to a node where it can be.

FieldTypeDescription
codeStringStable code identifying a rule-compiler warning (for example negatedAttributeGuard); null for a diagnostic that has none.
messageString!English text for the diagnostic, which is also the fallback when the code is not localized.
nodeIdStringId of the offending canvas node; null for a problem with the graph as a whole (for example a cycle or a dangling edge) or when the draft was not a canvas.
params[String!]!The values the code's text interpolates, in a fixed order per code. Empty when code is null.
severityString!Either "error", which rejects the graph, or "warning", which is advisory and the graph still compiled.

CompareChangeCounts​

object

(Preview: may change in a minor release.) Difference counts before truncation.

FieldTypeDescription
addedInt!(Preview: may change in a minor release.) Added edges and intents.
contentChangedInt!(Preview: may change in a minor release.) Pairs with changed content at the same instant.
removedInt!(Preview: may change in a minor release.) Removed edges and intents.
shiftedInt!(Preview: may change in a minor release.) Edges and intents paired at different instants.

CompareExpectationResult​

object

(Preview: may change in a minor release.) One expectation verdict.

FieldTypeDescription
baselineExpectationVerdict!(Preview: may change in a minor release.) Active-rule verdict.
baselineReasonString!(Preview: may change in a minor release.) Active-rule verdict explanation.
indexInt!(Preview: may change in a minor release.) Zero-based expectation index.
nameString!(Preview: may change in a minor release.) Expectation name.
reasonString!(Preview: may change in a minor release.) Draft verdict explanation.
verdictExpectationVerdict!(Preview: may change in a minor release.) Draft verdict.
windowReviewWindowRole!(Preview: may change in a minor release.) Judged window.

CompareRefusal​

object

(Preview: may change in a minor release.) A refused comparison.

FieldTypeDescription
messageString!(Preview: may change in a minor release.) Explanation of the refusal.
reasonCompareRefusalReason!(Preview: may change in a minor release.) Typed refusal reason.

CompareReplayFidelity​

object

(Preview: may change in a minor release.) Replay eligibility.

FieldTypeDescription
labelString!(Preview: may change in a minor release.) Human-readable interpretation of the replay.
reasons[String!]!(Preview: may change in a minor release.) Reasons replay is unsupported.
statusReplayFidelityStatus!(Preview: may change in a minor release.) Whether replay is supported.

CompareReviewWindow​

object

(Preview: may change in a minor release.) Window provenance and differences.

FieldTypeDescription
changeCountsCompareChangeCounts!(Preview: may change in a minor release.) Full difference counts.
changesTruncatedBoolean!(Preview: may change in a minor release.) Whether the stored change list was truncated.
degraded[String!]!(Preview: may change in a minor release.) Reasons evidence is incomplete.
endString!(Preview: may change in a minor release.) RFC3339 end.
firstSeqString!(Preview: may change in a minor release.) First sequence as a uint64 decimal string.
inputDigestString!(Preview: may change in a minor release.) Admitted input digest.
lastSeqString!(Preview: may change in a minor release.) Last sequence as a uint64 decimal string.
leadInStartString!(Preview: may change in a minor release.) RFC3339 lead-in start.
roleReviewWindowRole!(Preview: may change in a minor release.) Window purpose.
startString!(Preview: may change in a minor release.) RFC3339 start.
streamString!(Preview: may change in a minor release.) Replay stream suffix.

CompareRuleVersionsResult​

object

(Preview: may change in a minor release.) The comparison response.

FieldTypeDescription
engineBuildString!(Preview: may change in a minor release.) The service build version or source revision.
expectations[CompareExpectationResult!]!(Preview: may change in a minor release.) Expectation verdicts in input order.
fidelityCompareReplayFidelity(Preview: may change in a minor release.) Replay eligibility and limitations.
inputDigestString(Preview: may change in a minor release.) Digest of the admitted recorded inputs.
okBoolean!(Preview: may change in a minor release.) Whether the comparison ran.
outcomeReviewOutcome(Preview: may change in a minor release.) Aggregate verdict, including INCONCLUSIVE for unsupported replay.
refusalCompareRefusal(Preview: may change in a minor release.) Why the comparison did not run.
resultString(Preview: may change in a minor release.) Canonical JSON of the engine result for storage; unsupported results contain no edges, intents or changes.
resultDigestString(Preview: may change in a minor release.) SHA-256 hex digest of exactly the result string bytes.
windows[CompareReviewWindow!]!(Preview: may change in a minor release.) Recorded windows; empty for unsupported replay.

DetectionEvent​

object

One detection on the live feed.

FieldTypeDescription
edgeString!The transition: "raised" or "resolved".
kindString!The rule's type, for example threshold, deltaRate, repeating, duration, absence, aggregate, correlation or connectivity.
occurredTimeString!Event time the detection is stamped at, as an RFC 3339 timestamp.
ruleIdString!Runtime id of the rule that fired.
ruleTokenString!Token of the rule that fired, which links the detection to its rule in the profile.
seriesString!What the detection is keyed on: a device token, or the anchor's token for a correlation rule.
severityStringThe rule's severity: critical, major, minor, warning or indeterminate; null when the rule declares none.
valueFloatThe value that triggered a raised edge; null on a resolved edge and for rules with no triggering scalar.

DetectionRuleValidationError​

object

A rule that was rejected.

FieldTypeDescription
fieldStringAuthored JSON field to highlight (for example hold or when), or groupScoped for an unsupported group scope. Null means the finding applies to the whole definition, such as malformed JSON. Clients should show message for every finding.
indexInt!Zero-based position of the rejected rule in the submitted list.
messageString!Why the rule was rejected, in English, suitable for showing to the rule's author.
tokenString!The rejected rule's token, as submitted.

DetectionRuleValidationResult​

object

The outcome of validating a batch of detection rules.

FieldTypeDescription
errors[DetectionRuleValidationError!]!One entry per rejected rule. Empty when valid.
validBoolean!True only if every submitted rule decoded, compiled and passed the cost check; equivalent to errors being empty.
warnings[DetectionRuleValidationWarning!]!Advisory findings on rules that did compile. A warning never makes the batch invalid: the rule is accepted and evaluates as written.

DetectionRuleValidationWarning​

object

An advisory finding on a rule that compiled.

FieldTypeDescription
codeString!Stable code identifying the finding (for example negatedAttributeGuard). Localize text from the code and params.
indexInt!Zero-based position of the rule in the submitted list.
messageString!English fallback text for the finding.
params[String!]!The values the code's text interpolates, in a fixed order per code.
tokenString!The rule's token, as submitted.

DraftDiagnostic​

object

One reason a drafted rule was rejected, or one advisory finding on a draft that compiled.

FieldTypeDescription
codeStringStable code of an advisory finding, as in CanvasDiagnostic.code; null on a rejection reason.
fieldStringThe rule field the finding is about (for example "when" or "threshold"); null when it is not tied to a field.
messageString!English text suitable for showing to the author.
params[String!]!The values the code's text interpolates. Empty when code is null.

DraftRuleResult​

object

The outcome of a natural-language drafting request.

FieldTypeDescription
attemptsInt!Number of inference rounds that produced a candidate (at most 3); 0 when unavailable.
definitionStringThe compiled rule definition, as a JSON document serialized to a string, without a token (assigned when saved). Null unless ok.
diagnostics[DraftDiagnostic!]!The compiler's reasons for rejecting the last candidate. Empty when ok.
estimatedCostIntThe compiled predicate's worst-case evaluation cost, in the engine's cost units. Null unless ok.
modelStringThe model that produced the candidate; null if no candidate was produced.
okBoolean!True when a candidate compiled.
providerStringThe AI provider that produced the candidate; null if no candidate was produced.
rawCandidateStringThe model's last rejected output, so the author can see what it tried. Set only when ok is false and a candidate was produced.
unavailableBoolean!True when inference could not run: not enabled on the deployment, no active provider, the tenant has not opted in to external AI, the inference service could not be reached, or the tenant is over its drafting rate limit before a first candidate was produced.
unavailableReasonStringA fixed, non-technical explanation when unavailable is true; null otherwise.
warnings[DraftDiagnostic!]!Advisory findings on a draft that compiled. The rule is accepted and behaves as written, but the author should read them before saving. Empty unless ok.

EvaluateDegradation​

object

(Preview: may change in a minor release.) One reason an evaluation result is partial.

FieldTypeDescription
countInt!(Preview: may change in a minor release.) How many readings, edges, intents, actions or rules it affected.
reasonEvaluateDegradationReason!(Preview: may change in a minor release.) The reason.

EvaluateRulesResult​

object

(Preview: may change in a minor release.) The outcome of an evaluation.

FieldTypeDescription
degradations[EvaluateDegradation!]!(Preview: may change in a minor release.) Each reason the result is partial, with a count. Empty for a complete result. A partial result cannot prove that something did NOT happen.
degradedString(Preview: may change in a minor release.) The degradations as one sentence for a person to read. Null for a complete result.
diagnostics[CanvasDiagnostic!]!(Preview: may change in a minor release.) When ok is false, the reasons the evaluation was refused, each with the refusal reason as its code; otherwise advisory warnings, for example METRIC_NOT_SUPPLIED for a rule whose metric no supplied event carries.
edges[EvaluatedEdge!]!(Preview: may change in a minor release.) The edges the rules derived, ordered by time, then device, then rule, with raised before resolved at the same instant.
evaluatedRules[String!]!(Preview: may change in a minor release.) The tokens of the rules the evaluation ran: published rule tokens, a graph's condition node ids, or "draft". An expectation about a rule not in this list cannot be judged.
intents[EvaluatedIntent!]!(Preview: may change in a minor release.) The side effects the edges would cause, in the order of the edges that cause them and within an edge in the rule's action order. Requested, never executed.
okBoolean!(Preview: may change in a minor release.) True when the rules compiled and the evaluation ran, even if it derived nothing. False when the evaluation did not run; the reason is in refusal and the details in diagnostics.
refusalEvaluateRefusalReason(Preview: may change in a minor release.) When ok is false, why the evaluation was refused. Null when it ran.
skippedRules[SkippedRule!]!(Preview: may change in a minor release.) Published rules the evaluation did not run, each with the reason. Empty when every rule ran.
statsEvaluateStats!(Preview: may change in a minor release.) Counters for the run.

EvaluateStats​

object

(Preview: may change in a minor release.) Counters for one evaluation.

FieldTypeDescription
edgeCountInt!(Preview: may change in a minor release.) Edges derived.
evalErrorsInt!(Preview: may change in a minor release.) Events a rule predicate could not evaluate.
eventsDroppedInt!(Preview: may change in a minor release.) Events the duplicate guard dropped before the engine saw them.
eventsFedInt!(Preview: may change in a minor release.) Events handed to the detection engine.
intentCountInt!(Preview: may change in a minor release.) Intents recorded.
lateReadingsInt!(Preview: may change in a minor release.) Readings the engine declined because they arrived too far behind the others.
rulesEvaluatedInt!(Preview: may change in a minor release.) Rules that ran.
wallMsInt!(Preview: may change in a minor release.) Wall-clock milliseconds the evaluation took.

EvaluatedEdge​

object

(Preview: may change in a minor release.) One transition a rule derived.

FieldTypeDescription
kindString!(Preview: may change in a minor release.) The rule's type, for example threshold or absence.
occurredAtString!(Preview: may change in a minor release.) Event time of the edge, as an RFC 3339 timestamp with nanoseconds.
ruleString!(Preview: may change in a minor release.) Token of the rule that derived it: the published rule's token, a graph's condition node id, or "draft".
seriesString!(Preview: may change in a minor release.) Token of the device the edge is for.
severityString(Preview: may change in a minor release.) The rule's severity, when it declares one.
signalEvaluatedSignal!(Preview: may change in a minor release.) Whether the condition became true or ceased.
valueFloat(Preview: may change in a minor release.) The reading or computed value the edge is about, when it has one. Null for a resolved edge and for a silence-driven one.

EvaluatedIntent​

object

(Preview: may change in a minor release.) A side effect an edge would have caused. Requested by the rules; never executed.

FieldTypeDescription
alarmKeyString(Preview: may change in a minor release.) For raiseAlarm and clearAlarm, the alarm key the alarm is filed under.
bodyString(Preview: may change in a minor release.) For httpCall and publish, the body or message the rule's template rendered.
commandString(Preview: may change in a minor release.) For sendCommand, the command key sent to the device.
connectorString(Preview: may change in a minor release.) For publish, the token of the connector the message goes through.
expiresAtString(Preview: may change in a minor release.) For sendCommand with an expiry, when the command would expire, measured from the edge, as an RFC 3339 timestamp.
kindEvaluatedIntentKind!(Preview: may change in a minor release.) What is requested. SEND_COMMAND, HTTP_CALL and PUBLISH are requested on a raised edge only; CLEAR_ALARM on the resolved edge of a rule that raises an alarm.
methodString(Preview: may change in a minor release.) For httpCall, the HTTP method.
occurredAtString!(Preview: may change in a minor release.) Event time of the edge that causes it, as an RFC 3339 timestamp with nanoseconds.
payloadString(Preview: may change in a minor release.) For sendCommand, the command's argument object as the rule authored it.
ruleString!(Preview: may change in a minor release.) Token of the rule that derived the edge.
seriesString!(Preview: may change in a minor release.) Token of the device the edge is for.
severityString(Preview: may change in a minor release.) For raiseAlarm and clearAlarm, the alarm's severity tier.
signalEvaluatedSignal!(Preview: may change in a minor release.) The direction of the edge that causes the intent.
timeoutMsInt(Preview: may change in a minor release.) For httpCall and publish, the action's timeout in milliseconds; 0 means the default.
tokenString!(Preview: may change in a minor release.) The idempotency token the request would carry.
urlString(Preview: may change in a minor release.) For httpCall, the endpoint called.
valueFloat(Preview: may change in a minor release.) For raiseAlarm, the value the alarm is stamped with, when the edge has one.

EventProcessingInfo​

object

Identity of the event-processing service.

FieldTypeDescription
functionalAreaString!The functional area this service serves; always "event-processing".

NodeTraceStep​

object

What one canvas node did for a single firing.

FieldTypeDescription
detailStringShort explanation, for example why a branch blocked or an action was inert; null when the disposition is self-explanatory.
dispositionString!What the node did: "delivered" (source); "raised" or "resolved" (condition); "passed", "blocked" or "skipped" (branch); "raised", "sent", "cleared", "inert" or "skipped" (action).
kindString!The node's category: "source", "condition", "branch" or "action".
nodeIdString!Id of the canvas node, matching a node in the request's graph.

PreviewFiring​

object

One edge the draft would have produced.

FieldTypeDescription
occurredAtString!Event time of the edge, as an RFC 3339 timestamp.
seriesString!What the edge is for: a device token, or the anchor's token for a correlation rule.
signalString!"raised" for a rising edge or "resolved" for a falling edge.
trace[NodeTraceStep!]!What each canvas node did for this firing, from source through condition and branches to actions. Empty unless the request set trace and the draft is a canvas graph. A branch that feeds two actions appears once per action path.

PreviewResult​

object

The outcome of a replay preview.

FieldTypeDescription
degradedStringWhy the result is partial: for example history before the window is no longer retained, a read or scan limit was reached, the window was shortened, the profile is unpublished, the geofence archive is unreachable, or too many previews are already running for the tenant. Null for a complete result.
diagnostics[CanvasDiagnostic!]!When ok is false, the reasons the request or draft was rejected; when ok is true, advisory warnings about the compiled draft.
firings[PreviewFiring!]!The edges the draft would have produced, ordered by time, then series, with raised before resolved at the same instant.
okBoolean!True when the draft compiled and the replay ran, even if it found no firings. False when the request or draft was rejected; the reasons are in diagnostics.
statsPreviewStats!Coverage counters for the run.

PreviewStats​

object

Coverage counters for a preview run.

FieldTypeDescription
calculatedSkipsInt!How many times a draft formula produced no value for a reading, for example because an input was missing or the result was out of range.
evalErrorsInt!How many in-scope samples the rule could not evaluate because of a predicate error. A nonzero value adds a note to degraded, so a rule that errors is not mistaken for a quiet one.
eventsScannedInt!How many in-scope events were processed.
firingCountInt!How many edges were produced.
recalculatedSamplesInt!How many readings had their calculated metrics recomputed with the draft's formulas. Zero when the request carried no draftMetrics.
wallMsInt!Server-side wall-clock time the replay took, in milliseconds.

RuleHealth​

object

Health of one live detection rule.

FieldTypeDescription
fireCountInt!How many times the rule has fired over its lifetime; 0 if never. Approximate, since a replay can count a firing again, and capped at 2147483647.
lastFiredAtStringWhen the rule last fired, as an RFC 3339 timestamp of the event time; null if it has never fired.
lastSignalStringThe edge of the most recent fire, "raised" or "resolved"; null if the rule has never fired.
messageStringWhy the rule does not compile when status is COMPILE_ERROR; null otherwise.
nameString!The rule's display name from its definition, or its token when it has none.
ruleIdString!The rule's runtime id, composed as {tenant}/{profileVersionToken}/{ruleToken}.
ruleTokenString!The rule's token, its stable id within the profile.
statusRuleStatus!Whether the rule is running or no longer compiles.

SkippedRule​

object

(Preview: may change in a minor release.) A published rule an evaluation did not run.

FieldTypeDescription
groupString(Preview: may change in a minor release.) For GROUP_SCOPED, the group as token@version.
messageString!(Preview: may change in a minor release.) A sentence saying why.
reasonEvaluateSkipReason!(Preview: may change in a minor release.) Why it was not run.
ruleString!(Preview: may change in a minor release.) Token of the rule.

Input types​

CompareExpectationInput · CompareReviewWindowInput · CompareRuleEnvelopeInput · CompareRuleVersionsInput · CompareStreamBoundsInput · DetectionRuleInput · DraftRuleFromTextInput · EvaluateEventInput · EvaluateLimitsInput · EvaluateMeasurementInput · EvaluateRulesInput · MetricHintInput · PreviewMetricInput · PreviewRuleInput

CompareExpectationInput​

input

(Preview: may change in a minor release.) One strict rule-test expectation.

Input fieldTypeDescription
expectString!(Preview: may change in a minor release.) One core rule-test expectation as strict JSON or YAML.
nameString(Preview: may change in a minor release.) Optional display name.
windowReviewWindowRole!(Preview: may change in a minor release.) Window to judge.

CompareReviewWindowInput​

input

(Preview: may change in a minor release.) One recorded window.

Input fieldTypeDescription
endString!(Preview: may change in a minor release.) Inclusive RFC3339 end, at least two minutes before now.
roleReviewWindowRole!(Preview: may change in a minor release.) Purpose of this window.
startString!(Preview: may change in a minor release.) Inclusive RFC3339 start.

CompareRuleEnvelopeInput​

input

(Preview: may change in a minor release.) One rule version.

Input fieldTypeDescription
definitionString!(Preview: may change in a minor release.) The rules.Rule JSON definition.
enabledBoolean!(Preview: may change in a minor release.) Whether the rule is enabled.
entityGroupTokenString(Preview: may change in a minor release.) Optional entity group scope.
entityGroupVersionInt(Preview: may change in a minor release.) Optional entity group version.
tokenString!(Preview: may change in a minor release.) Rule token.

CompareRuleVersionsInput​

input

(Preview: may change in a minor release.) A recorded-input automation comparison.

Input fieldTypeDescription
baseCompareRuleEnvelopeInput(Preview: may change in a minor release.) The active rule; null means absent.
constantMetrics[String!](Preview: may change in a minor release.) Calculated metrics whose formulas read device constants.
deviceTokens[String!]!(Preview: may change in a minor release.) Distinct devices to review, at most 50.
draftCompareRuleEnvelopeInput(Preview: may change in a minor release.) The proposed rule; null means removed.
expectations[CompareExpectationInput!](Preview: may change in a minor release.) At most ten expectations.
profileTokenString!(Preview: may change in a minor release.) The owning profile token.
shiftWindowSecondsInt(Preview: may change in a minor release.) Maximum displacement for pairing changes; defaults to fifteen minutes.
streamBounds[CompareStreamBoundsInput!](Preview: may change in a minor release.) Optional recorded sequence bounds.
windows[CompareReviewWindowInput!]!(Preview: may change in a minor release.) Exactly one INCIDENT and one NORMAL window, each at most 24 hours.

CompareStreamBoundsInput​

input

(Preview: may change in a minor release.) Recorded replay positions.

Input fieldTypeDescription
firstSeqString!(Preview: may change in a minor release.) First sequence as a uint64 decimal string.
lastSeqString!(Preview: may change in a minor release.) Last sequence as a uint64 decimal string.
roleReviewWindowRole!(Preview: may change in a minor release.) The window these bounds identify.
streamString!(Preview: may change in a minor release.) Resolved-events stream suffix.

DetectionRuleInput​

input

One detection rule submitted for validation.

Input fieldTypeDescription
definitionString!The rule definition, as a JSON document serialized to a string.
groupScopedBoolean = falseWhether the rule is scoped to a device group. Some rule kinds (absence and correlation) cannot be group-scoped and are rejected if this is true. Defaults to false.
tokenString!The rule's token, used to name the rule in errors and warnings.

DraftRuleFromTextInput​

input

Input to draftDetectionRuleFromText.

Input fieldTypeDescription
metrics[MetricHintInput!]Optional metric vocabulary of the target profile, so the model refers to real metric keys. Omit it and the model works from the description alone.
profileTokenString!Token of the target device profile.
textString!The author's plain-language description of the rule they want.

EvaluateEventInput​

input

(Preview: may change in a minor release.) One measurement event to evaluate.

Input fieldTypeDescription
deviceTokenString!(Preview: may change in a minor release.) Token of the device that reports the readings. It is the series the rules key on.
measurements[EvaluateMeasurementInput!]!(Preview: may change in a minor release.) The readings, one per metric. At least one.
occurredAtString!(Preview: may change in a minor release.) When the readings occurred, as an RFC 3339 timestamp.

EvaluateLimitsInput​

input

(Preview: may change in a minor release.) Limits on one evaluation. Each is capped by a fixed maximum.

Input fieldTypeDescription
maxEdgesInt(Preview: may change in a minor release.) The most edges the result records; 50000 when omitted, and at most 250000. Edges past the limit, and their intents, are not recorded, and the result is marked degraded with EDGE_LIMIT.
maxEventsInt(Preview: may change in a minor release.) The most events the request may carry; 100000 when omitted, and at most 250000. A request over the limit is refused before any work is done.
maxIntentsInt(Preview: may change in a minor release.) The most intents the result records; 50000 when omitted, and at most 250000. Edges beyond it are still returned; the intents past the limit are not, and the result says so in degraded.

EvaluateMeasurementInput​

input

(Preview: may change in a minor release.) One reading of an evaluated event.

Input fieldTypeDescription
nameString!(Preview: may change in a minor release.) The metric key, as a rule's condition names it.
valueFloat!(Preview: may change in a minor release.) The reading.

EvaluateRulesInput​

input

(Preview: may change in a minor release.) Input to evaluateRules.

Input fieldTypeDescription
advanceToString(Preview: may change in a minor release.) The instant the engine's clock is moved to after the last event, as an RFC 3339 timestamp: what decides a timer-driven rule (silence, a held duration, a closing window). Defaults to the last event's time. Must not be before it.
events[EvaluateEventInput!]!(Preview: may change in a minor release.) The events, in the order they are delivered to the engine. An event listed after one with a later occurredAt is delivered late.
graphString(Preview: may change in a minor release.) For ruleSet DRAFT, a canvas definition serialized to a string. Give exactly one of graph and ruleDefinition. A graph may hold several detection rules; each is evaluated and named by its condition node's id. A graph with more than 256 detection rules is refused with LIMIT_EXCEEDED before any is compiled. Rejected for PUBLISHED, so a mistake is not silent.
limitsEvaluateLimitsInput(Preview: may change in a minor release.) Limits on the size of the run. Omit for the defaults.
profileTokenString!(Preview: may change in a minor release.) Token of the device profile whose rules are evaluated.
ruleDefinitionString(Preview: may change in a minor release.) For ruleSet DRAFT, a rule definition as a JSON document serialized to a string. The rule is named "draft" in the result.
ruleSetEvaluateRuleSet!(Preview: may change in a minor release.) Whether to run the profile's PUBLISHED rules or the DRAFT given in this request.

MetricHintInput​

input

One metric of the target profile's vocabulary, offered to the model as context. Only key is required.

Input fieldTypeDescription
dataTypeStringThe metric's data type, as a hint.
descriptionStringWhat the metric measures, as a hint.
keyString!The metric's key.
unitStringThe metric's unit, as a hint.

PreviewMetricInput​

input

One metric definition of a draft device profile, as the preview reads it: a measured metric when expression is omitted, a calculated one when it is given.

Input fieldTypeDescription
dataTypeString!The metric's data type: DOUBLE, INT, BOOLEAN or STRING.
expressionStringThe formula of a calculated metric. Omit for a measured metric.
maxValueFloatLargest value a calculated metric may take; a result above it produces no value.
metricKeyString!The metric's key, as readings and formulas name it.
minValueFloatSmallest value a calculated metric may take; a result below it produces no value.

PreviewRuleInput​

input

Input to previewRule. Exactly one of graph and ruleDefinition names the draft.

Input fieldTypeDescription
draftMetrics[PreviewMetricInput!]The draft profile's metric definitions, measured and calculated. When given, every replayed reading has its calculated metrics recomputed from its stored measured values with these formulas, replacing the values stored when it was recorded, so the draft rule is previewed against the values the draft profile would compute once published; a calculated metric the list does not declare has no value. Omit to preview the values as stored. The formulas are checked as a publish checks them, and a problem is returned in diagnostics. A formula that reads a number its device carries (device.name) is recomputed with that device's CURRENT metadata, read now, so a reading stored under an older value previews under today's; a device without it, or that cannot be read, has no value for those readings, and the result says so. At most 1000 entries. Nothing computed here is stored or streamed.
endString!End of the replay window by event occurred time, as an RFC 3339 timestamp. Must be after start. A window longer than 24 hours is shortened to the 24 hours ending at end, and the result says so in degraded.
graphStringA canvas definition, as the JSON document the console editor emits, serialized to a string.
profileTokenString!Token of the device profile whose published history the draft is replayed against.
ruleDefinitionStringA rule definition, as a JSON document serialized to a string (the form builder's output).
startString!Start of the replay window by event occurred time, as an RFC 3339 timestamp.
traceBooleanWhen true and the draft is a canvas graph, each firing carries a per-node trace of what every canvas node did for it. Off by default; ignored for a ruleDefinition draft.

Enums​

CompareRefusalReason · EvaluateDegradationReason · EvaluateRefusalReason · EvaluateRuleSet · EvaluateSkipReason · EvaluatedIntentKind · EvaluatedSignal · ExpectationVerdict · ReplayFidelityStatus · ReviewOutcome · ReviewWindowRole · RuleStatus

CompareRefusalReason​

enum

(Preview: may change in a minor release.) Why a comparison was refused.

ValueDescription
INVALID_INPUT(Preview: may change in a minor release.) Invalid request or rule definition.
LIMIT_EXCEEDED(Preview: may change in a minor release.) A request exceeds comparison limits.
RULE_REJECTED(Preview: may change in a minor release.) A rule failed compilation.
BUSY(Preview: may change in a minor release.) No preview slot is free.
TIMEOUT(Preview: may change in a minor release.) The comparison time budget expired.

EvaluateDegradationReason​

enum

(Preview: may change in a minor release.) Why an evaluation result is partial.

ValueDescription
LATE_READINGS(Preview: may change in a minor release.) Readings arrived too far behind the others to be used.
EVAL_ERRORS(Preview: may change in a minor release.) A rule predicate could not be evaluated on some events.
INTENT_LIMIT(Preview: may change in a minor release.) Intents past the intent limit were not recorded.
EDGE_LIMIT(Preview: may change in a minor release.) Edges past the edge limit, and their intents, were not recorded.
UNATTRIBUTED_DETECTIONS(Preview: may change in a minor release.) A detection could not be turned into a derived event and was dropped.
ACTION_DROPPED(Preview: may change in a minor release.) An action was skipped because the rule's stored action could not be carried out (a guard, payload template or alarm-key template that failed, or an invalid setting).
ATTRIBUTE_REFERENCES(Preview: may change in a minor release.) A rule reads device attributes, which an evaluation does not supply.

EvaluateRefusalReason​

enum

(Preview: may change in a minor release.) Why an evaluation was refused.

ValueDescription
BUSY(Preview: may change in a minor release.) Too many previews and evaluations are already running; try again shortly.
TIMEOUT(Preview: may change in a minor release.) The evaluation ran out of time before it finished; send fewer events.
LIMIT_EXCEEDED(Preview: may change in a minor release.) A limit was exceeded, for example too many events or rules.
INVALID_INPUT(Preview: may change in a minor release.) The request is malformed, for example it has no events or an invalid timestamp.
RULE_REJECTED(Preview: may change in a minor release.) A rule does not compile, or a draft graph does not lower to rules.
NO_PUBLISHED_VERSION(Preview: may change in a minor release.) The profile has no published version, so it has no published rules.
NO_RULES(Preview: may change in a minor release.) The profile's published version has no detection rules.
ALL_RULES_SKIPPED(Preview: may change in a minor release.) Every published rule was skipped (see skippedRules), so nothing was evaluated.

EvaluateRuleSet​

enum

(Preview: may change in a minor release.) Which rules an evaluation runs.

ValueDescription
PUBLISHED(Preview: may change in a minor release.) The profile's currently published detection rules.
DRAFT(Preview: may change in a minor release.) A draft given in the request as a canvas graph or a rule definition. The profile need not be published.

EvaluateSkipReason​

enum

(Preview: may change in a minor release.) Why a published rule was not evaluated.

ValueDescription
GROUP_SCOPED(Preview: may change in a minor release.) The rule is scoped to an entity group, and an evaluated event carries no group memberships.
CORRELATION(Preview: may change in a minor release.) The rule correlates devices under an anchor (an area, for example), and an evaluated event carries no anchor memberships.

EvaluatedIntentKind​

enum

(Preview: may change in a minor release.) The kind of side effect an evaluated intent requests.

ValueDescription
RAISE_ALARM(Preview: may change in a minor release.) Raise or escalate an alarm.
CLEAR_ALARM(Preview: may change in a minor release.) Clear the rule's contribution to an alarm.
SEND_COMMAND(Preview: may change in a minor release.) Send a command to the device.
HTTP_CALL(Preview: may change in a minor release.) Call a webhook.
PUBLISH(Preview: may change in a minor release.) Publish a message through a connector.

EvaluatedSignal​

enum

(Preview: may change in a minor release.) The direction of an evaluated edge.

ValueDescription
RAISED(Preview: may change in a minor release.) The condition became true.
RESOLVED(Preview: may change in a minor release.) The condition ceased.

ExpectationVerdict​

enum

(Preview: may change in a minor release.) A single expectation verdict.

ValueDescription
PASS(Preview: may change in a minor release.) The expectation holds.
FAIL(Preview: may change in a minor release.) The expectation is contradicted.
INCONCLUSIVE(Preview: may change in a minor release.) The available evidence cannot decide.

ReplayFidelityStatus​

enum

(Preview: may change in a minor release.) Whether recorded telemetry can reproduce this rule.

ValueDescription
SUPPORTED(Preview: may change in a minor release.) The rules support recorded-input replay.
UNSUPPORTED(Preview: may change in a minor release.) The rules require inputs replay cannot reproduce.

ReviewOutcome​

enum

(Preview: may change in a minor release.) The aggregate expectation outcome.

ValueDescription
PASSED(Preview: may change in a minor release.) Every expectation passed.
FAILED(Preview: may change in a minor release.) An expectation failed.
INCONCLUSIVE(Preview: may change in a minor release.) The available evidence cannot decide.

ReviewWindowRole​

enum

(Preview: may change in a minor release.) The purpose of recorded history.

ValueDescription
INCIDENT(Preview: may change in a minor release.) History containing the incident.
NORMAL(Preview: may change in a minor release.) History containing normal operation.

RuleStatus​

enum

The status of a live detection rule.

ValueDescription
ACTIVEThe rule compiles under the current limits and is running.
COMPILE_ERRORThe published rule no longer compiles under the current limits (for example after a maximum rule duration was lowered). It is surfaced so its author can re-author it. A rule that failed to compile at publish time never reaches this state, because publishing is refused.