Skip to content

Commit b389658

Browse files
authored
Fix modules and linecards (#56)
1 parent 813c50f commit b389658

File tree

2 files changed

+30
-21
lines changed

2 files changed

+30
-21
lines changed

experimental/modules_linecards/linecard.yml

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ version: "1.0"
66
nodes:
77
- name: LinecardType
88
namespace: Device
9+
menu_placement: DeviceLinecard
910
description: "Linecard Type information, detailing specifications such as part number and manufacturer."
11+
icon: mdi:poll
1012
label: "Linecard Type"
1113
inherit_from:
1214
- DeviceGenericModuleType
@@ -22,20 +24,9 @@ nodes:
2224
description: "A Linecard installed in a device, specifying slot, power status, and functionalities."
2325
label: "Linecard"
2426
icon: "bi:pci-card"
27+
menu_placement: DeviceGenericModule
2528
inherit_from:
2629
- DeviceGenericModule
27-
uniqueness_constraints:
28-
- ["serial_number__value"]
29-
# # Only one Linecard per Device Slot
30-
# - ["device", "slot__value"]
31-
human_friendly_id:
32-
- device__name__value
33-
- slot__value
34-
order_by:
35-
- device__name__value
36-
- slot__value
37-
display_labels:
38-
- serial_number__value
3930
attributes:
4031
- name: slot
4132
kind: Number
@@ -70,18 +61,23 @@ nodes:
7061
namespace: Device
7162
description: "Physical Interface Card (PIC) installed in the Linecard, containing multiple ports."
7263
label: "PIC"
64+
menu_placement: DeviceLinecard
65+
icon: mdi:memory
7366
uniqueness_constraints:
7467
# Only one PIC per slot within a Linecard
7568
- ["linecard", "slot__value"]
7669
human_friendly_id:
77-
- linecard__serial_number__value
78-
- slot__value
70+
- serial_number__value
7971
display_labels:
80-
- slot__value
72+
- serial_number__value
8173
order_by:
8274
- linecard__serial_number__value
83-
- slot__value
8475
attributes:
76+
- name: serial_number
77+
kind: Text
78+
unique: true
79+
description: "Unique serial number of the PIC."
80+
order_weight: 1000
8581
- name: slot
8682
kind: Number
8783
description: "Slot number of the PIC within the Linecard"
@@ -97,7 +93,7 @@ nodes:
9793
order_weight: 1000
9894
- name: ports
9995
label: Ports
100-
peer: InfraPort
96+
peer: DevicePort
10197
optional: true
10298
cardinality: many
10399
kind: Component
@@ -108,16 +104,18 @@ nodes:
108104
namespace: Device
109105
description: "A network port on a PIC, specifying speed and port number."
110106
label: "Port"
107+
menu_placement: DeviceLinecard
108+
109+
icon: mdi:ethernet
111110
uniqueness_constraints:
112111
- ["pic", "port_number__value"] # Each port must be unique within a PIC
113112
human_friendly_id:
114-
- pic__slot__value
113+
- pic__serial_number__value
115114
- port_number__value
116115
display_labels:
117116
- port_number__value
118117
order_by:
119-
- pic__slot__value
120-
- port_number__value
118+
- pic__serial_number__value
121119
attributes:
122120
- name: port_number
123121
kind: Number

extensions/modules/modules.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ generics:
88
namespace: Device
99
description: "A generic module, such as a Linecard or Routing Engine, installed in a device."
1010
label: "Module"
11+
icon: mdi:expansion-card
12+
human_friendly_id:
13+
- serial_number__value
14+
display_labels:
15+
- serial_number__value
16+
order_by:
17+
- serial_number__value
1118
attributes:
1219
- name: serial_number
1320
kind: Text
@@ -64,8 +71,11 @@ generics:
6471
namespace: Device
6572
description: "A generic module type, with common specifications like part number and manufacturer."
6673
label: "Module Type"
74+
icon: mdi:database-cog
75+
menu_placement: DeviceGenericModule
76+
display_labels:
77+
- name__value
6778
uniqueness_constraints:
68-
- ["part_number__value"]
6979
- ["name__value", "manufacturer"]
7080
human_friendly_id:
7181
- name__value
@@ -87,6 +97,7 @@ generics:
8797
label: Part Number
8898
kind: Text
8999
optional: true
100+
unique: true
90101
description: "Part number of the module."
91102
order_weight: 1200
92103
relationships:

0 commit comments

Comments
 (0)