64 Commits

Author SHA1 Message Date
5bb69dfee3 Merge pull request 'documentation' (#1) from documentation into dev
Reviewed-on: #1
2026-05-29 15:55:32 +03:00
IluaAir
494cc9b08b Update project repository URL and simplify installation instructions in README.md
- Added a repository URL section in `pyproject.toml` to link to the GitHub repository.
- Updated installation instructions in `README.md` to reflect the change from Gitea to GitHub as the source for package installation, removing references to the private Gitea Package Registry.
2026-05-29 15:53:24 +03:00
IluaAir
2a03240414 Update setuptools version and modify license information in pyproject.toml
- Updated the required setuptools version from 61 to 77 to ensure compatibility with the latest features and improvements.
- Changed the license format in `pyproject.toml` to specify "Apache-2.0" directly and added a reference to the license file for clarity.
2026-05-28 15:55:20 +03:00
IluaAir
41c4cc48e9 Update project description and enhance documentation for clarity
- Revised the project description in `pyproject.toml` to better reflect the functionality of the `oxipy` client.
- Improved the README.md by adding detailed explanations of the project structure, installation instructions, and usage examples.
- Updated documentation files to enhance clarity and organization, including sections on extending models and writing TTP templates.
- Adjusted various TTP templates to ensure consistency and accuracy in the parsing of device configurations.
2026-05-25 16:01:38 +03:00
IluaAir
e8c33b0e64 Add VLAN range expansion utility and improve VLAN processing in Qtech model
- Introduced a new helper function `_expand_vlan_range` to convert VLAN range strings into a list of individual VLAN IDs.
- Enhanced the `vlans` method in the `Qtech` class to utilize the new function, improving the handling of VLAN IDs and ensuring proper processing of both individual and range-based VLAN inputs.
2026-05-25 15:41:50 +03:00
IluaAir
74647bea5b Update Huawei TTP template for improved system information display
- Modified the Huawei TTP template to enhance the system information output by including the line identifier and slot number alongside the version and serial number. This change aims to provide clearer context for system diagnostics.
2026-04-27 15:39:23 +03:00
IluaAir
5a4cfa18d4 Update Python version requirement and clean up imports
- Changed the required Python version in `pyproject.toml` from 3.11 to 3.10 to broaden compatibility.
- Removed an unused import from `oxi/conf.py` to streamline the code and improve readability.
2026-04-27 09:50:22 +03:00
IluaAir
5fa56d46af Enhance BaseDevice initialization and error handling
- Updated the `BaseDevice` class constructor to accept an optional `name` parameter for better context in error messages.
- Improved the `_validate_contract` method to raise an `OxiAPIError` with a descriptive message if the node is not found.
- Modified the `_run_ttp` method to include a check for node existence, returning `None` if not found.
- Changed the test file name in the `Eltex` model to reflect a more descriptive context for testing node not found scenarios.
2026-04-18 19:21:25 +03:00
IluaAir
9fd0ce1516 Implement enhanced error detection for NodeNotFound in OxiAPIError
- Added a new helper function `_looks_like_node_not_found_html` to identify NodeNotFound errors based on HTTP response content.
- Updated the `from_http_error` method in the `OxiAPIError` class to convert 500 status codes to 404 when a NodeNotFound error is detected, improving error handling and user feedback.
2026-04-17 20:45:16 +03:00
IluaAir
0b92e342e5 Enhance error handling in OxiAPI and Node classes
- Updated the `reload` method in the `OxiAPI` class to catch `HTTPError` exceptions and raise a custom `OxiAPIError` with context.
- Improved the `__call__` method in the `Node` class to handle `HTTPError` exceptions similarly, providing context-specific error messages.
- Introduced a new class method `from_http_error` in `OxiAPIError` for standardized error message generation based on HTTP status codes.
2026-03-26 20:10:05 +03:00
IluaAir
1cc225917e Add OxiApi create_session method for better view 2026-03-26 19:51:51 +03:00
IluaAir
61892d8f51 Add OxiAPIError exception class for improved error handling
- Introduced a new `OxiAPIError` class to standardize error reporting in the OxiAPI.
- The class includes an optional status code for enhanced context in error messages.
2026-03-26 00:39:43 +03:00
IluaAir
8cebbf743a Add OxiAdapter for enhanced HTTP request handling in OxiAPI
- Introduced a new `OxiAdapter` class that extends `HTTPAdapter` to manage timeouts and retries for HTTP requests.
- Integrated the `OxiAdapter` into the `OxiAPI` class, setting a default timeout and enabling retry logic for both HTTP and HTTPS requests.
2026-03-26 00:31:13 +03:00
IluaAir
a107662e99 Enhance OxiAPI and Node classes with type hints and property updates
- Updated the `OxiAPI` class to check for `None` explicitly when setting authentication credentials.
- Added type hints to the `Node` class and introduced a TODO for future enhancements.
- Refactored properties in the `NodeView` class to include type hints and improved handling of optional data retrieval.
2026-03-18 00:17:14 +03:00
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
IluaAir
5b8380aeee Add system method to Quasar model and update TTP template
- Implemented a new `system` method in the `Quasar` model to extract and format system information, including version handling.
- Updated the TTP template to adjust the grouping and ignore patterns for better parsing of system details, ensuring compatibility with the new method.
2026-03-17 01:07:23 +03:00
IluaAir
65c82fbaf5 Refactor error handling in Node class
- Updated the `Node` class to use `response.raise_for_status()` for improved error handling, replacing the previous manual check for a 500 status code. This change simplifies the error management process when fetching node data.
2026-03-16 18:24:24 +03:00
IluaAir
974fff6038 Update TTP template to escape whitespace in ignore patterns
- Modified the TTP template to use double backslashes for escaping whitespace in the `ignore` function for both `interfaces` and `bulkinterfaces` groups, ensuring proper parsing of configuration lines.
2026-03-13 13:12:02 +03:00
IluaAir
586e52282b Refactor Quasar interface handling and update TTP template
- Enhanced the `interfaces` method in the `Quasar` model to process bulk interfaces, returning a structured list of interface details.
- Updated the TTP template to reflect the change from `interfaces` to `bulkinterfaces` for better organization of interface configurations.
2026-03-12 23:39:47 +03:00
IluaAir
e3392f6c76 Add reload method to OxiAPI class
- Implemented a new `reload` method to fetch the reload status from the API.
- The method raises an error for unsuccessful responses and returns the status code on success.
2026-03-12 20:16:33 +03:00
IluaAir
de0e09af9d Add node refresh functionality to NodeView
- Implemented a private `_updater` method to fetch the next node's status.
- Added `last_status` and `last_check` properties to retrieve the latest node status and check time.
- Introduced a `refresh` property to update the node status and handle errors appropriately.
2026-03-12 20:13:02 +03:00
IluaAir
ca96d2600a Add Quasar model and TTP template
- Introduced a new `Quasar` model for parsing Quasar devices.
- Created a corresponding TTP template defining required and optional groups for configuration parsing.
2026-03-11 23:29:08 +03:00
IluaAir
56eae15e27 Update README.md to include new device models
- Added Eltex, H3C, and Quasar to the list of supported device models with their corresponding identifiers.
2026-03-11 23:26:35 +03:00
IluaAir
db79199319 Add LICENSE file and update pyproject.toml
- Added Apache License 2.0 to the project.
- Updated project description in pyproject.toml to "Oxidized API client".
- Specified the LICENSE file in pyproject.toml.
- Added classifiers for Python version and license type.
2026-03-11 23:23:23 +03:00
2e109db121 Update Qtech:
- Add full support of diff types of switches
- Fix default system parser
2026-03-10 18:41:54 +03:00
b9dce8e417 Update config:
- add by_alias attr
Update contract:
- del aliase for Vlans vlan_id
Update qtech.ttp:
- fix vla_id _start_ method
2026-03-10 17:53:51 +03:00
d185dc6c7c Update config:
- add dump() for dict| list overview
- del qtech.ttp _start_ method
2026-03-10 16:56:13 +03:00
68566a24fb Update qtech.ttp:
- add interface name ORPHRASE
2026-03-10 16:00:57 +03:00
08733bd493 Merge remote-tracking branch 'origin/dev' into dev 2026-03-10 15:52:56 +03:00
a1c57733f6 Update pyproject.toml:
- Add package-data with resource .ttp
2026-03-10 15:52:38 +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
1e84452eb5 Add H3C parse:
- Add h3c.py with basemodel parser
- Add ttp template for h3c
2026-03-04 15:23:55 +03:00
4ed34227d9 Update __init__.py:
- Add BaseDevice to __all__
- Add type str for register_parser
2026-03-03 09:52:28 +03:00
2a027ed736 Update uv.lock for windows support 2026-03-03 09:31:54 +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
c382627f9f Update README
- Added `Qtech` and `Huawei` entries to the interfaces table in the README.
2026-02-28 10:41:49 +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
b6630a4d30 Update README for clarity and consistency
- Simplified the description of the OxiAPI entry point.
- Improved formatting of parameter and property tables for better readability.
- Updated example outputs to reflect changes in node names and configurations.
2026-02-25 22:42:14 +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
8a126d8806 Update pyproject.toml
- Changed the `requires-python` field from ">=3.13" to ">=3.11" .
2026-02-25 14:16:00 +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
a016db644d Update README to reflect API name change and enhance installation instructions
- Changed references from "Oxi API" to "Oxidized API" for accuracy.
- Added detailed installation instructions for using the Gitea Package Registry, including authentication steps and editable install options.
- Improved clarity in the quick start section with formatted output examples.
2026-02-25 13:34:19 +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
3159570e27 Add ModelView class for enhanced JSON serialization in NodeConfig
- Introduced a new `ModelView` class to facilitate JSON serialization of model data, supporting both single models and lists.
- Updated `NodeConfig` methods to utilize `ModelView` for `vlans`, `interfaces`, and `system` properties, improving data handling consistency.
- Refactored the `json` method to ensure proper serialization of parsed data.
2026-02-24 22:50:55 +03:00
IluaAir
16e97692fc Refactor NodeConfig methods for consistency in data access
- Renamed `l3interfaces` to `interfaces` and `vlaninterfaces` to `system` in the `NodeConfig` class to align with updated data structure.
- This change enhances clarity and consistency in method naming, reflecting the underlying data model more accurately.
2026-02-24 22:31:18 +03:00
IluaAir
3fdff33e2e Implement validation for optional VLANs in BaseDevice
- Added a check in the BaseDevice class to raise a ValueError if the 'vlans' section is declared in the template but not present in the raw data returned by TTP.
- This enhancement improves data integrity by ensuring that optional groups are properly validated before processing.
2026-02-24 22:28:36 +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