Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,17 @@ extensions/mlag:

Not covered yet: the layer 3 overlay for MLAG interfaces (loopback, peer address ...) and surfacing MLAG interfaces on each device in the domain.
name: MLAG
extensions/module_port:
dependencies:
- base
- extensions/device_module
description: |
This schema extension adds module ports: the ports a module provides, as declared by its module type - what NetBox module-type definitions list under `interfaces`, `console-ports` and `power-ports`.

These are deliberately not DcimInterface objects. DcimInterface.device is a mandatory Parent, and Infrahub requires the relationships used in a uniqueness constraint to be mandatory, so an interface cannot hang off a module instead of a device. A DcimModulePort is a declaration parented by the module, carrying the port name, its category (interface, console, power, front, rear), the NetBox type slug, and power draw.

NOTE: port names keep NetBox's `{module}` bay-position token verbatim, because a template is not bound to a bay. Substituting it and creating the real device interfaces is a generator step once the module is installed.
name: Module Port
extensions/optical_multiplexer:
dependencies:
- base
Expand Down
1 change: 1 addition & 0 deletions docs/docs/home.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ This list provides an overview of the schemas available in this repository. Each
| **[Location Minimal](./reference/location_minimal.mdx)** | This schema extension provides a self-contained Region -> Country -> Metro -> Site hierarchy for storing location data, with the Site carrying facility, physical address, timezone and status. Its Site node is the same as the one in extensions/location_site, so the two can be loaded together. A location name is unique across every tier, so a single-country deployment should enter the hierarchy at Country, with Region as the national node, rather than repeating a country under several regions. |
| **[Location Site](./reference/location_site.mdx)** | This schema extension introduces a Site node with facility, physical address, timezone and status, for deployments that want a flat list of sites without a hierarchy. It is the same Site node as in extensions/location_minimal, which adds Region, Country and Metro tiers above it. |
| **[MLAG](./reference/mlag.mdx)** | This schema extension contains the foundations to capture Multi-Chassis Link Aggregation Groups (MLAG). It comes on top of the LAG extension. In this implementation, a MLAG interface is essentially a LAG interface but linked to a MLAG domain (instead of a device). The MLAG domain regroups devices together (usually 2) and is built over LAG interfaces used as peer-link between the devices. MLAG interfaces defined at the MLAG domain level are then spread across all devices in the domain. This is a deliberately minimal implementation of MLAG, meant to blend with models you already have. For example, in a data center fabric you might already have a LeafGroup or similar concept: have it inherit from GenericMlagDomain and add the relationships and attributes you need. Not covered yet: the layer 3 overlay for MLAG interfaces (loopback, peer address ...) and surfacing MLAG interfaces on each device in the domain. |
| **[Module Port](./reference/module_port.mdx)** | This schema extension adds module ports: the ports a module provides, as declared by its module type - what NetBox module-type definitions list under `interfaces`, `console-ports` and `power-ports`. These are deliberately not DcimInterface objects. DcimInterface.device is a mandatory Parent, and Infrahub requires the relationships used in a uniqueness constraint to be mandatory, so an interface cannot hang off a module instead of a device. A DcimModulePort is a declaration parented by the module, carrying the port name, its category (interface, console, power, front, rear), the NetBox type slug, and power draw. NOTE: port names keep NetBox's `{module}` bay-position token verbatim, because a template is not bound to a bay. Substituting it and creating the real device interfaces is a generator step once the module is installed. |
| **[Optical Multiplexer](./reference/optical_multiplexer.mdx)** | This schema extension models optical add-drop multiplexers (OADM) and the wavelength division multiplexing (WDM) channels they carry, for both CWDM and DWDM. It adds an Optical Multiplexer device with front and rear interfaces, a WDM Channel node holding channel number, wavelength and frequency, and a WDM Transceiver flavour of the transceiver model tuned to a channel. Some vendors configure tunable optics by wavelength or frequency rather than channel number; the WDM Channel node gives you a single entry in Infrahub for all three. Not designed to be loaded together with experimental/optical_transport, which covers the same domain in more depth. |
| **[Patch Panel](./reference/patch_panel.mdx)** | This schema extension allows you to capture patch panel related information like rear and front interfaces and the mapping between them. You can insert the patch panel into a rack and leverage the device type model. Cassettes and other inserts are tracked as regular device modules in module bays, through extensions/device_module. The front and rear interfaces accept all sorts of connectors, so you can plug cables, circuits and cross-connects into them. |
| **[Physical Disk](./reference/physical_disk.mdx)** | Simple schema allowing you to capture physical disk information for inventory and lifecycle management. This extension works with any kind of device: apply the DcimDeviceWithPhysicalDisks generic to a model to enable disk tracking. You might also link disks to a location, for instance to capture spares. |
Expand Down
22 changes: 17 additions & 5 deletions docs/docs/reference/device_module.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ It ships a ready-to-use Module and Module Type pair, plus the generic Module and
| ---- | ----------- | ---- | -------- | ------------- | ------- |
| computed_name | Name computed from the device and bay name. | Text | False | | |
| name | Name of the bay, e.g. 'slot 1' or 'psu 1'. | Text | False | | |
| position | Numeric position of the bay within the device (e.g. slot 1, 2, 3). | Number | True | | |
| position | Position of the bay within the device, e.g. '1', 'F3' or 'PSU-2'. | Text | True | | |
| bay_label | What the bay is for, for example 'Supervisor' or 'Line Card'. | Text | True | | |
| description | | Text | True | | |
| role | The role of the module bay, indicating the type of module it is intended to receive. | Dropdown | True | | supervisor, line_card, power_supply, fan |

