25 lines
505 B
Python
25 lines
505 B
Python
from datetime import datetime
|
|
from typing import Literal
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
ActionStatus = Literal["pending", "running", "success", "failed"]
|
|
|
|
|
|
class ActionRead(BaseModel):
|
|
id: int
|
|
server_id: int
|
|
service_id: int | None
|
|
target_type: str
|
|
target_name: str
|
|
action: str
|
|
status: ActionStatus
|
|
source: str
|
|
requested_by: int
|
|
result_message: str | None
|
|
requested_at: datetime
|
|
completed_at: datetime | None
|
|
|
|
model_config = {"from_attributes": True}
|