Damien
|
f663cc623c
|
feat(infrahub): add Infrahub client for fabric intent (#42)
- Replace pynetbox with infrahub-sdk>=0.16.0 + pydantic>=2.0 in dependencies
- Add pytest and pytest-asyncio to dev dependencies
- Implement FabricInfrahubClient async client (src/infrahub/client.py)
- get_device, get_device_vlans, get_device_bgp_config
- get_device_bgp_peer_groups, get_device_bgp_sessions
- get_device_vrfs, get_device_vtep, get_device_evpn_instances
- get_mlag_domain, get_mlag_peer_config
- TTL-based caching (60s) to avoid redundant SDK queries
- Async context manager support
- Add Pydantic v2 frozen models for all intent types (src/infrahub/models.py)
- Add custom exception hierarchy (src/infrahub/exceptions.py)
- Add unit tests with fully mocked SDK (tests/test_infrahub_client.py)
- Tests for correct model return, NotFoundError, branch selection, caching
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-02-26 14:03:09 +01:00 |
|