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:
@@ -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] = []
|
||||
|
||||
Reference in New Issue
Block a user