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
21a44db736
Merge pull request 'feature/52-object-files' ( #53 ) from feature/52-object-files into main
...
Reviewed-on: #53
2026-02-20 15:14:03 +00:00
Damien
6b00b30f26
feat(infrahub): remove infrahub schema
2026-02-20 16:12:28 +01:00
Damien
110c223b66
chore(schema): update schema
2026-02-20 15:49:09 +01:00
8faf5139cb
fix(mlag): correct local_interface_ip for secondary leaves in MLAG pairs
2026-02-20 14:21:59 +00:00
Damien
c902d7df58
chore(schema): update schema
2026-02-20 15:13:46 +01:00
Damien
9e1fe9be7f
chore(fix schema): remove unused border leaf
2026-02-20 15:02:49 +01:00
Damien
bccac190ff
Update object
2026-02-16 17:49:44 +01:00
Damien
cb06068347
feat(schema,objects): add local_identifier to BGP types for unique HFID — refs #52
...
Infrahub does not support relation traversal in HFID computation.
Add a local_identifier attribute to PeerGroup, Session, and
AddressFamily that combines device name with the type-specific key.
Schema changes (bgp.yml):
- InfraBGPPeerGroup: HFID=local_identifier__value (e.g. spine1__evpn)
- InfraBGPSession: HFID=local_identifier__value (e.g. spine1__10.0.250.11)
- InfraBGPAddressFamily: HFID=local_identifier__value (e.g. spine1__ipv4_unicast)
Object file changes:
- 09-bgp.yml: added local_identifier to 26 PeerGroup entries
- 10-bgp-sessions.yml: added local_identifier to 72 Session + 20 AF entries,
updated 56 peer_group + 26 active_peer_groups references
2026-02-15 21:31:03 +01:00
Damien
4b1ca7b2a6
fix(schema,objects): simplify BGP HFIDs to single field — refs #52
...
Infrahub does not support relation traversal in HFID computation.
bgp_config__router_id__value returned only the name, not the full path.
Schema changes:
- InfraBGPPeerGroup HFID: [name__value] (was [bgp_config__router_id__value, name__value])
- InfraBGPSession HFID: [peer_address__value] (was [bgp_config__router_id__value, peer_address__value])
- uniqueness_constraints unchanged (still scoped to bgp_config)
Object file changes (10-bgp-sessions.yml):
- peer_group: ["10.0.250.x", "name"] → peer_group: "name" (56 refs)
- active_peer_groups: - ["10.0.250.x", "name"] → - "name" (26 refs)
2026-02-15 21:23:58 +01:00
Damien
9f89058f58
revert(schema,objects): restore router_id in BGP HFIDs — refs #52
...
Restore original human_friendly_id fields:
- InfraBGPPeerGroup: bgp_config__router_id__value + name__value
- InfraBGPSession: bgp_config__router_id__value + peer_address__value
Restore router_id values in peer_group and active_peer_groups
references in 10-bgp-sessions.yml (82 replacements).
2026-02-15 20:46:26 +01:00
Damien
241655e348
fix(schema,objects): use device name instead of router_id in BGP HFIDs — refs #52
...
The SDK cannot resolve deep relation traversals like
bgp_config__router_id__value when loading object files.
Schema changes in bgp.yml:
- InfraBGPPeerGroup HFID: bgp_config__router_id__value → bgp_config__device__name__value
- InfraBGPSession HFID: bgp_config__router_id__value → bgp_config__device__name__value
Object file changes in 10-bgp-sessions.yml:
- peer_group refs: router_id → device_name (e.g. ["10.0.250.1", "evpn"] → ["spine1", "evpn"])
- active_peer_groups refs: same mapping (82 replacements total)
2026-02-15 20:44:39 +01:00
Damien
2a2e0dfe73
fix(objects): split BGP sessions from peer groups for load ordering — refs #52
...
InfraBGPSession references InfraBGPPeerGroup via peer_group HFID,
so peer groups must be committed before sessions are created.
Split 09-bgp.yml into:
- 09-bgp.yml: InfraBGPRouterConfig + InfraBGPPeerGroup
- 10-bgp-sessions.yml: InfraBGPSession + InfraBGPAddressFamily
Renamed: 10-vrfs→11, 11-mlag→12. Now 12 object files total.
2026-02-15 20:25:36 +01:00
Damien
ccd882bcfd
fix(schema): change InfraIPAddress.address from IPNetwork to IPHost — refs #52
...
IPNetwork with strict=True rejects host addresses like 10.0.1.1/31
(host bits set). Interface IP assignments are host addresses with a
prefix length, which is exactly what IPHost accepts.
2026-02-15 20:23:07 +01:00
Damien
4409dc5e8d
fix(objects): remove interface refs from IPs — InfraInterface has no HFID — refs #52
...
InfraIPAddress.interface peers with the generic InfraInterface which
has no human_friendly_id defined, so infrahubctl cannot resolve the
HFID lookup. Remove interface references from all IP address objects.
IP-to-interface associations can be established later via the reverse
relationship (ip_addresses on interface objects) or by adding an HFID
to the InfraInterface generic in a future schema update.
2026-02-15 20:22:01 +01:00
Damien
97720d3d6d
fix(objects): split Vlan SVIs and IPs for load ordering — refs #52
...
InfraInterfaceVlan references InfraVLAN objects (06-vlans-vxlan.yml),
so Vlan SVIs must load after VLANs. Similarly, Vlan IP addresses
reference Vlan SVIs.
Changes:
- Extract InfraInterfaceVlan from 04 into 07-interface-vlans.yml
- Extract Vlan SVI IPs from 05 into 08-ipam-vlans.yml
- Rename 07-bgp→09, 08-vrfs→10, 09-mlag→11
- Update .infrahub.yml with new 11-file load order
Load order: foundation → fabric → devices → interfaces (Lo/Lag/Eth)
→ ipam (Lo/Eth) → vlans-vxlan → interface-vlans → ipam-vlans
→ bgp → vrfs → mlag
2026-02-15 16:04:42 +01:00
Damien
50cdb911a4
fix(objects): reorder interfaces — LAG before Ethernet — refs #52
...
InfraInterfaceEthernet references InfraInterfaceLag (lag field),
so LAG interfaces must be created first within the same file.
New order: Loopback → Lag → Ethernet → Vlan SVI
2026-02-15 16:01:45 +01:00
Damien
30885b5a19
fix(objects): wrap all relation references as HFID lists — refs #52
...
All relation values now use the HFID list-of-strings format required
by infrahubctl:
- Cardinality one: device: ["spine1"], platform: ["arista_eos"]
- Cardinality many: devices: - ["leaf1"], networks: - ["10.0.250.1/32"]
- Composite HFIDs unchanged: peer_group: ["10.0.250.1", "evpn"]
Files modified: 02-fabric, 03-devices, 04-interfaces, 06-vlans-vxlan,
07-bgp, 08-vrfs, 09-mlag (05-ipam already correct).
2026-02-15 15:37:20 +01:00
Damien
77b39027a3
fix(objects): list object files explicitly for sequential loading — refs #52
2026-02-15 15:20:45 +01:00
Damien
5f071e5716
fix(objects): split foundation/fabric and renumber files for load order — refs #52
2026-02-15 15:18:40 +01:00
Damien
3838169ff7
fix(objects): remove AS 64999, rename fabric to evpn-lab, simplify .infrahub.yml — refs #52
2026-02-15 15:03:47 +01:00
Damien
14ebedadcb
feat(objects): declare object files in .infrahub.yml — refs #52
2026-02-15 12:03:10 +01:00
Damien
825c5e4451
feat(objects): add 4 MLAG domains, 8 peer configs — refs #52
2026-02-15 12:03:07 +01:00
Damien
4a13a6a33d
feat(objects): add VRF gold, route targets, device assignments — refs #52
2026-02-15 12:03:04 +01:00
Damien
17ff22f497
feat(objects): add BGP config, peer groups, 74 sessions, address families — refs #52
2026-02-15 12:03:00 +01:00
Damien
89f77b764e
feat(objects): add VLANs, VNIs, VTEPs, mappings, EVPN instances — refs #52
2026-02-15 12:02:57 +01:00
Damien
537df72f85
feat(objects): add IP addresses (72 assignments: loopbacks, P2P, MLAG, VRF) — refs #52
2026-02-15 12:02:53 +01:00
Damien
dc382bf6de
feat(objects): add interfaces (loopback, ethernet, LAG, VLAN SVIs) — refs #52
2026-02-15 12:02:50 +01:00
Damien
d3275d1ecc
feat(objects): add 10 devices (2 spines, 8 leafs) — refs #52
2026-02-15 12:02:46 +01:00
Damien
009b6ebc75
feat(objects): add foundation objects (fabric, platform, site, ASNs) — refs #52
2026-02-15 12:02:40 +01:00
5a335b37e6
docs: update CLAUDE.md for issue #52 object files task — refs #52
2026-02-13 19:47:57 +00:00
7fd83b8c3f
Merge pull request '[Phase 2] Define Infrahub Schema for EVPN-VXLAN Fabric' ( #51 ) from feature/41-infrahub-schema into main
...
Reviewed-on: #51
2026-02-13 19:36:26 +00:00
f484af442a
docs(schema): update README with complete relationships and topology mapping — refs #41
2026-02-13 14:20:02 +00:00
Damien
e32da46bd7
fix(schema): add optional VRF relation on BGPSession — refs #50
2026-02-13 15:03:55 +01:00
Damien
4e2f5b5b0c
Update CLAUDE.md
2026-02-13 15:02:55 +01:00
Damien
cf05a5d477
fix(schema): add trunk_groups and stp_enabled on InfraVLAN — refs #49
2026-02-13 11:25:29 +01:00
Damien
f623d12b8c
fix(schema): remove redundant Device.router_id, add BGP distance attributes — refs #48
2026-02-13 11:24:49 +01:00
Damien
e527534820
fix(schema): refactor UnderlayLink IPs from attributes to InfraIPAddress relations — refs #47
2026-02-13 11:24:17 +01:00
Damien
ed820f3380
fix(schema): add virtual_router_address and autostate on InterfaceVlan — refs #46
2026-02-13 11:23:29 +01:00
Damien
82af2daafc
fix(schema): add unique constraint on InfraVLAN.vlan_id for human_friendly_id — refs #45
2026-02-13 11:23:02 +01:00
Damien
719ecfafaa
fix(schema): remove duplicate InterfaceVxlan, keep VTEP only — refs #44
2026-02-13 11:22:43 +01:00
Damien
3654c2de9d
fix(schema): scope BGPPeerGroup and BGPSession human_friendly_id per device — refs #43
2026-02-13 11:21:51 +01:00
Damien
f69bba2bf1
Create CLAUDE.md
2026-02-12 11:19:23 +01:00
aa9d0093fe
fix(menu): rename VRF/MLAG namespaces to match Infrahub regex
...
Infrahub namespaces must match ^[A-Z][a-z0-9]+$
- VRF → Vrf
- MLAG → Mlag
2026-02-09 13:29:11 +00:00
d05c96915f
feat(schema): add include_in_menu: false to all extension nodes #41
2026-02-09 12:05:11 +00:00
e31846b057
feat(schema): add include_in_menu: false to all MLAG nodes #41
2026-02-09 12:04:46 +00:00
741132a176
feat(schema): add include_in_menu: false to all VRF nodes #41
2026-02-09 12:04:21 +00:00
a05e997742
feat(schema): add include_in_menu: false to all VLAN/VXLAN nodes #41
2026-02-09 12:04:04 +00:00
ffa1eff19a
feat(schema): add include_in_menu: false to all BGP nodes #41
2026-02-09 12:03:38 +00:00
69f003b798
feat(schema): add include_in_menu: false to all base nodes #41
...
Menu is now controlled by custom menus/fabric-menu.yml
2026-02-09 12:03:09 +00:00