forked from mirrors/thatmattlove-hyperglass
migrate types to pydantic strict types
This commit is contained in:
parent
9e34623ac7
commit
cd66943d33
1 changed files with 17 additions and 8 deletions
|
|
@ -2,6 +2,13 @@
|
|||
|
||||
# Standard Library Imports
|
||||
from typing import List
|
||||
from typing import Union
|
||||
|
||||
# Third Party Imports
|
||||
from pydantic import IPvAnyAddress
|
||||
from pydantic import StrictBool
|
||||
from pydantic import StrictInt
|
||||
from pydantic import StrictStr
|
||||
|
||||
# Project Imports
|
||||
from hyperglass.configuration.models._utils import HyperglassModel
|
||||
|
|
@ -10,11 +17,13 @@ from hyperglass.configuration.models._utils import HyperglassModel
|
|||
class General(HyperglassModel):
|
||||
"""Validation model for params.general."""
|
||||
|
||||
debug: bool = False
|
||||
primary_asn: str = "65001"
|
||||
org_name: str = "The Company"
|
||||
google_analytics: str = ""
|
||||
redis_host: str = "localhost"
|
||||
redis_port: int = 6379
|
||||
requires_ipv6_cidr: List[str] = ["cisco_ios", "cisco_nxos"]
|
||||
request_timeout: int = 30
|
||||
debug: StrictBool = False
|
||||
primary_asn: StrictStr = "65001"
|
||||
org_name: StrictStr = "The Company"
|
||||
google_analytics: StrictStr = ""
|
||||
redis_host: StrictStr = "localhost"
|
||||
redis_port: StrictInt = 6379
|
||||
requires_ipv6_cidr: List[StrictStr] = ["cisco_ios", "cisco_nxos"]
|
||||
request_timeout: StrictInt = 30
|
||||
listen_address: Union[IPvAnyAddress, StrictStr] = "localhost"
|
||||
listen_port: StrictInt = 8001
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue