Skip to content

Add model-specific filters for cables #14434

@jeremystretch

Description

@jeremystretch

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

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