Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable filtering devices by assigned rack face #2357

Closed
ebusto opened this issue Aug 14, 2018 · 5 comments
Closed

Enable filtering devices by assigned rack face #2357

ebusto opened this issue Aug 14, 2018 · 5 comments
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@ebusto
Copy link

ebusto commented Aug 14, 2018

Environment

  • Python version: 3.5.4
  • NetBox version: 2.4.3

Proposed Functionality

Add the ability to search for devices based on rack position and face.

Use Case

It is handy to be able to search for devices in a specific part of a rack, which the combination of position and face should accomplish. I believe this is a trivial change to netbox/dcim/filters.py.

Database Changes

None.

External Dependencies

None.

@jeremystretch jeremystretch changed the title Device search by additional rack fields Enable filtering devices by assigned rack face Aug 16, 2018
@jeremystretch
Copy link
Member

FYI position is already an available filter.

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application labels Aug 16, 2018
@jeremystretch
Copy link
Member

We may have painted ourselves into a corner with this one. The face is stored as a nullable integer value in the database, with 0 meaning front and 1 meaning rear (and null meaning neither). However, we're using 0 as a special value to represent null for filters, so querying ?face=0 will return only devices with no face assignment.

We have a few options:

  1. Change the face field to use different values (e.g. "front" and "rear") instead of 0 and 1. This requires a database migration.
  2. Use different values for the filter. I don't like this because it's inconsistent. For example, querying ?face=front will return a device which has face=0.
  3. Change the value used to represent null. While an argument can be made for this option, it's likely too disruptive to be justified.

@jeremystretch jeremystretch added status: under review Further discussion is needed to determine this issue's scope and/or implementation and removed status: accepted This issue has been accepted for implementation labels Aug 21, 2018
@jeremystretch
Copy link
Member

Marking this as blocked by #2632

@jeremystretch jeremystretch added status: blocked Another issue or external requirement is preventing implementation and removed status: under review Further discussion is needed to determine this issue's scope and/or implementation labels Nov 30, 2018
@tb-killa
Copy link
Contributor

tb-killa commented Jan 8, 2019

Hi I would ask if there is something new?
#2632 is closed and I like your idea of:

Change the face field to use different values (e.g. "front" and "rear") instead of 0 and 1.

@candlerb
Copy link
Contributor

@tb-killa: #2632 was closed because it was implemented in 2.5.0.

This opens the route to implementing a filter for face=0, face=1 and face=null, but I don't think that's been implemented yet (hence this ticket remains open)

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: blocked Another issue or external requirement is preventing implementation labels Feb 15, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

4 participants