netbox
netbox copied to clipboard
Filter by device does not work when querying for modules via API
NetBox version
v3.2.7
Python version
3.10
Steps to Reproduce
-
Create module-type (module_a)
-
Create device type with module bay (device_type_a)
-
Create multiple devices using device_type_a (device_a, device_b)
-
Add modules to the module bays of each device created (device_a + module_a, device_b + module_b)
-
Confirm modules exist via GUI and API and have a device associated with them
-
Query the API with a filter for "device=device_a" https://mynetboxinstance.com/api/dcim/modules/?device=device_a
-
Receive results for all modules in inventory, not just the one assigned to device_a (module_a & module_b)
Expected Behavior
API query should only return module_a (associated with device_a)
Observed Behavior
All modules in the database are returned (module_a & module_b)