Introducing Ninja Filters
There was a need to provide some more dynamics to outputs generated by Ninja Plugin for Netbox, hence we introduced Ninja Filters.
What is Ninja?
The idea of Ninja is simple: You can define a Jinja2 template, which has access to all data in NetBox and you can produce whatever text based outputs you want. If you happen to produce Drawio XML it will be converted to SVG image and presented in the NetBox UI.
See this video to get better idea:
What is the use case for Ninja Filters?
Let’s say your template produces a diagram of big Layer 2 topology. It might be it cannot fit to single screen. It would be usefull you can filter the diagram based on some filter fields. Select one or more end hosts and see only connected leaf switches and their connected spine switches and so on. This is the feature Ninja Filter introduces.
How does it work?
You (optionally) select Object type filters and / or String filters for a Ninja template
These filters fields will be available for users to choose when they are looking the output the template produces
User selections (filter field values) are passed to Jinja. It is up to Jinja what to do with that information
See practical example here: