Add model-specific filters for cables #8919

Closed
opened 2025-12-29 20:42:50 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Dec 5, 2023).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.6.6

Feature type

New functionality

Proposed functionality

Add the following query filters for cables:

  • circuittermination
  • consoleport
  • consoleserverport
  • frontport
  • interface
  • powerfeed
  • poweroutlet
  • powerport
  • rearport

These filters can be used to easily filter for cables by their terminating object(s). For example, GET /api/dcim/cables/?interface=123 will return the cable (if any) terminated to the interface with ID 123.

It should be possible to pass multiple values effecting a logical OR, to allow returning all cables attached to any of the specified terminations, e.g. GET /api/dcim/cables/?interface=123&interface=456&frontport=789.

Use case

This approach greatly simplifies filtering of cables by specific termination points. As noted in #14274, the current approach utilizing termination_type and termination_id filters is limited and error-prone.

Database changes

None

External dependencies

None

Originally created by @jeremystretch on GitHub (Dec 5, 2023). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.6.6 ### Feature type New functionality ### Proposed functionality Add the following query filters for cables: * `circuittermination` * `consoleport` * `consoleserverport` * `frontport` * `interface` * `powerfeed` * `poweroutlet` * `powerport` * `rearport` These filters can be used to easily filter for cables by their terminating object(s). For example, `GET /api/dcim/cables/?interface=123` will return the cable (if any) terminated to the interface with ID 123. It should be possible to pass multiple values effecting a logical OR, to allow returning all cables attached to any of the specified terminations, e.g. `GET /api/dcim/cables/?interface=123&interface=456&frontport=789`. ### Use case This approach greatly simplifies filtering of cables by specific termination points. As noted in #14274, the current approach utilizing `termination_type` and `termination_id` filters is limited and error-prone. ### Database changes None ### External dependencies None
adam added the status: acceptedtype: feature labels 2025-12-29 20:42:50 +01:00
adam closed this issue 2025-12-29 20:42:50 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8919