Skip to content

Cache the number of each component type assigned to devices/VMs #6347

@jeremystretch

Description

@jeremystretch

Proposed Changes

Add the following integer fields to dcim.Device:

  • _console_port_count
  • _console_server_port_count
  • _power_port_count
  • _power_outlet_count
  • _interface_count
  • _front_port_count
  • _rear_port_count
  • _device_bay_count
  • _inventory_item_count

Add the following integer fields to virtualization.VirtualMachine:

  • _interface_count

These fields would be automatically populated upon creating/modifying/deleting the relevant child components.

Justification

  • Enables efficient filters of devices/VMs based on whether a certain type of component has been created.
  • Eliminates the need for additional queries e.g. when display the device view.

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the application

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions