Closed BarbarossaTM closed 2 years ago
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.
Thanks @tyler-8, that's a nice workaround :)
@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.
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 :)
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.