diff --git a/base/dcim.yml b/base/dcim.yml index d045419..5e48029 100644 --- a/base/dcim.yml +++ b/base/dcim.yml @@ -97,75 +97,209 @@ generics: kind: Attribute order_weight: 1500 + - name: Endpoint + namespace: Dcim + description: Generic Endpoint to receive a connector. + include_in_menu: false + relationships: + - name: connector + peer: DcimConnector + optional: true + cardinality: one + order_weight: 1500 + kind: Attribute + + - name: Connector + namespace: Dcim + description: Generic Connector to link two endpoints together. + include_in_menu: false + relationships: + - name: connected_endpoints + peer: DcimEndpoint + optional: true + cardinality: many + order_weight: 1500 + kind: Generic + + # Interfaces - name: Interface namespace: Dcim - description: Generic Network Interface. - label: Interface - icon: mdi:ethernet - menu_placement: DcimGenericDevice - include_in_menu: true + description: "Generic Network Interface" + label: "Interface" + include_in_menu: false display_labels: - name__value order_by: - device__name__value - name__value uniqueness_constraints: - - [device, name__value] + - ["device", "name__value"] + human_friendly_id: + - "device__name__value" + - "name__value" attributes: - name: name kind: Text + description: "Name of the interface" order_weight: 1000 - name: description kind: Text optional: true + description: "A brief description of the interface" order_weight: 1100 - - name: speed - kind: Number - order_weight: 1400 - name: mtu label: MTU - default_value: 1500 kind: Number - order_weight: 1500 - - name: enabled - kind: Boolean - default_value: true + default_value: 1514 + order_weight: 1300 + - name: status + kind: Dropdown + description: "The status of the interface" + choices: + - name: provisioning + label: Provisioning + description: "Interface is being provisioned." + color: "#A9DFBF" # light pastel green + - name: free + label: Free + description: "Interface is unused." + color: "#CDEACC" # slightly darker pastel green + - name: active + label: Active + description: "Interface is active and operational." + color: "#A9CCE3" # pastel blue + - name: maintenance + label: Maintenance + description: "Interface is under maintenance." + color: "#FFF2CC" # pastel yellow + - name: disabled + label: Disabled + description: "Interface has been disabled." + color: "#D3D3D3" # light grey + - name: deleted + label: Deleted + description: "Interface has been deleted." + color: "#FAD7A0" # pastel orange + - name: outage + label: Outage + description: "Interface is currently experiencing an outage." + color: "#F4CCCC" # pastel red + default_value: "active" order_weight: 1200 + - name: role + kind: Dropdown + optional: true + description: "The role of the interface in the network" + choices: + - name: lag + label: Lag + description: "Interface LAG." + color: "#A9DFBF" # light pastel green + - name: core + label: Core Interface + description: "Central part of the network." + color: "#A9CCE3" # pastel blue + - name: cust + label: Customer Interface + description: "Interface dedicated to customer connections." + color: "#D2B4DE" # pastel purple + - name: access + label: Access Interfaces + description: "Interface connecting endpoint devices." + color: "#B4E0DC" # pastel teal + - name: management + label: Management Interface + description: "Interface dedicated to device management." + color: "#E3DAC9" # pastel cream + - name: peering + label: Peering Interface + description: "Interface dedicated to peering with other networks." + color: "#C4B7E6" # pastel purple + - name: upstream + label: Upstream Interface + description: "Interface dedicated to upstream traffic between networks." + color: "#B2D4E6" # pastel sky blue + order_weight: 1250 relationships: - name: device peer: DcimGenericDevice + identifier: "device__interface" optional: false cardinality: one kind: Parent + order_weight: 1025 - name: tags peer: BuiltinTag optional: true cardinality: many kind: Attribute + order_weight: 3000 - - name: Endpoint - namespace: Dcim - description: Generic Endpoint to receive a connector. + - name: Layer2 + namespace: Interface include_in_menu: false - relationships: - - name: connector - peer: DcimConnector + description: "Layer 2 specific attributes for network interfaces" + label: "Layer 2 Interface" + attributes: + - name: l2_mode + label: Layer2 Mode + kind: Dropdown optional: true - cardinality: one + choices: + - name: access + label: Access + description: "Access mode" + - name: trunk + label: Trunk + description: "Trunk mode" + - name: trunk_all + label: Trunk (All) + description: "Trunk all mode" + description: "Layer 2 mode of the interface" order_weight: 1500 + + - name: Layer3 + namespace: Interface + include_in_menu: false + description: "Layer 3 specific attributes for network interfaces" + label: "Layer 3 Interface" + attributes: + - name: dot1q_id + label: VLAN ID (dot1q) + kind: Number + description: "Dot1Q VLAN ID" + order_weight: 1600 + optional: true + - name: mac_address + label: Mac Address + kind: Text + optional: true + order_weight: 1550 + relationships: + - name: ip_addresses + label: IP Addresses + peer: IpamIPAddress + cardinality: many kind: Attribute + optional: true + description: "List of IP addresses associated with the interface" + order_weight: 1150 - - name: Connector - namespace: Dcim - description: Generic Connector to link two endpoints together. + - name: HasSubInterface + namespace: Interface + description: A generic interface that can have sub-interfaces include_in_menu: false relationships: - - name: connected_endpoints - peer: DcimEndpoint + - name: sub_interfaces + label: "Sub-interface(s)" + peer: InterfaceVirtual + direction: outbound + identifier: "sub__interface" optional: true cardinality: many - order_weight: 1500 - kind: Generic + kind: Attribute + description: "Sub-interfaces of this interface" + order_weight: 1750 nodes: # -------------------- Device (Types, Platforms, Device, Interfaces ) -------------------- @@ -348,178 +482,92 @@ nodes: description: Tor switch part of a Fabric. color: "#e8e7fd" - - name: InterfaceL3 - namespace: Dcim - description: Network Layer 3 Interface - label: Interface L3 - icon: mdi:ethernet - menu_placement: DcimInterface - display_labels: - - name__value - order_by: - - name__value + - name: Physical + namespace: Interface + label: Physical Interface + description: "Physical network port on a device" inherit_from: - DcimInterface + - InterfaceLayer2 + - InterfaceLayer3 - DcimEndpoint - attributes: - - name: role - kind: Dropdown - optional: true - choices: - - name: backbone - label: Backbone - description: Provide main data routes. - color: "#6a5acd" - - name: upstream - label: upstream - description: Connect to Internet service provider. - color: "#9090de" - - name: peering - label: Peering - description: Connect with other networks via IX. - color: "#ffa07a" - - name: peer - label: Peer - description: Equal-status connections for direct interchange. - color: "#faa446" - - name: server - label: Server - description: Dedicated to interfaces connected to servers. - color: "#98b2d1" - - name: loopback - label: Loopback - description: Internal interface. - color: "#93e9be" - - name: management - label: Management - description: Dedicated network for control and monitoring. - color: "#ccc28a" - - name: uplink - label: Uplink - description: Connect to higher device. - color: "#ff6b6b" - - name: leaf - label: Leaf - description: Connect to leaf device. - color: "#e6e6fa" - - name: spare - label: Spare - description: Reserve resources for future use. - color: "#d3d3d3" - order_weight: 1700 - - name: status - kind: Dropdown - optional: true - order_weight: 1300 - choices: - - name: active - label: Active - description: Fully operational and currently in service. - color: "#7fbf7f" - - name: provisioning - label: Provisioning - description: In the process of being set up and configured. - color: "#ffff7f" - - name: maintenance - label: Maintenance - description: Undergoing routine maintenance or repairs. - color: "#ffd27f" - - name: drained - label: Drained - description: Temporarily taken out of service. - color: "#bfbfbf" + - InterfaceHasSubInterface + include_in_menu: false relationships: - - name: ip_addresses - peer: IpamIPAddress + - name: lag_parent + label: "LAG" + peer: InterfaceLag optional: true - cardinality: many - kind: Component + cardinality: one + kind: Attribute + description: "LAG Interface using this Physical interface" + order_weight: 1800 - - name: InterfaceL2 - namespace: Dcim - description: Network Layer 2 Interface - label: Interface L2 - icon: mdi:ethernet - menu_placement: DcimInterface - display_labels: - - name__value - order_by: - - name__value + - name: Virtual + namespace: Interface + label: Virtual Interface + description: "Virtual interface like VLAN or Loopback" inherit_from: - DcimInterface - - DcimEndpoint + - InterfaceLayer2 + - InterfaceLayer3 + # - InterfaceHasSubInterface # Depending if you want your virtual interfaces to have sub interface + include_in_menu: false + relationships: + - name: parent_interface + peer: InterfaceHasSubInterface + optional: false + cardinality: one + kind: Attribute + identifier: "sub__interface" + direction: inbound + description: "Parent interface to which this sub-interface belongs" + + - name: Lag + namespace: Interface + label: LAG Interface + description: "LAG interface" + inherit_from: + - DcimInterface + - InterfaceLayer2 + - InterfaceLayer3 + - InterfaceHasSubInterface + include_in_menu: false attributes: - - name: role + - name: lacp_rate + label: "LACP Rate" kind: Dropdown - optional: true choices: - - name: backbone - label: Backbone - description: Provide main data routes. - color: "#6a5acd" - - name: upstream - label: upstream - description: Connect to Internet service provider. - color: "#9090de" - - name: peering - label: Peering - description: Connect with other networks via IX. - color: "#ffa07a" - - name: peer - label: Peer - description: Equal-status connections for direct interchange. - color: "#faa446" - - name: server - label: Server - description: Dedicated to interfaces connected to servers. - color: "#98b2d1" - - name: loopback - label: Loopback - description: Internal interface. - color: "#93e9be" - - name: management - label: Management - description: Dedicated network for control and monitoring. - color: "#ccc28a" - - name: uplink - label: Uplink - description: Connect to higher device. - color: "#ff6b6b" - - name: leaf - label: Leaf - description: Connect to leaf device. - color: "#e6e6fa" - - name: spare - label: Spare - description: Reserve resources for future use. - color: "#d3d3d3" + - name: slow + label: Slow + color: "#E6E6FA" # lavender + - name: fast + label: Fast + color: "#E6E6FA" # lavender + default_value: fast + description: "LACP rate for the aggregated interface" order_weight: 1700 - - name: status + - name: lacp_mode + label: LACP Mode kind: Dropdown - optional: true - order_weight: 1300 choices: - name: active label: Active - description: Fully operational and currently in service. - color: "#7fbf7f" - - name: provisioning - label: Provisioning - description: In the process of being set up and configured. - color: "#ffff7f" - - name: maintenance - label: Maintenance - description: Undergoing routine maintenance or repairs. - color: "#ffd27f" - - name: drained - label: Drained - description: Temporarily taken out of service. - color: "#bfbfbf" - - name: l2_mode - label: Layer2 Mode - kind: Text - enum: - - Access - - Trunk - - Tunnel - order_weight: 1250 + color: "#E6E6FA" # lavender + - name: passive + label: Passive + color: "#E6E6FA" # lavender + - name: disabled + label: Disabled + color: "#E6E6FA" # lavender + description: "LACP mode for the aggregated interface" + default_value: active + order_weight: 1750 + relationships: + - name: lag_members + label: "Member(s)" + peer: InterfacePhysical + cardinality: many + kind: Attribute + description: "Physical Interfaces that are members of this aggregate" + order_weight: 1800 diff --git a/base/ipam.yml b/base/ipam.yml index 9f458e5..64d5796 100644 --- a/base/ipam.yml +++ b/base/ipam.yml @@ -30,7 +30,7 @@ nodes: regex: (?=^.{1,253}$)(^(((?!-)[a-zA-Z0-9-]{1,63}(?