Commit Graph

23 Commits

Author SHA1 Message Date
i.shramko
d185dc6c7c Update config:
- add dump() for dict| list overview
- del qtech.ttp _start_ method
2026-03-10 16:56:13 +03:00
i.shramko
68566a24fb Update qtech.ttp:
- add interface name ORPHRASE
2026-03-10 16:00:57 +03:00
IluaAir
c9f6f3472f Add Eltex model and TTP template
- Introduced a new `Eltex` model for parsing Eltex devices.
- Created a corresponding TTP template for Eltex devices, defining required and optional groups for configuration parsing.
2026-03-04 15:50:47 +03:00
i.shramko
1e84452eb5 Add H3C parse:
- Add h3c.py with basemodel parser
- Add ttp template for h3c
2026-03-04 15:23:55 +03:00
IluaAir
bf6dd0c189 Refactor Qtech model and update TTP template
- Removed the `interfaces` method from the `Qtech` model, simplifying the interface processing.
- Updated the TTP template to use `mask` instead of `netmask` for IP address configuration, enhancing clarity in CIDR notation.
2026-02-28 10:44:20 +03:00
IluaAir
197550558d Add Huawei model and TTP template
- Introduced a new `Huawei` model
- Created a corresponding TTP template for Huawei devices.
- Updated the base template to correct HTML entity encoding for vendor placeholders.
2026-02-28 10:39:03 +03:00
IluaAir
9e4574e869 Merge branch 'docs' into dev 2026-02-25 22:42:51 +03:00
IluaAir
2c3f5ce354 Add interfaces and vlans methods to Qtech model; update TTP template
- Implemented the `interfaces` method to process IP addresses and netmasks, adding a calculated mask to the output.
- Added the `vlans` method to handle VLAN data, supporting both individual and grouped VLAN IDs.
- Updated the QTECH TTP template to include a new version field and improved formatting for VLAN definitions.
2026-02-25 19:11:12 +03:00
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
c9d171e2fa Update Keenetic TTP template
- Modified the `description` field in the Keenetic TTP template to strip surrounding quotes.
2026-02-25 13:47:06 +03:00
IluaAir
fe6d0c4ccf Add README and documentation for Oxi API client
- Introduced a comprehensive README file detailing the installation, quick start guide, and API reference for the oxipy Python client.
- Added documentation on extending and overriding device models, including architecture, registration of new devices, and method overriding examples.
- Created a template guide for writing TTP templates, outlining structure, mandatory groups, and practical examples for new device support.
- Included a base template for device configuration parsing, enhancing usability for developers integrating with the Oxi API.
2026-02-24 23:27:14 +03:00
IluaAir
ac835d6b56 Enhance ModelView class with iterable and indexing support
- Added iterator, length, and item access methods to the `ModelView` class, allowing it to handle single models and lists more effectively.
- Refactored the `vlans` method in the `Keenetic` model to restore functionality for decoding VLAN descriptions, improving data processing consistency.
2026-02-24 23:19:57 +03:00
IluaAir
753268a381 Refactor BaseDevice and Interfaces models for improved validation and structure
- Introduced `_declared_sections` in `BaseDevice` to track declared template groups.
- Enhanced `_validate_contract` method to conditionally validate VLANs based on declared sections.
- Updated docstrings in `BaseDevice` and `Interfaces` models for clarity on expected structures.
- Refactored `Interfaces` and `Vlans` models to improve field definitions and aliases.
- Commented out unused `vlans` method in `Keenetic` model for future reference.
2026-02-22 15:52:45 +03:00
IluaAir
3635a07b27 Refactor BaseDevice methods for improved data handling and validation
- Updated the `BaseDevice` class to replace `_raw` with `raw` for consistency in data access.
- Enhanced the `vlans`, `interfaces`, and `system` methods to utilize the new `raw` attribute.
- Introduced a `_validate_contract` method to streamline the validation of parsed data into structured models.
- Adjusted the `Keenetic` and `Mikrotik` models to align with the updated data handling approach, ensuring proper parsing and decoding of interface and VLAN data.
2026-02-22 09:52:17 +03:00
IluaAir
2394296f5b Enhance Keenetic model and update templates for improved data handling
- Implemented the `interfaces` and `vlans` methods in the `Keenetic` model to process and decode interface and VLAN data.
- Added a `_decode_utf` method to handle UTF-8 encoded descriptions.
- Updated the Keenetic TTP template to define structured groups for system, interfaces, and VLANs.
- Refactored file paths in the `Mikrotik` model for consistency and clarity.
2026-02-22 00:21:55 +03:00
IluaAir
a41cb1f7ec """
Implement Keenetic model and enhance BaseDevice documentation

- Added a new `Keenetic` model that registers a parser for KeeneticOS, extending the `BaseDevice` class.
- Updated docstrings in the `BaseDevice` class methods to provide clearer descriptions of their functionality and expected data structures.
- Introduced `model_config` in the `Vlans` model to enable name-based population.
- Removed unnecessary print statements from the `Mikrotik` model methods to streamline output.
"""
2026-02-19 00:49:10 +03:00
IluaAir
a938fe2d47 Update Interfaces model and Mikrotik template for improved data handling
- Made the `description` field in the `Interfaces` model optional to enhance flexibility.
- Renamed `id` to `vlan_id` in the `Vlans` model for clarity.
- Refactored the `Mikrotik` class methods to streamline raw data access and removed unnecessary print statements.
- Updated the Mikrotik TTP template to reflect changes in variable names and improve overall structure for interface and VLAN configurations.
2026-02-19 00:31:54 +03:00
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
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