Expand Down Expand Up @@ -110,6 +111,7 @@ It ships a ready-to-use Module and Module Type pair, plus the generic Module and
| name | Name of the module type. | Text | False | | |
| description | Description of the module type. | Text | True | | |
| part_number | Part number of the module. | Text | True | | |
| weight_grams | Weight of the module in grams. | Number | True | | |

#### Relationships

Expand Down Expand Up @@ -241,6 +243,12 @@ generics:
optional: true
description: Part number of the module.
order_weight: 1200
- name: weight_grams
label: Weight (g)
kind: Number
optional: true
description: Weight of the module in grams.
order_weight: 1300
relationships:
- name: manufacturer
peer: OrganizationManufacturer
Expand Down Expand Up @@ -284,12 +292,16 @@ nodes:
description: Name of the bay, e.g. 'slot 1' or 'psu 1'.
order_weight: 1000
- name: position
kind: Number
parameters:
min_value: 1
kind: Text
optional: true
description: Numeric position of the bay within the device (e.g. slot 1, 2, 3).
description: Position of the bay within the device, e.g. '1', 'F3' or 'PSU-2'.
order_weight: 1050
- name: bay_label
label: Bay Label
kind: Text
optional: true
description: What the bay is for, for example 'Supervisor' or 'Line Card'.
order_weight: 1060
- name: description
kind: Text
optional: true
Expand Down
153 changes: 153 additions & 0 deletions docs/docs/reference/module_port.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
---
title: Module Port
---

This schema extension adds module ports: the ports a module provides, as declared by its module type - what NetBox module-type definitions list under `interfaces`, `console-ports` and `power-ports`.

These are deliberately not DcimInterface objects. DcimInterface.device is a mandatory Parent, and Infrahub requires the relationships used in a uniqueness constraint to be mandatory, so an interface cannot hang off a module instead of a device. A DcimModulePort is a declaration parented by the module, carrying the port name, its category (interface, console, power, front, rear), the NetBox type slug, and power draw.

NOTE: port names keep NetBox's `{module}` bay-position token verbatim, because a template is not bound to a bay. Substituting it and creating the real device interfaces is a generator step once the module is installed.

## Details

- **Dependencies:**
- [base](dcim)
- [extensions/device_module](device_module)

## Nodes

### ModulePort

- **Label:** Module Port
- **Description:** A port provided by a module, as declared by its module type.
- **Namespace:** Dcim
- **Icon:** mdi:ethernet
- **Uniqueness Constraints:**
- module, name__value
- **Human Friendly ID:** module__computed_name__value, name__value

#### Attributes

| name | description | kind | optional | default_value | choices |
| ---- | ----------- | ---- | -------- | ------------- | ------- |
| name | Port name as declared by the module type, e.g. `Ethernet{module}/1`. | Text | False | | |
| category | Which NetBox component list this port came from. | Dropdown | | interface | interface, console, power, front, rear |
| port_type | NetBox type slug, e.g. '1000base-t', 'rj-45', 'iec-60320-c14'. | Text | True | | |
| mgmt_only | Whether the port is reserved for out-of-band management. | Boolean | | False | |
| maximum_draw | Maximum power draw, for power ports. | Number | True | | |

#### Relationships

| name | peer | optional | cardinality | kind |
| ---- | ---- | -------- | ----------- | ---- |
| module | DcimGenericModule | False | one | Parent |

## Extensions

:::note

In this context "extensions" refer to modifications or additions to the existing schema, such as adding new attributes, relationships, or other schema elements.

:::

### DcimGenericModule

#### Relationships

| name | peer | optional | cardinality | kind |
| ---- | ---- | -------- | ----------- | ---- |
| ports | DcimModulePort | True | many | Component |

## Code

