Files
oxipy/oxi/interfaces/models/quasar.py
IluaAir 1d0f5ed685 Refactor Quasar model by removing system method and updating TTP template
- Removed the `system` method from the `Quasar` model to streamline system information handling.
- Updated the TTP template to enhance the formatting of system details, including version and product information, for improved clarity and organization.
2026-03-18 00:01:22 +03:00

37 lines
1.0 KiB
Python

from oxi.interfaces import BaseDevice, register_parser
@register_parser(["quasar", "qos"])
class Quasar(BaseDevice):
template = "quasar.ttp"
def interfaces(self) -> list[dict]:
ether_interfaces: dict = self.raw["interfaces"]
interfaces: list[dict] = []
bulk_interfaces: dict = self.raw["bulkinterfaces"]
for key, value in bulk_interfaces.items():
interfaces.append(
{
"interface": key,
"description": value.get("description"),
"ip_address": value.get("ip_address"),
"mask": value.get("mask"),
}
)
interfaces.append(ether_interfaces)
return interfaces
if __name__ == "__main__":
with open("./test7.txt") as file:
data = file.read()
quasar = Quasar(data)
qt = quasar.parse()
print(qt)
print()
with open("./test8.txt") as file:
data = file.read()
quasar = Quasar(data)
qt = quasar.parse()
print(qt)