/api/dcim/interfaces?form_factor=0 (Virtual Interface) returns 0 results #2138

Closed
opened 2025-12-29 17:22:37 +01:00 by adam · 2 comments
Owner

Originally created by @DanSheps on GitHub (Nov 22, 2018).

Environment

  • Python version: Python 3.4
  • NetBox version: 2.4.8

Steps to Reproduce

  • Create a virtual interface (form_factor=0)
  • Create a LAG interface
  • Create a Physical 10GBE Interface (form_factor=1000)
  • Run an API query against /api/dcim/interfaces?form_factor=0
    Result will be a count: 0
  • Run an API query against /api/dcim/interfaces?form_factor=200
    Result will be a count of at least 1 (depends on environment)

Expected Behavior

  • API will return virtual interfaces for form_factor=0
  • API will return LAG interfaces for form_factor=200
  • API will return 1000GBE interfaces for form_factor=1000

Observed Behavior

  • API does not return interfaces for form_factor=0
  • API returns interfaces for form_factor=200
  • API returns interfaces for form_factor=1000
Originally created by @DanSheps on GitHub (Nov 22, 2018). ### Environment * Python version: Python 3.4 * NetBox version: 2.4.8 ### Steps to Reproduce * Create a virtual interface (form_factor=0) * Create a LAG interface * Create a Physical 10GBE Interface (form_factor=1000) * Run an API query against /api/dcim/interfaces?form_factor=0 Result will be a count: 0 * Run an API query against /api/dcim/interfaces?form_factor=200 Result will be a count of at least 1 (depends on environment) <!-- What did you expect to happen? --> ### Expected Behavior * API will return virtual interfaces for form_factor=0 * API will return LAG interfaces for form_factor=200 * API will return 1000GBE interfaces for form_factor=1000 <!-- What happened instead? --> ### Observed Behavior * API does not return interfaces for form_factor=0 * API returns interfaces for form_factor=200 * API returns interfaces for form_factor=1000
adam added the type: bugstatus: accepted labels 2025-12-29 17:22:37 +01:00
adam closed this issue 2025-12-29 17:22:37 +01:00
Author
Owner

@DanSheps commented on GitHub (Nov 22, 2018):

I believe this is strictly related to form_factor=0 only, however I don't have time to investigate further today. I did test this on a clean netbox 2.4.8 as well.

@DanSheps commented on GitHub (Nov 22, 2018): I believe this is strictly related to form_factor=0 only, however I don't have time to investigate further today. I did test this on a clean netbox 2.4.8 as well.
Author
Owner

@DanSheps commented on GitHub (Nov 23, 2018):

Appears to be related to the fact that 0 is treated as a null value.

To fix:

form_factor = django_filters.MultipleChoiceFilter( choices=IFACE_FF_CHOICES, null_value=None )

@DanSheps commented on GitHub (Nov 23, 2018): Appears to be related to the fact that 0 is treated as a null value. To fix: ` form_factor = django_filters.MultipleChoiceFilter( choices=IFACE_FF_CHOICES, null_value=None ) `
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2138