Models API¶
Typed normalized models and their JSON Schemas (clijson.models). The field-by-field description of each model
is on the Normalized models page.
json_schema ¶
JSON Schema (draft 2020-12) of the normalized output for intent.
Most intents normalize to an array of records; those in :data:SINGLE_RECORD to one object.
validate ¶
Check normalized records against the model for intent; returns a list of problems (empty = valid).
A dependency-free structural check (types, required and unexpected keys) that mirrors :func:json_schema.
record ¶
Build a record for intent with all schema keys present, in order.
pseudowire_redundancy ¶
pseudowire_redundancy(
records: list[dict[str, Any]] | None,
require_backup: bool = False,
) -> RedundancyReport
Check l2vpn.pseudowires records: one forwarding PW per service, backups in standby, nothing down.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
records
|
list[dict[str, Any]] | None
|
|
required |
require_backup
|
bool
|
also report services that have no standby / backup pseudowire at all |
False
|
RedundancyReport
dataclass
¶
Outcome of :func:pseudowire_redundancy.
INTENTS
module-attribute
¶
INTENTS: dict[str, type[Any]] = {
"system.version": SystemVersion,
"interfaces.brief": Interface,
"interfaces.detail": InterfaceDetail,
"interfaces.description": InterfaceDescription,
"bgp.summary": BgpNeighbor,
"ospf.neighbors": OspfNeighbor,
"isis.adjacency": IsisAdjacency,
"lldp.neighbors": LldpNeighbor,
"arp": Arp,
"ipv6.neighbors": Ipv6Neighbor,
"routes": Route,
"ldp.neighbors": LdpNeighbor,
"bfd.sessions": BfdSession,
"inventory": Inventory,
"cpu": Cpu,
"vrfs": Vrf,
"mac.table": MacEntry,
"lag": Lag,
"l2vpn.pseudowires": Pseudowire,
}