mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 06:21:15 +02:00
fix(images): reconcile the image inventory with filesystem changes
This commit is contained in:
1 parent
efd6bb77fe
commit
046dff4d08
22 files changed
+1809
-335
No files matched your search
@@ -16,6 +16,8 @@
|
||||
|
||||
from pydantic import ConfigDict, BaseModel, Field
|
||||
from enum import Enum
|
||||
from datetime import datetime
|
||||
from typing import Optional, Literal
|
||||
|
||||
from .base import DateTimeModelMixin
|
||||
|
||||
@@ -38,7 +40,28 @@ class ImageBase(BaseModel):
|
||||
image_size: int = Field(..., description="Image size in bytes")
|
||||
checksum: str = Field(..., description="Checksum value")
|
||||
checksum_algorithm: str = Field(..., description="Checksum algorithm")
|
||||
availability: Literal["unknown", "available", "missing", "unavailable", "invalid"] = "unknown"
|
||||
last_seen_at: Optional[datetime] = None
|
||||
last_verified_at: Optional[datetime] = None
|
||||
last_error: Optional[str] = None
|
||||
|
||||
|
||||
class Image(DateTimeModelMixin, ImageBase):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
class ImageSyncRequest(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
dry_run: bool = False
|
||||
force_checksum: bool = False
|
||||
|
||||
|
||||
class ImageSyncJob(DateTimeModelMixin):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
job_id: str
|
||||
status: Literal["queued", "running", "completed", "partial", "failed", "cancelled", "interrupted"]
|
||||
dry_run: bool
|
||||
force_checksum: bool
|
||||
finished_at: Optional[datetime] = None
|
||||
counts: dict[str, int]
|
||||
errors: list[dict[str, str]]
|
||||
@@ -117,6 +117,7 @@ class ServerSettingsUpdate(BaseModel):
|
||||
default_symbol_theme: Optional[BuiltinSymbolTheme] = None
|
||||
allow_raw_images: Optional[bool] = None
|
||||
auto_discover_images: Optional[bool] = None
|
||||
image_sync_interval: Optional[int] = Field(None, ge=10)
|
||||
report_errors: Optional[bool] = None
|
||||
additional_images_paths: Optional[List[str]] = None
|
||||
console_start_port_range: Optional[int] = Field(None, gt=0, le=65535)
|
||||
|
||||
Reference in new issue
Block a user