1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

add structured output support

This commit is contained in:
checktheroads
2020-05-29 17:47:53 -07:00
parent 6858536d29
commit b0b6b67c5c
26 changed files with 1277 additions and 364 deletions

View File

@@ -13,6 +13,7 @@ from hyperglass.models import HyperglassModel
class ParsedRouteEntry(HyperglassModel):
"""Per-Route Response Model."""
prefix: StrictStr
active: StrictBool
age: StrictInt
weight: StrictInt
@@ -31,7 +32,6 @@ class ParsedRoutes(HyperglassModel):
"""Parsed Response Model."""
vrf: StrictStr
prefix: StrictStr
count: StrictInt = 0
routes: List[ParsedRouteEntry]
winning_weight: constr(regex=r"(low|high)")