CheckDefinition#
- class nominal.experimental.compute_as_code.CheckDefinition(title, expression, *, priority=None, 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 | None)
Default severity of violations, from P0 (most severe) to P4. Overrides the builder’s
default_priority. A priority passed toChecklistBuilder.addoverrides this one.event_type (EventType | None)
Default category of generated events. Overrides the builder’s
default_event_type. An event type passed toChecklistBuilder.addoverrides this one. When none of these is set, the service usesEventType.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. Merged with the builder’s
event_labelsand any passed toChecklistBuilder.add. 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.