CheckDefinition#
- class nominal.experimental.compute_as_code.CheckDefinition(title, expression, *, priority, description='', key=None, event_type=None, event_labels=None)#
Bases:
objectA reusable failure condition written in the frontend compute language.
Bind channels when adding this definition to a
ChecklistBuilder. Usedataclasses.replaceor ordinary Python functions to create variations.- Parameters:
title (str)
Display name of the check.
expression (str)
Source ending in a range expression describing violations. Assignments are allowed; omit imports. Convert boolean conditions with
.ranges().priority (Priority)
Severity of violations, from P0 (most severe) to P4.
event_type (EventType | None)
Category of generated events. When omitted, the service uses
EventType.ERROR. This does not change the condition or turn absence of matching ranges into success.EventType.UNKNOWNis not a valid category for creation.event_labels (Sequence[str] | None)
Labels applied to generated events, not checklist grouping labels. When omitted or empty, this check supplies no event labels. Labels are copied when the definition is added to a builder.
description (str)
Description of the check.
key (str | None)
Optional stable identity, independent of title and source. The same key preserves lineage across revisions. Omit to generate an identity each time the check is added. Keys are case-sensitive, are not trimmed, and must not be blank or repeated in a builder.