2020-06-06 01:22:14 -07:00
|
|
|
"""Structured data configuration variables."""
|
|
|
|
|
|
|
|
# Standard Library
|
|
|
|
from typing import List
|
|
|
|
|
|
|
|
# Third Party
|
2020-06-21 14:12:08 -07:00
|
|
|
from pydantic import StrictStr, constr
|
2020-06-06 01:22:14 -07:00
|
|
|
|
2020-10-11 13:14:07 -07:00
|
|
|
# Local
|
|
|
|
from ..main import HyperglassModel
|
2020-06-06 01:22:14 -07:00
|
|
|
|
2020-07-13 02:18:26 -07:00
|
|
|
StructuredCommunityMode = constr(regex=r"(permit|deny)")
|
|
|
|
StructuredRPKIMode = constr(regex=r"(router|external)")
|
|
|
|
|
2020-06-06 01:22:14 -07:00
|
|
|
|
|
|
|
class StructuredCommunities(HyperglassModel):
|
|
|
|
"""Control structured data response for BGP communties."""
|
|
|
|
|
2020-07-13 02:18:26 -07:00
|
|
|
mode: StructuredCommunityMode = "deny"
|
2020-06-06 01:22:14 -07:00
|
|
|
items: List[StrictStr] = []
|
|
|
|
|
|
|
|
|
|
|
|
class StructuredRpki(HyperglassModel):
|
|
|
|
"""Control structured data response for RPKI state."""
|
|
|
|
|
2020-07-13 02:18:26 -07:00
|
|
|
mode: StructuredRPKIMode = "router"
|
2020-06-06 01:22:14 -07:00
|
|
|
|
|
|
|
|
|
|
|
class Structured(HyperglassModel):
|
|
|
|
"""Control structured data responses."""
|
|
|
|
|
|
|
|
communities: StructuredCommunities = StructuredCommunities()
|
|
|
|
rpki: StructuredRpki = StructuredRpki()
|