Skip to content

Commit 1b56f03

Browse files
authored
Adjust relationship so we can delete device (#6496)
1 parent 7e82159 commit 1b56f03

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

models/base/dcim.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,12 @@ nodes:
258258
optional: true
259259
cardinality: many
260260
kind: Component
261+
- name: bgp_sessions
262+
peer: InfraBGPSession
263+
identifier: device__bgp_session
264+
optional: true
265+
cardinality: many
266+
kind: Component
261267
- name: asn
262268
peer: InfraAutonomousSystem
263269
optional: true
@@ -608,7 +614,7 @@ nodes:
608614
cardinality: many
609615
peer: InfraDevice
610616
kind: Attribute
611-
optional: false
617+
optional: true
612618
- name: peer_interfaces
613619
cardinality: many
614620
peer: InfraLagInterfaceL2

models/base/routing.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
22
---
3-
version: '1.0'
3+
version: "1.0"
44
nodes:
55
# -------------------- BGP (ASN, BGP Groups, BGP Sessions) --------------------
66
- name: AutonomousSystem
@@ -82,7 +82,10 @@ nodes:
8282
icon: "mdi:router"
8383
inherit_from:
8484
- "CoreArtifactTarget"
85-
human_friendly_id: ["remote_as__asn__value", "remote_ip__address__value", "device__name__value"]
85+
human_friendly_id:
86+
- remote_as__asn__value
87+
- remote_ip__address__value
88+
- device__name__value
8689
order_by:
8790
- device__name__value
8891
- remote_as__asn__value
@@ -170,6 +173,8 @@ nodes:
170173
- name: device
171174
peer: InfraDevice
172175
optional: false
176+
identifier: device__bgp_session
177+
kind: Parent
173178
cardinality: one
174179
- name: peer_group
175180
peer: InfraBGPPeerGroup

0 commit comments

Comments
 (0)