Files
oxipy/oxi/interfaces/contract.py
IluaAir a938fe2d47 Update Interfaces model and Mikrotik template for improved data handling
- Made the `description` field in the `Interfaces` model optional to enhance flexibility.
- Renamed `id` to `vlan_id` in the `Vlans` model for clarity.
- Refactored the `Mikrotik` class methods to streamline raw data access and removed unnecessary print statements.
- Updated the Mikrotik TTP template to reflect changes in variable names and improve overall structure for interface and VLAN configurations.
2026-02-19 00:31:54 +03:00

27 lines
523 B
Python

from ipaddress import IPv4Address
from pydantic import BaseModel, Field
class Interfaces(BaseModel):
name: str
ip_address: IPv4Address | None = None
mask: int | None = None
description: str | None = None
class System(BaseModel):
model: str
serial_number: str
version: str
class Vlans(BaseModel):
vlan_id: int
name: str | None = Field(default=None, alias="description")
class Device(BaseModel):
system: System
interfaces: list[Interfaces] = []
vlans: list[Vlans] = []