Skip to content
Snippets Groups Projects
Commit 2cff272b authored by Erik Reid's avatar Erik Reid
Browse files

initial skeleton oss settings

parent cf659b5d
No related branches found
No related tags found
No related merge requests found
{
"RESOURCE_MANAGER_API_PREFIX": "http://localhost:44444",
"IPAM": {
"INFOBLOX": {
"scheme": "https",
"wapi_version": "v2.12",
"host": "10.0.0.1",
"username": "robot-user",
"password": "robot-user-password"
},
"TRUNK": {
"V4": {"container": "1.1.0.0/19", "mask": 31},
"V6": {"container": "dead:beef::/29", "mask": 96}
},
"GEANT_IP": {
"V4": {"container": "1.1.8.0/19", "mask": 31},
"V6": {"container": "dead:beef::/29", "mask": 96}
}
}
}
\ No newline at end of file
import json
import os
from typing import Optional
from pydantic import BaseSettings
class InfoBloxParams(BaseSettings):
scheme: str
wapi_version: str
host: str
username: str
password: str
class ServiceNetworkProtocolParams(BaseSettings):
container: str # ipaddress?
mask: int
class ServiceNetworkParams(BaseSettings):
V4: ServiceNetworkProtocolParams
V6: ServiceNetworkProtocolParams
class IPAMParams(BaseSettings):
INFOBLOX: InfoBloxParams
TRUNK: ServiceNetworkParams
GEANT_IP: ServiceNetworkParams
class OSSParams(BaseSettings):
IPAM: IPAMParams
RESOURCE_MANAGER_API_PREFIX: str # api prefix
def load_oss_params() -> OSSParams:
with open(os.environ['OSS_PARAMS_FILENAME']) as f:
return OSSParams(**json.loads(f.read()))
if __name__ == '__main__':
print(load_oss_params())
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment