1
0
Fork 1
mirror of https://github.com/thatmattlove/hyperglass.git synced 2026-01-17 16:48:05 +00:00
thatmattlove-hyperglass/hyperglass/configuration/models/structured.py
2020-06-21 14:12:08 -07:00

30 lines
745 B
Python

"""Structured data configuration variables."""
# Standard Library
from typing import List
# Third Party
from pydantic import StrictStr, constr
# Project
from hyperglass.models import HyperglassModel
class StructuredCommunities(HyperglassModel):
"""Control structured data response for BGP communties."""
mode: constr(regex=r"(permit|deny)") = "deny"
items: List[StrictStr] = []
class StructuredRpki(HyperglassModel):
"""Control structured data response for RPKI state."""
mode: constr(regex=r"(router|external)") = "router"
class Structured(HyperglassModel):
"""Control structured data responses."""
communities: StructuredCommunities = StructuredCommunities()
rpki: StructuredRpki = StructuredRpki()