Files
oxipy/oxi/interfaces/contract.py
IluaAir a521c60d76 Add shutdown attribute to Interfaces class and update related templates
- Added a `shutdown` boolean attribute to the `Interfaces` class to manage interface states.
- Updated the `eltex.ttp` template to include the `shutdown` command based on the new attribute.
- Modified expected configuration JSON files for various devices to reflect the new `shutdown` attribute, ensuring accurate testing and validation of interface configurations.
2026-07-15 00:47:10 +03:00

45 lines
743 B
Python

from ipaddress import IPv4Address
from pydantic import BaseModel, ConfigDict, Field
class Base(BaseModel):
model_config = ConfigDict(populate_by_name=True)
class System(BaseModel):
"""
Required
"""
model: str
serial_number: str
version: str
class Interfaces(Base):
"""
Required
"""
name: str = Field(alias="interface")
ip_address: IPv4Address | None = None
mask: int | None = None
description: str | None = None
shutdown: bool = False
class Vlans(Base):
"""
Optional
"""
vlan_id: int
name: str | None = Field(default=None, alias="description")
class Device(BaseModel):
system: System
interfaces: list[Interfaces]
vlans: list[Vlans] = []