Files
oxipy/oxi/interfaces/contract.py
IluaAir 91b6606e3f Enhance BaseDevice methods with detailed parsing documentation
- Updated the `vlans`, `interfaces`, and `system` methods in the `BaseDevice` class to include comprehensive docstrings outlining expected raw data structures and error handling.
- Modified the `Interfaces` model in `contract.py` to allow optional fields for `ip_address` and `mask`, improving flexibility in interface definitions.
2026-02-18 00:55:43 +03:00

27 lines
504 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
class System(BaseModel):
model: str
serial_number: str
version: str
class Vlans(BaseModel):
id: int
name: str | None = Field(default=None, alias="description")
class Device(BaseModel):
system: System
interfaces: list[Interfaces] = []
vlans: list[Vlans] = []