Spaces:
Runtime error
Runtime error
File size: 1,074 Bytes
6a5b8d8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
"""
Admin route schemas and models
"""
from pydantic import BaseModel, Field
from typing import List, Optional, Dict
from datetime import datetime
class SystemHealthResponse(BaseModel):
cpu_usage: float
memory_usage: float
disk_usage: float
network_stats: Dict
active_connections: int
uptime: float
class Config:
orm_mode = True
class ServerConfigUpdate(BaseModel):
server_name: Optional[str] = None
max_clients: Optional[int] = Field(None, gt=0)
bandwidth_limit: Optional[int] = Field(None, gt=0)
logging_level: Optional[str] = None
maintenance_mode: Optional[bool] = None
class Config:
orm_mode = True
class AlertResponse(BaseModel):
id: int
type: str
message: str
status: str
created_at: datetime
updated_at: datetime
class Config:
orm_mode = True
class AuditLogResponse(BaseModel):
id: int
user_id: int
action: str
details: str
timestamp: datetime
class Config:
orm_mode = True
|