feat(schema): add bidirectional relationship identifiers and fabric-device links
- LocationSite: add devices (device__site) and fabrics (fabric__sites) reverse relationships - InfraDevice.site: add identifier device__site - InfraDevice: add fabric relationship (fabric__devices) - InfraFabric.sites: add identifier fabric__sites; add devices reverse relationship (fabric__devices) - InfraInterfaceVlan.vlan: add identifier vlan__svi - InfraVLAN: add svi_interfaces reverse relationship (vlan__svi) - Add 14-fabric-links.yml to assign all 10 devices to the evpn-lab fabric Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
28
infrahub/objects/14-fabric-links.yml
Normal file
28
infrahub/objects/14-fabric-links.yml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# Fabric-to-Device links
|
||||||
|
# Depends on: 02-devices, 03-fabric
|
||||||
|
---
|
||||||
|
apiVersion: infrahub.app/v1
|
||||||
|
kind: Object
|
||||||
|
spec:
|
||||||
|
kind: InfraDevice
|
||||||
|
data:
|
||||||
|
- name: spine1
|
||||||
|
fabric: "evpn-lab"
|
||||||
|
- name: spine2
|
||||||
|
fabric: "evpn-lab"
|
||||||
|
- name: leaf1
|
||||||
|
fabric: "evpn-lab"
|
||||||
|
- name: leaf2
|
||||||
|
fabric: "evpn-lab"
|
||||||
|
- name: leaf3
|
||||||
|
fabric: "evpn-lab"
|
||||||
|
- name: leaf4
|
||||||
|
fabric: "evpn-lab"
|
||||||
|
- name: leaf5
|
||||||
|
fabric: "evpn-lab"
|
||||||
|
- name: leaf6
|
||||||
|
fabric: "evpn-lab"
|
||||||
|
- name: leaf7
|
||||||
|
fabric: "evpn-lab"
|
||||||
|
- name: leaf8
|
||||||
|
fabric: "evpn-lab"
|
||||||
@@ -62,6 +62,19 @@ nodes:
|
|||||||
kind: Text
|
kind: Text
|
||||||
optional: true
|
optional: true
|
||||||
description: Facility identifier or code
|
description: Facility identifier or code
|
||||||
|
relationships:
|
||||||
|
- name: devices
|
||||||
|
peer: InfraDevice
|
||||||
|
identifier: device__site
|
||||||
|
cardinality: many
|
||||||
|
kind: Generic
|
||||||
|
description: Devices at this site
|
||||||
|
- name: fabrics
|
||||||
|
peer: InfraFabric
|
||||||
|
identifier: fabric__sites
|
||||||
|
cardinality: many
|
||||||
|
kind: Generic
|
||||||
|
description: Fabrics deployed at this site
|
||||||
|
|
||||||
# ================================================================
|
# ================================================================
|
||||||
# Platform
|
# Platform
|
||||||
@@ -145,6 +158,7 @@ nodes:
|
|||||||
relationships:
|
relationships:
|
||||||
- name: site
|
- name: site
|
||||||
peer: LocationSite
|
peer: LocationSite
|
||||||
|
identifier: device__site
|
||||||
cardinality: one
|
cardinality: one
|
||||||
optional: true
|
optional: true
|
||||||
- name: platform
|
- name: platform
|
||||||
@@ -164,6 +178,12 @@ nodes:
|
|||||||
peer: InfraMlagDomain
|
peer: InfraMlagDomain
|
||||||
cardinality: one
|
cardinality: one
|
||||||
optional: true
|
optional: true
|
||||||
|
- name: fabric
|
||||||
|
peer: InfraFabric
|
||||||
|
identifier: fabric__devices
|
||||||
|
cardinality: one
|
||||||
|
optional: true
|
||||||
|
description: Fabric this device belongs to
|
||||||
|
|
||||||
# ================================================================
|
# ================================================================
|
||||||
# Interface Types (inherit from InfraInterface generic)
|
# Interface Types (inherit from InfraInterface generic)
|
||||||
@@ -263,6 +283,7 @@ nodes:
|
|||||||
relationships:
|
relationships:
|
||||||
- name: vlan
|
- name: vlan
|
||||||
peer: InfraVLAN
|
peer: InfraVLAN
|
||||||
|
identifier: vlan__svi
|
||||||
cardinality: one
|
cardinality: one
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
|
|||||||
@@ -55,8 +55,15 @@ nodes:
|
|||||||
description: AS used by spine layer
|
description: AS used by spine layer
|
||||||
- name: sites
|
- name: sites
|
||||||
peer: LocationSite
|
peer: LocationSite
|
||||||
|
identifier: fabric__sites
|
||||||
cardinality: many
|
cardinality: many
|
||||||
optional: true
|
optional: true
|
||||||
|
- name: devices
|
||||||
|
peer: InfraDevice
|
||||||
|
identifier: fabric__devices
|
||||||
|
cardinality: many
|
||||||
|
kind: Generic
|
||||||
|
description: Devices in this fabric
|
||||||
|
|
||||||
# ================================================================
|
# ================================================================
|
||||||
# Underlay P2P Link
|
# Underlay P2P Link
|
||||||
|
|||||||
@@ -70,6 +70,12 @@ nodes:
|
|||||||
peer: LocationSite
|
peer: LocationSite
|
||||||
cardinality: one
|
cardinality: one
|
||||||
optional: true
|
optional: true
|
||||||
|
- name: svi_interfaces
|
||||||
|
peer: InfraInterfaceVlan
|
||||||
|
identifier: vlan__svi
|
||||||
|
cardinality: many
|
||||||
|
kind: Generic
|
||||||
|
description: SVI interfaces for this VLAN
|
||||||
|
|
||||||
# ================================================================
|
# ================================================================
|
||||||
# VNI (VXLAN Network Identifier)
|
# VNI (VXLAN Network Identifier)
|
||||||
|
|||||||
Reference in New Issue
Block a user