Compare commits

...

2 Commits

Author SHA1 Message Date
IluaAir
77f539254c Add Qtech model and template; clean up Mikrotik model
- Introduced a new `Qtech` model with a corresponding TTP template for parsing QTECH devices.
- Removed commented-out methods in the `Mikrotik` model to improve code clarity and maintainability.
2026-02-25 17:00:36 +03:00
IluaAir
8a126d8806 Update pyproject.toml
- Changed the `requires-python` field from ">=3.13" to ">=3.11" .
2026-02-25 14:16:00 +03:00
4 changed files with 32 additions and 11 deletions

View File

@@ -7,16 +7,6 @@ from oxi.interfaces.base import BaseDevice
class Mikrotik(BaseDevice):
template = "mikrotik.ttp"
# def system(self) -> "System":
# systems = self._raw.get("system")
# return System(**systems)
# def interfaces(self) -> "Interfaces":
# return [Interfaces(**item) for item in self._raw.get("interfaces")]
# def vlans(self) -> list["Vlans"]:
# return [Vlans(**item) for item in self._raw.get("vlans")]
if __name__ == "__main__":
print(os.path.abspath(os.curdir))

View File

@@ -0,0 +1,7 @@
from oxi.interfaces import register_parser
from oxi.interfaces.base import BaseDevice
@register_parser(["QTECH"])
class Qtech(BaseDevice):
template = "qtech.ttp"

View File

@@ -0,0 +1,24 @@
<doc>
</doc>
<vars>
default_system = {
"model": "",
"serial_number": ""
}
</vars>
<group name="system">
! {{ model }} Series Software, Version {{ bootrom_ver }} Build {{ version }}, {{ ignore }}
! Serial num:{{ serial_number }}, {{ ignore }}
</group>
<group name="interfaces">
interface {{ interface }}
description {{ description | ORPHRASE }}
ip address {{ ip_address }} {{ netmask }}
</group>
<group name="vlans">
vlan {{ vlan_id }}
name {{ name }}
</group>

View File

@@ -7,7 +7,7 @@ name = "oxipy"
version = "0.1.0"
description = "Oxi API client"
readme = "README.md"
requires-python = ">=3.13"
requires-python = ">=3.11"
dependencies = [
"pydantic>=2.12.5",
"requests>=2.32.5",