Commit Graph

9 Commits

Author SHA1 Message Date
IluaAir
685ff19d2f Enhance BaseDevice validation and update Mikrotik model
- Introduced a new method `_validate_template_groups` in `BaseDevice` to ensure TTP templates declare all required and optional sections.
- Updated `_REQUIRED_SECTIONS` and added `_OPTIONAL_SECTIONS` to improve template validation.
- Modified the `vlans` method in `Mikrotik` to streamline raw data handling and added debug print statements for clarity.
- Revised the Mikrotik TTP template to include structured variable definitions and improved group handling for interfaces and VLANs.
2026-02-19 00:16:37 +03:00
IluaAir
c434712309 Refactor Mikrotik model and update template structure
- Changed the parsing method in `NodeConfig` to use `parse()` instead of `parse_config()`.
- Updated the template loading path in `BaseDevice` to reflect the new directory structure.
- Enhanced the `Mikrotik` class with new methods for `system`, `interfaces`, and `vlans`, including debug print statements.
- Expanded the TTP template for Mikrotik to include structured variable definitions and groups for system, interfaces, and VLANs.
2026-02-18 15:45:17 +03:00
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
IluaAir
72cd796803 Refactor parse method in BaseDevice for improved readability
- Simplified the `parse` method in the `BaseDevice` class by directly returning a `Device` instance with keyword arguments, enhancing code clarity and maintainability.
2026-02-18 00:11:14 +03:00
IluaAir
e82bc25346 Refactor BaseDevice and update Device model structure
- Enhanced the `BaseDevice` class with methods for loading templates and parsing configuration data using TTP.
- Updated the `Device` model to use lists for `interfaces` and `vlans`, allowing for multiple entries.
- Introduced new TTP template files for structured data parsing.
2026-02-18 00:06:48 +03:00
IluaAir
2cfcc41e58 Enhance device interface structure and update dependencies
- Added `.idea` to `.gitignore` to exclude IDE configuration files.
- Introduced `pydantic` version `2.12.5` as a dependency in `pyproject.toml` and `uv.lock`.
- Added `annotated-types` as a new dependency in `uv.lock`.
- Refactored `BaseDevice` class to include abstract methods for device properties and loading templates.
- Created `Interfaces`, `System`, `Vlans`, and `Device` models in a new `contract.py` file for structured data handling.
- Updated `Mikrotik` class to implement the new `BaseDevice` structure and added a template loading method.
2026-02-16 00:57:09 +03:00
IluaAir
544688dae1 Update .gitignore and refactor Mikrotik model to inherit from BaseDevice
- Added *.txt files to .gitignore to exclude etc files.
- Refactored Mikrotik class to inherit from BaseDevice for improved structure and functionality.
2026-02-15 02:44:29 +03:00
IluaAir
b60182ef3c Add ttp dependency and refactor OxiAPI and NodeConfig classes
- Added `ttp` as a dependency in `pyproject.toml` and `uv.lock`.
- Updated `NodeConfig` to store model names in lowercase.
- Refactored `OxiAPI` to always create a new session and added a `close` method.
- Removed unnecessary logging in `Node` class.
- Introduced interfaces for device registration with a new `BaseDevice` class and a `register_parser` function.
- Created initial structure for device models, including a `Mikrotik` parser.
2026-02-14 21:31:02 +03:00
IluaAir
8e85086d98 base structure 2026-02-14 01:07:26 +03:00