Newer
Older
"""{term}`GSO` settings.
Ensuring that the required parameters are set correctly.
"""
class GeneralParams(BaseSettings):
"""General parameters for a {term}`GSO` configuration file."""
public_hostname: str
"""The hostname that {term}`GSO` is publicly served at, used for building the callback URL that the provisioning
proxy uses."""
"""Parameters related to InfoBlox."""
scheme: str
wapi_version: str
host: str
username: str
password: str
"""A set of parameters that describe an IPv4 network in InfoBlox."""
containers: list[ipaddress.IPv4Network]
JORGE SASIAIN
committed
networks: list[ipaddress.IPv4Network]
mask: int # TODO: validation on mask?
class V6NetworkParams(BaseSettings):
"""A set of parameters that describe an IPv6 network in InfoBlox."""
containers: list[ipaddress.IPv6Network]
JORGE SASIAIN
committed
networks: list[ipaddress.IPv6Network]
class ServiceNetworkParams(BaseSettings):
"""Parameters for InfoBlox.
The parameters describe IPv4 and v6 networks, and the corresponding domain name that should be used as a suffix.
domain_name: str
"""A set of parameters related to {term}`IPAM`."""
LO: ServiceNetworkParams
TRUNK: ServiceNetworkParams
GEANT_IP: ServiceNetworkParams
SI: ServiceNetworkParams
LT_IAS: ServiceNetworkParams
class ProvisioningProxyParams(BaseSettings):
"""Parameters for the provisioning proxy."""
auth: str # FIXME: unfinished
api_version: int
class NetBoxParams(BaseSettings):
"""Parameters for NetBox."""
token: str
api: str
"""The set of parameters required for running {term}`GSO`."""
GENERAL: GeneralParams
NETBOX: NetBoxParams
PROVISIONING_PROXY: ProvisioningProxyParams
"""Look for OSS_PARAMS_FILENAME in the environment and load the parameters from that file."""
with open(os.environ["OSS_PARAMS_FILENAME"], encoding="utf-8") as file: