cf7c29639c
Backend: config/db/security/logging core, SQLAlchemy models (Server, Credential, UpdateJob, UpdateLog, AuditLog, User), services (winrm, ssh, cau, audit, job_runner), REST API (auth, servers, updates, audit), Socket.io WebSocket layer. Frontend: Vue 3 + TS + Pinia + Tailwind, Views (Dashboard, Servers, Updates, Audit, Login), axios + socket.io-client, nginx prod config.
43 lines
873 B
Python
43 lines
873 B
Python
"""Update job schemas."""
|
|
|
|
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
from app.models.update_job import JobStatus, JobType
|
|
|
|
|
|
class JobTriggerRequest(BaseModel):
|
|
server_id: int
|
|
type: JobType
|
|
# CAU-specific options
|
|
cluster_name: str | None = None
|
|
# Linux-specific options
|
|
reboot_if_required: bool = False
|
|
|
|
|
|
class UpdateJobRead(BaseModel):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
id: int
|
|
server_id: int
|
|
type: JobType
|
|
status: JobStatus
|
|
progress_percent: int
|
|
current_phase: str | None
|
|
started_by: str
|
|
started_at: datetime | None
|
|
finished_at: datetime | None
|
|
error: str | None
|
|
created_at: datetime
|
|
|
|
|
|
class UpdateLogRead(BaseModel):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
id: int
|
|
job_id: int
|
|
timestamp: datetime
|
|
level: str
|
|
line: str
|