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

Add ability to search for devices/VMs which do not have a given tag #7591

Closed
BarbarossaTM opened this issue Oct 20, 2021 · 4 comments
Closed
Labels
type: feature Introduction of new functionality to the application

Comments

@BarbarossaTM
Copy link
Contributor

NetBox version

v3.0.3

Feature type

Change to existing functionality

Proposed functionality

It would be nice to be able to filter for devices or VMs which do not have a given tag applied.

Use case

When migrating parts of the infrastructure to new versions or new tooling we currently use tags to indicate that a device or a VM should get the "new stuff" which works fine. Our automation consumes the tags applied to the device/VM and does the right thing. To see which devices/VMs have to be migrated it would be nice if we could filter for devices/VMs which do not have the tag applied yet.

Database changes

None.

External dependencies

None.

@BarbarossaTM BarbarossaTM added the type: feature Introduction of new functionality to the application label Oct 20, 2021
@tyler-8
Copy link
Contributor

tyler-8 commented Oct 20, 2021

You can do this today on just about any endpoint with a tag filter - there's also the tag__n filter.

If you only want objects that do not contain tag-x you would add tag__n=tag-x to your query parameters. This works in both the GUI and API - although the negation filter isn't visible in the GUI, the URL query does render the proper results.

@BarbarossaTM
Copy link
Contributor Author

Thanks @tyler-8, that's a nice workaround :)

@jeremystretch
Copy link
Member

@BarbarossaTM does the solution @tyler-8 provided meet your needs for this FR?

This works in both the GUI and API - although the negation filter isn't visible in the GUI

Tangential, but I'd like to improve the UI filter forms to support this, somehow. I've opened #7604 to propose an idea.

@BarbarossaTM
Copy link
Contributor Author

Yes, adding ?tag__n=xxx to the URL works fine for now and provides me the result I want, so I can work. Would be cool to be able to add this filter via the GUI, so if that's the intention for #7604 that would be great :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

3 participants