first commit

This commit is contained in:
Mateusz Gruszczyński
2026-03-04 15:21:03 +01:00
commit 5429f176c9
53 changed files with 3808 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
from pydantic import BaseModel
class DashboardCreate(BaseModel):
name: str
is_shared: bool = False
class DashboardOut(BaseModel):
id: int
name: str
is_shared: bool
class PanelCreate(BaseModel):
title: str
router_id: int
config: dict # {"interfaces":[...],"metrics":[...],"interval_ms":1000,"window":120}
class PanelOut(BaseModel):
id: int
dashboard_id: int
title: str
router_id: int
config: dict

View File

@@ -0,0 +1,28 @@
from pydantic import BaseModel
class RouterCreate(BaseModel):
name: str
host: str
port_rest: int = 443
port_ssh: int = 22
port_api: int = 8728
verify_ssl: bool = False
preferred_method: str = "auto"
tags: str = ""
class RouterOut(BaseModel):
id: int
name: str
host: str
port_rest: int
port_ssh: int
port_api: int
verify_ssl: bool
preferred_method: str
tags: str
class CredentialCreate(BaseModel):
method: str # rest|ssh|api
username: str
secret: str
extra_json: dict = {}

View File

@@ -0,0 +1,10 @@
from pydantic import BaseModel, EmailStr
class UserOut(BaseModel):
id: int
email: EmailStr
role: str
class LoginIn(BaseModel):
email: EmailStr
password: str