Add config-context option to Netbox Inventory Plugin
See original GitHub issueThere was a new feature added in Netbox v2.4 called Config context
which allows additional variables to be tied to devices. This does require an additional call per device to obtain the config_context
for each device due to requiring the device ID.
The API endpoint is found at http://netbox-url/api/dcim/devices/<id>/
I’m just looking for a quick discussion on where we should set the option and the default value.
Should we add it as a positional argument or just have it part of the **kwargs? And I’m thinking the default value should be set to false
if we go the positional argument method as it can be a massive speed sink if there are thousands of devices within someone’s Netbox inventory (we’re seeing this behavior on the Ansible Netbox dynamic inventory).
My vote would be on the positional argument method so that it’s clearly documented as an option, but wanted to get some feedback before I submit the PR to implement this.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
@wvandeun Thanks for that! That’s why there hasn’t been a PR opened. I will have to add the option disable it within the inventory which I should be able to get to soon as it may cause performance issues moving forward with fetching large inventories.
Not sure if you have put any effort into this already, but it looks like from v2.6 (now in beta) config-context will be included by default for all API results. A parameter is added to exclude config-context if you don’t want it (or if the query becomes to slow).
https://github.com/digitalocean/netbox/commit/bd573fd5cf3273456d1ac5faabbde85509cb8387