first commit
This commit is contained in:
22
backend/app/schemas/dashboard.py
Normal file
22
backend/app/schemas/dashboard.py
Normal 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
|
||||
28
backend/app/schemas/router.py
Normal file
28
backend/app/schemas/router.py
Normal 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 = {}
|
||||
10
backend/app/schemas/user.py
Normal file
10
backend/app/schemas/user.py
Normal 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
|
||||
Reference in New Issue
Block a user