43 lines
1.2 KiB
Python
43 lines
1.2 KiB
Python
from datetime import datetime
|
|
import enum
|
|
from typing import Optional
|
|
from uuid import UUID
|
|
from pydantic import BaseModel
|
|
|
|
class FirmwareUpdateStatus(enum.Enum):
|
|
CREATED = "xCreated"
|
|
SUBMITTED = "xSubmitted"
|
|
DOWNLOADED = "Downloaded"
|
|
DOWNLOAD_FAILED = "DownloadFailed"
|
|
DOWNLOADING = "Downloading"
|
|
DOWNLOAD_SCHEDULED = "DownloadScheduled"
|
|
DOWNLOAD_PAUSED = "DownloadPaused"
|
|
IDLE = "Idle"
|
|
INSTALLATION_FAILED = "InstallationFailed"
|
|
INSTALLING = "Installing"
|
|
INSTALLED = "Installed"
|
|
INSTALL_REBOOTING = "InstallRebooting"
|
|
INSTALL_SCHEDULED = "InstallScheduled"
|
|
INSTALL_VERIFICATION_FAILED = "InstallVerificationFailed"
|
|
INVALID_SIGNATURE = "InvalidSignature"
|
|
SIGNATURE_VERIFIED = "SignatureVerified"
|
|
|
|
class FirmwareUpdateBase(BaseModel):
|
|
retries: int
|
|
retry_interval: int
|
|
location: str
|
|
retrieve_date_time: datetime
|
|
install_date_time: Optional[datetime]
|
|
signing_certificate: Optional[str]
|
|
signature: Optional[str]
|
|
|
|
class FirmwareUpdate(FirmwareUpdateBase):
|
|
id: UUID
|
|
request_id: int
|
|
status: FirmwareUpdateStatus
|
|
|
|
class FirmwareUpdateCreate(FirmwareUpdateBase):
|
|
pass
|
|
|
|
class FirmwareUpdateSubmissionResponse(BaseModel):
|
|
status: str
|