mirror of
https://github.com/checktheroads/hyperglass
synced 2024-05-11 05:55:08 +00:00
migrate types to pydantic strict types
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user