Skip to content

Error on Example Module Linecard #55

@3DSFreaker

Description

@3DSFreaker

Hello there seems to be an error on the Module Linecard Nodes.

using the Documentation: https://docs.infrahub.app/schema-library/reference/modules_linecards
loading the schema throws the following error: Unable to find the schema 'InfraPort' in the registry

I've changed the relationship from PIC from:

- name: ports
    label: Ports
    peer: InfraPort
    optional: true
    cardinality: many
    kind: Component
    order_weight: 1100

to

 - name: ports
    label: Ports
    peer: DevicePort
    optional: true
    cardinality: many
    kind: Component
    order_weight: 1100`

But what i now dont understand is the error which follows after fixing this:
DeviceLinecard.order_by: name is not a valid attribute of DcimPhysicalDevice

Of my understanding the Linecard inherits the device name from the GenericModule.

There might be some mistake im not aware of.
NodeModules.yml

version: '1.0'
nodes:
- name: LinecardType
  namespace: Device
  description: Linecard Type information, detailing specifications such as part number
    and manufacturer.
  label: Linecard Type
  inherit_from:
  - DeviceGenericModuleType
  relationships:
  - name: linecards
    peer: DeviceLinecard
    cardinality: many
    kind: Generic
    description: Linecards of this type.

- name: Linecard
  namespace: Device
  description: A Linecard installed in a device, specifying slot, power status, and
    functionalities.
  label: Linecard
  icon: bi:pci-card
  inherit_from:
  - DeviceGenericModule
  uniqueness_constraints:
  - - serial_number__value
  - - linecard_slot__value
  human_friendly_id:
  - device__name__value
  - slot__value
  order_by:
  - device__name__value
  - slot__value
  display_labels:
  - serial_number__value
  attributes:
  - name: slot
    kind: Number
    description: The slot number where the Linecard is installed within the device
    order_weight: 1050
  relationships:
  - name: linecard_type
    label: Linecard Type
    peer: DeviceLinecardType
    optional: false
    cardinality: one
    kind: Attribute
    order_weight: 1150
  - name: pics
    label: PICs
    peer: DevicePic
    optional: true
    cardinality: many
    kind: Attribute
    order_weight: 1500

- name: Pic
  namespace: Device
  description: Physical Interface Card (PIC) installed in the Linecard, containing
    multiple ports.
  label: PIC
  uniqueness_constraints:
  - - linecard
    - slot__value
  human_friendly_id:
  - linecard__serial_number__value
  - slot__value
  display_labels:
  - slot__value
  order_by:
  - linecard__serial_number__value
  - slot__value
  attributes:
  - name: slot
    kind: Number
    description: Slot number of the PIC within the Linecard
    order_weight: 1200
  relationships:
  - name: linecard
    label: Linecard
    peer: DeviceLinecard
    identifier: linecard__pics
    optional: false
    cardinality: one
    kind: Parent
    order_weight: 1000
  - name: ports
    label: Ports
    peer: DevicePort
    optional: true
    cardinality: many
    kind: Component
    order_weight: 1100

- name: Port
  namespace: Device
  description: A network port on a PIC, specifying speed and port number.
  label: Port
  uniqueness_constraints:
  - - pic
    - port_number__value
  human_friendly_id:
  - pic__slot__value
  - port_number__value
  display_labels:
  - port_number__value
  order_by:
  - pic__slot__value
  - port_number__value
  attributes:
  - name: port_number
    kind: Number
    description: Port number on the PIC
    order_weight: 1100
  - name: speed
    kind: Dropdown
    description: Speed of the port
    choices:
    - name: 1g
      label: 1Gbps
      description: 1 Gigabit per second
      color: '#ff8c55'
    - name: 10g
      label: 10Gbps
      description: 10 Gigabit per second
      color: '#ff582d'
    - name: 25g
      label: 25Gbps
      description: 25 Gigabit per second
      color: '#fc490c'
    - name: 40g
      label: 40Gbps
      description: 40 Gigabit per second
      color: '#fc490c'
    - name: 100g
      label: 100Gbps
      description: 100 Gigabit per second
      color: '#fc490c'
    order_weight: 1200
  relationships:
  - name: pic
    label: PIC
    peer: DevicePic
    optional: false
    cardinality: one
    kind: Parent
    order_weight: 1000




- name: RoutingEngineType
  namespace: Device
  description: Routing Engine Type information, detailing specifications such as part
    number and manufacturer.
  label: Routing Engine Type
  inherit_from:
  - DeviceGenericModuleType
  relationships:
  - name: routing_engines
    peer: DeviceRoutingEngine
    cardinality: many
    kind: Generic
    description: Routing engines of this type.
- name: RoutingEngine
  namespace: Device
  description: A Routing Engine (RE) installed in a device, responsible for routing
    functionalities.
  label: Routing Engine
  icon: mdi:cpu-64-bit
  inherit_from:
  - DeviceGenericModule
  uniqueness_constraints:
  - - serial_number__value
  human_friendly_id:
  - device__name__value
  - slot__value
  order_by:
  - device__name__value
  - slot__value
  display_labels:
  - serial_number__value
  attributes:
  - name: slot
    kind: Number
    description: The slot number where the Routing Engine is installed within the
      device
    order_weight: 1100
  - name: version
    kind: Text
    label: Version
    description: Firmware version of the Routing Engine.
    optional: true
    order_weight: 1200
  relationships:
  - name: routing_engine_type
    label: RE Type
    peer: DeviceRoutingEngineType
    optional: false
    cardinality: one
    kind: Attribute
    order_weight: 1150

Generic.yml

version: '1.0'
generics:
- name: Generic
  namespace: Location
  description: Generic Location, could be a country, city ...
  include_in_menu: false
  label: Location
  icon: mingcute:location-line
  hierarchical: true
  human_friendly_id:
  - shortname__value
  order_by:
  - name__value
  display_labels:
  - name__value
  attributes:
  - name: name
    kind: Text
    order_weight: 1000
  - name: shortname
    kind: Text
    unique: true
    order_weight: 1100
  - name: description
    kind: Text
    optional: true
    order_weight: 1200

- name: GenericDevice
  include_in_menu: false
  namespace: Dcim
  description: Generic Device object.
  include_in_menu: false
  label: Device
  icon: mdi:server
  human_friendly_id:
  - name__value
  order_by:
  - name__value
  display_labels:
  - name__value
  attributes:
  - name: name
    kind: Text
    unique: true
    order_weight: 1000
  - name: description
    kind: Text
    optional: true
    order_weight: 2000

- name: PhysicalDevice
  namespace: Dcim
  description: Generic holding attributes and relationships relevant for physical
    device.
  include_in_menu: false
  attributes:
  - name: position
    label: Position (U)
    description: Lowest unit.
    kind: Number
    optional: true
    order_weight: 1500
  - name: serial
    kind: Text
    optional: true
    order_weight: 1500
  - name: rack_face
    label: Rack Face
    description: On which face of the rack the device is mounted.
    kind: Dropdown
    optional: false
    default_value: front
    order_weight: 1515
    choices:
    - name: front
      label: Front
      description: Device mounted on the front face of the rack.
    - name: rear
      label: Rear
      description: Device mounted on the rear face of the rack.
    default_value: front
  relationships:
    - name: device_type
      peer: DcimDeviceType
      optional: true
      cardinality: one
      kind: Attribute
      order_weight: 1200

- name: Generic
  namespace: Organization
  label: Organization
  description: An organization represent a legal entity, a company.
  include_in_menu: false
  human_friendly_id:
  - name__value
  order_by:
  - name__value
  display_labels:
  - name__value
  icon: mdi:domain
  attributes:
  - name: name
    kind: Text
    unique: true
    order_weight: 1000
  - name: description
    kind: Text
    optional: true
    order_weight: 1200

- name: GenericModule
  namespace: Device
  description: A generic module, such as a Linecard or Routing Engine, installed in
    a device.
  label: Module
  include_in_menu: false
  attributes:
  - name: serial_number
    kind: Text
    unique: true
    description: Unique serial number of the module.
    order_weight: 1000
  - name: description
    kind: Text
    optional: true
    order_weight: 1100
  - name: status
    kind: Dropdown
    choices:
    - name: aktiv
      label: aktiv
      description: Linecard ist Aktiv
      color: '#7fbf7f'
    - name: provisionierung
      label: Provisionierung
      description: Linecard ist vorgesehen
      color: '#ffff7f'
    - name: maintenance
      label: Maintenance
      description: Linecard ist in Wartung
      color: '#ffd27f'
    - name: rueckbau
      label: Rueckbau
      description: Linecard soll zurueckgebaut werden
      color: '#bfbfbf'
    - name: ausbau_geplant
      label: Ausbau geplant
      description: Linecard soll ausgebaut werden.
      color: '#e04c4c'
    - name: ausgeschaltet
      label: Ausgeschaltet
      description: Linecard ist ausgeschaltet.
      color: '#808080'
    - name: ausfall
      label: Ausfall
      description: Linecard ist ausgefallen.
      color: '#e82020'
    default_value: provisionierung
    order_weight: 1300
  relationships:
  - name: module_type
    peer: DeviceGenericModuleType
    optional: false
    cardinality: one
    kind: Attribute
    order_weight: 1150
  - name: device
    label: Device
    peer: DcimPhysicalDevice
    identifier: device__modules
    optional: true
    cardinality: one
    kind: Attribute
    order_weight: 1000


- name: GenericModuleType
  namespace: Device
  description: A generic module type, with common specifications like part number
    and manufacturer.
  include_in_menu: false
  label: Module Type
  uniqueness_constraints:
  - - part_number__value
  - - name__value
    - manufacturer
  human_friendly_id:
  - name__value
  order_by:
  - manufacturer__name__value
  - name__value
  attributes:
  - name: name
    kind: Text
    unique: true
    description: Name of the module type.
    order_weight: 1000
  - name: description
    kind: Text
    optional: true
    description: Description of the module type.
    order_weight: 1100
  - name: part_number
    label: Part Number
    kind: Text
    optional: true
    description: Part number of the module.
    order_weight: 1200
  - name: clei_number
    label: Clei Number
    kind: Text
    optional: true
    description: Part number of the module.
    order_weight: 1200
  - name: sap_number
    label: SAP Number
    kind: Text
    optional: false
    description: Part number of the module.
    order_weight: 1200
  relationships:
  - name: manufacturer
    peer: OrganizationManufacturer
    identifier: manufacturer__moduletype
    cardinality: one
    optional: false
    kind: Attribute
    description: Manufacturer of the module type.
    order_weight: 1250
extensions:
  nodes:
  - kind: DcimPhysicalDevice
    relationships:
    - name: modules
      peer: DeviceGenericModule
      identifier: device__modules
      cardinality: many
      kind: Component

I appreciate any help on this topic.

Regards
Fynn

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions