init
This commit is contained in:
147
data_loader.py
Normal file
147
data_loader.py
Normal file
@@ -0,0 +1,147 @@
|
||||
from typing import List
|
||||
from models import Customer, Location, Host
|
||||
|
||||
|
||||
def load_customers() -> List[Customer]:
|
||||
"""Load customer data. For now, returns mock data but can be replaced later."""
|
||||
|
||||
# Create hosts for each location
|
||||
alpha_hq_hosts = [
|
||||
Host(name="Web Server", address="10.10.1.5", type="SSH"),
|
||||
Host(name="Admin Panel", address="https://10.10.1.10:8443", type="Web"),
|
||||
Host(name="Database", address="10.10.1.20", type="SSH"),
|
||||
]
|
||||
|
||||
alpha_branch_hosts = [
|
||||
Host(name="File Server", address="10.10.2.5", type="SMB"),
|
||||
Host(name="Backup Server", address="10.10.2.10", type="SSH"),
|
||||
]
|
||||
|
||||
beta_main_hosts = [
|
||||
Host(name="Main Portal", address="https://portal.beta.local", type="Web"),
|
||||
Host(name="File Server", address="192.168.50.10", type="SMB"),
|
||||
]
|
||||
|
||||
gamma_dc_hosts = [
|
||||
Host(name="Application Server", address="172.16.0.100", type="SSH"),
|
||||
Host(name="Monitoring Dashboard", address="https://monitor.gamma.net", type="Web"),
|
||||
Host(name="Backup Server", address="172.16.0.150", type="SSH"),
|
||||
]
|
||||
|
||||
gamma_dr_hosts = [
|
||||
Host(name="DR Server", address="172.16.1.100", type="SSH"),
|
||||
Host(name="Backup Storage", address="172.16.1.150", type="SMB"),
|
||||
]
|
||||
|
||||
delta_dev_hosts = [
|
||||
Host(name="Development Server", address="10.20.30.40", type="SSH"),
|
||||
Host(name="CI/CD Pipeline", address="https://jenkins.delta.local:8080", type="Web"),
|
||||
]
|
||||
|
||||
epsilon_prod_hosts = [
|
||||
Host(name="Production API", address="https://api.epsilon.com", type="Web"),
|
||||
Host(name="Database Cluster", address="10.5.0.50", type="PostgreSQL"),
|
||||
Host(name="Redis Cache", address="10.5.0.60", type="Redis"),
|
||||
]
|
||||
|
||||
epsilon_staging_hosts = [
|
||||
Host(name="Staging API", address="https://staging-api.epsilon.com", type="Web"),
|
||||
Host(name="Test Database", address="10.5.1.50", type="PostgreSQL"),
|
||||
]
|
||||
|
||||
# Create locations
|
||||
alpha_hq = Location(
|
||||
name="Headquarters",
|
||||
vpn_type="OpenVPN",
|
||||
connected=False,
|
||||
active=True,
|
||||
hosts=alpha_hq_hosts
|
||||
)
|
||||
|
||||
alpha_branch = Location(
|
||||
name="Branch Office",
|
||||
vpn_type="WireGuard",
|
||||
connected=False,
|
||||
active=False,
|
||||
hosts=alpha_branch_hosts
|
||||
)
|
||||
|
||||
beta_main = Location(
|
||||
name="Main Office",
|
||||
vpn_type="WireGuard",
|
||||
connected=True,
|
||||
active=True,
|
||||
hosts=beta_main_hosts
|
||||
)
|
||||
|
||||
gamma_dc = Location(
|
||||
name="Data Center",
|
||||
vpn_type="IPSec",
|
||||
connected=False,
|
||||
active=False,
|
||||
hosts=gamma_dc_hosts
|
||||
)
|
||||
|
||||
gamma_dr = Location(
|
||||
name="DR Site",
|
||||
vpn_type="OpenVPN",
|
||||
connected=False,
|
||||
active=False,
|
||||
hosts=gamma_dr_hosts
|
||||
)
|
||||
|
||||
delta_dev = Location(
|
||||
name="Development Lab",
|
||||
vpn_type="OpenVPN",
|
||||
connected=False,
|
||||
active=False,
|
||||
hosts=delta_dev_hosts
|
||||
)
|
||||
|
||||
epsilon_prod = Location(
|
||||
name="Production",
|
||||
vpn_type="WireGuard",
|
||||
connected=False,
|
||||
active=False,
|
||||
hosts=epsilon_prod_hosts
|
||||
)
|
||||
|
||||
epsilon_staging = Location(
|
||||
name="Staging",
|
||||
vpn_type="OpenVPN",
|
||||
connected=False,
|
||||
active=False,
|
||||
hosts=epsilon_staging_hosts
|
||||
)
|
||||
|
||||
# Create customers
|
||||
customers = [
|
||||
Customer(
|
||||
name="Customer Alpha Corp",
|
||||
locations=[alpha_hq, alpha_branch]
|
||||
),
|
||||
Customer(
|
||||
name="Beta Industries",
|
||||
locations=[beta_main]
|
||||
),
|
||||
Customer(
|
||||
name="Gamma Solutions",
|
||||
locations=[gamma_dc, gamma_dr]
|
||||
),
|
||||
Customer(
|
||||
name="Delta Tech",
|
||||
locations=[delta_dev]
|
||||
),
|
||||
Customer(
|
||||
name="Epsilon Systems",
|
||||
locations=[epsilon_prod, epsilon_staging]
|
||||
),
|
||||
]
|
||||
|
||||
return customers
|
||||
|
||||
|
||||
def save_customers(customers: List[Customer]) -> None:
|
||||
"""Save customer data. Placeholder for future implementation."""
|
||||
# TODO: Implement saving to file/database
|
||||
pass
|
||||
Reference in New Issue
Block a user