Skip to content

If 2 different node schemas are created for Virtual vs Physical devices should we do the same for DeviceTypes? #23

@ryanmerolle

Description

@ryanmerolle

Discussion

If 2 different node schemas are created for Virtual vs Physical devices should we do the same for DeviceTypes?

I think some consistency should be applied across the schema. Either separate out models for each physical and virtual or consolidate them with an attribute to track whether physical or virtual.

Why Does this matter

Even though both DcimVirtualDevice and DcimPhysicalDevice relate to DcimDeviceType, if you want to show a list of associated devices in DcimDeviceType and you add the following to the node, nothing populates:

      - name: devices
        peer: DcimGenericDevice
        optional: true
        cardinality: many
        order_weight: 1350

If the DcimGenericDevice had the relationship and not the descendants, then this would have worked. Instead I would have to add the following to the node relationship:

      - name: devices
        peer: DcimVirtualDevice
        optional: true
        cardinality: many
        order_weight: 1350
      - name: devices
        peer: DcimPhysicalDevice
        optional: true
        cardinality: many
        order_weight: 1350

The above complains of Unable to merge the list for attributes, not all items are supporting _sorting_id. I get what it means, but I am unclear how to resolve this schema issue.

The last option is to:

      - name: virtual_devices
        peer: DcimVirtualDevice
        optional: true
        cardinality: many
        order_weight: 1350
      - name: physical_devices
        peer: DcimPhysicalDevice
        optional: true
        cardinality: many
        order_weight: 1350

This can work, but technically I do not think a devicetype should have both virtual and physical devices related to it, ie this is a modeling a useless relationship depending on the devicetype object.

Metadata

Metadata

Assignees

No one assigned

    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