```yaml
version: '1.0'
nodes:
- name: ModulePort
namespace: Dcim
label: Module Port
description: A port provided by a module, as declared by its module type.
icon: mdi:ethernet
include_in_menu: false
menu_placement: DcimGenericModule
display_label: name__value
order_by:
- module__computed_name__value
- name__value
human_friendly_id:
- module__computed_name__value
- name__value
uniqueness_constraints:
- - module
- name__value
attributes:
- name: name
kind: Text
optional: false
description: Port name as declared by the module type, e.g. `Ethernet{module}/1`.
order_weight: 1000
- name: category
kind: Dropdown
description: Which NetBox component list this port came from.
default_value: interface
order_weight: 1100
choices:
- name: interface
label: Interface
description: A network interface.
color: '#A9CCE3'
- name: console
label: Console Port
description: A console port.
color: '#E2D4C6'
- name: power
label: Power Port
description: A power inlet.
color: '#F4CCCC'
- name: front
label: Front Port
description: A front-facing pass-through port.
color: '#D2B4DE'
- name: rear
label: Rear Port
description: A rear-facing pass-through port.
color: '#B4E0DC'
- name: port_type
label: Port Type
kind: Text
optional: true
description: NetBox type slug, e.g. '1000base-t', 'rj-45', 'iec-60320-c14'.
order_weight: 1200
- name: mgmt_only
label: Management Only
kind: Boolean
default_value: false
description: Whether the port is reserved for out-of-band management.
order_weight: 1300
- name: maximum_draw
label: Maximum Draw (W)
kind: Number
optional: true
description: Maximum power draw, for power ports.
order_weight: 1400
relationships:
- name: module
peer: DcimGenericModule
identifier: module__port
optional: false
cardinality: one
kind: Parent
order_weight: 1050
extensions:
nodes:
- kind: DcimGenericModule
relationships:
- name: ports
peer: DcimModulePort
identifier: module__port
optional: true
cardinality: many
kind: Component
order_weight: 1600

```
4 changes: 3 additions & 1 deletion docs/docs/reference/modules_linecards.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ This schema extension allows you to capture Linecard related information like th

| name | description | kind | optional | default_value | choices |
| ---- | ----------- | ---- | -------- | ------------- | ------- |
| slot | The slot number where the Linecard is installed within the device | Number | | | |
| slot | The slot number where the Linecard is installed within the device | Number | True | | |
| bng_enabled | BNG activated or deactivated on the Linecard | Boolean | True | False | |

#### Relationships
Expand Down Expand Up @@ -122,11 +122,13 @@ nodes:
label: Linecard
icon: bi:pci-card
menu_placement: DcimGenericModule
generate_template: true
inherit_from:
- DcimGenericModule
attributes:
- name: slot
kind: Number
optional: true
description: The slot number where the Linecard is installed within the device
order_weight: 1050
- name: bng_enabled
Expand Down
7 changes: 7 additions & 0 deletions experimental/modules_linecards/linecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,18 @@ nodes:
label: "Linecard"
icon: "bi:pci-card"
menu_placement: DcimGenericModule
# Generates TemplateDeviceLinecard, so a NetBox module type can be
# imported as a reusable blueprint rather than as an installed card.
generate_template: true
inherit_from:
- DcimGenericModule
attributes:
- name: slot
kind: Number
# Optional: a NetBox module type describes a model, not an installed
# card, so it carries no slot. A mandatory slot makes every imported
# module type unloadable.
optional: true
description: "The slot number where the Linecard is installed within the device"
order_weight: 1050
- name: bng_enabled
Expand Down
33 changes: 29 additions & 4 deletions extensions/device_module/device_module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,18 @@ generics:
optional: true
description: "Part number of the module."
order_weight: 1200
- name: weight_grams
label: Weight (g)
kind: Number
optional: true
# Grams, not kilograms. Infrahub has no float attribute kind, so a
# weight is a whole number or nothing, and modules are exactly the
# light hardware that integer kilograms destroy: a transceiver or a
# supervisor rounds to 0 kg, which reads as data rather than as a
# missing value. Grams keep every published module weight distinct
# and sortable.
description: "Weight of the module in grams."
order_weight: 1300
relationships:
- name: manufacturer
peer: OrganizationManufacturer
Expand Down Expand Up @@ -154,12 +166,25 @@ nodes:
description: "Name of the bay, e.g. 'slot 1' or 'psu 1'."
order_weight: 1000
- name: position
kind: Number
parameters:
min_value: 1
kind: Text
optional: true
description: "Numeric position of the bay within the device (e.g. slot 1, 2, 3)."
# Text, not Number: bay positions are free-form. A DCS-7508N uses
# '1'..'10' but also 'F1'..'F6' and 'PSU-1'..'PSU-8', so a Number
# attribute would reject 14 of its 24 bays.
description: "Position of the bay within the device, e.g. '1', 'F3' or 'PSU-2'."
order_weight: 1050
- name: bay_label
label: Bay Label
kind: Text
optional: true
# NOT named `label`. Infrahub auto-populates an attribute literally
# named `label` from `name` when it is unset - and title-cases it, so
# "no label supplied" becomes indistinguishable from "the label equals
# the name". On a DCS-7508N only 10 of 24 bays carry one, so the
# distinction is worth keeping. Free text, unlike `role` below, which
# enumerates the bay's purpose.
description: "What the bay is for, for example 'Supervisor' or 'Line Card'."
order_weight: 1060
- name: description
kind: Text
optional: true
Expand Down
3 changes: 3 additions & 0 deletions extensions/module_port/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# module_port

Please refer to the [reference page](https://docs.infrahub.app/schema-library/reference/module_port) for the corresponding documentation.
Loading
Loading