feat(infrahub): add Infrahub client for fabric intent (#42) #54

Merged
Damien merged 5 commits from feature/42-infrahub-client into main 2026-02-27 12:08:36 +00:00

5 Commits

Author SHA1 Message Date
Damien
8c7e0973e2 Update test_infrahub_client.py parameter name from asn_val to asn
Update uv.lock to include new dependencies
2026-02-27 09:21:41 +01:00
Damien
4bef9303ba Update README.md tables to be more compact
Add .ruff_cache to .gitignore
2026-02-26 15:15:53 +01:00
Damien
8ee15c3228 docs(infrahub): add README with usage examples and API reference
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 15:11:58 +01:00
b31632109a docs: update README to remove Infrahub schema/data references (#42)
Remove all references to local Infrahub schemas, data files, and
.infrahub.yml config. The orchestrator now treats Infrahub as an
external Source of Truth queried via infrahub-sdk. Schema and data
are managed in the arista-evpn-vxlan-clab repository.
2026-02-26 14:05:07 +00:00
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