netbox
netbox copied to clipboard
API endpoint to retrieve a data file's content
NetBox version
v3.5.9
Feature type
Change to existing functionality
Proposed functionality
It would be nice to have a way to get a data file content from the API. It's currently only possible via the UI if I'm not mistaken.
A new API endpoint /data-file/
Use case
It can help systems using netbox to query interesting information from netbox to use for different things: pxe config, ...
Database changes
None?
External dependencies
None?
IIRC we intentionally omitted file data from the API serializer because we didn't want it to be consumed as a file server.
It can help systems using netbox to query interesting information from netbox to use for different things: pxe config, ...
Can you think of a use case that's better served via proxy by NetBox than by accessing the file directly from its source?
I’m curious what you would use this for. I do something similar with Telegraf config files. Netbox generates these files, and then they are served directly by Apache. I’m guessing serving them through Netbox would incur some performance penalty, and I’m not sure what the benefit would be?
As there's been no further justification offered for this change, I'm going to close it in accordance with the original intent of this feature's implementation.
Sorry I apparently missed the first mails :sweat_smile:
Can you think of a use case that's better served via proxy by NetBox than by accessing the file directly from its source?
It was more of a simple way to get git-synced files from an API, but I agree, it's not really Netbox-centric!
I’m curious what you would use this for.
It's a stateless DHCP/TFTP software based on Netbox as a source of truth, and I was thinking of for instance using the external data as backend for my PXE template files for instance