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
This commit is contained in:
Damien
2026-02-15 21:31:03 +01:00
parent 4b1ca7b2a6
commit cb06068347
3 changed files with 215 additions and 86 deletions

View File

@@ -106,11 +106,14 @@ nodes:
icon: mdi--account-group
include_in_menu: false
uniqueness_constraints:
- ["bgp_config", "name__value"]
- ["local_identifier__value"]
human_friendly_id:
- name__value
- local_identifier__value
display_label: "{{ name__value }}"
attributes:
- name: local_identifier
kind: Text
description: "Unique identifier combining device name and peer group name (e.g. spine1__evpn)"
- name: name
kind: Text
description: Peer group name (e.g., underlay, evpn)
@@ -181,11 +184,14 @@ nodes:
icon: mdi--connection
include_in_menu: false
uniqueness_constraints:
- ["bgp_config", "peer_address__value"]
- ["local_identifier__value"]
human_friendly_id:
- peer_address__value
- local_identifier__value
display_label: "{{ peer_address__value }}"
attributes:
- name: local_identifier
kind: Text
description: "Unique identifier combining device name and peer address (e.g. spine1__10.0.250.11)"
- name: peer_address
kind: IPHost
description: Neighbor IP address
@@ -231,8 +237,13 @@ nodes:
label: BGP Address Family
icon: mdi--format-list-bulleted
include_in_menu: false
human_friendly_id:
- local_identifier__value
display_label: "{{ afi__value }}"
attributes:
- name: local_identifier
kind: Text
description: "Unique identifier combining device name and AFI/SAFI (e.g. spine1__ipv4_unicast)"
- name: afi
kind: Dropdown
choices: