Refactor BaseDevice and update Device model structure

- Enhanced the `BaseDevice` class with methods for loading templates and parsing configuration data using TTP.
- Updated the `Device` model to use lists for `interfaces` and `vlans`, allowing for multiple entries.
- Introduced new TTP template files for structured data parsing.
This commit is contained in:
IluaAir
2026-02-18 00:06:48 +03:00
parent 2cfcc41e58
commit e82bc25346
4 changed files with 49 additions and 11 deletions

View File

@@ -16,10 +16,10 @@ class System(BaseModel):
class Vlans(BaseModel):
id: int
name: str = Field(alias="description")
name: str | None = Field(default=None, alias="description")
class Device(BaseModel):
system: System
interfaces: Interfaces
vlans: Vlans
interfaces: list[Interfaces] = []
vlans: list[Vlans] = []