On Thu, 21 Jul 2016 15:06:54 +0000 Mischa Diehm mischa.diehm@unibas.ch wrote:
Hi,
We are programming an inventory tool that uses NAV as one of its main datasources. We are now trying to get the Serial (lots of cisco here) for a given device. In the ipdevinfo overview we see the serial (for stacks there are even the stackmembers with serials listed).
My questions is if we there is a way to get this information through the API and if yes how we could retrieve it?
John-Magne did respond to your IRC messages, but from my discussions with him here at EuroPython, I can surmise the following:
There is currently no API to get serial numbers. We can easily add one, without much effort - it just depends on what the API should look like.
The serial numbers displayed in ipdevinfo are the serial numbers of any chassis entities discovered on the IP device. The number of chassis may be 0..N. We could add just the chassis information to the existing netbox API endpoint, or we could add a netbox_entity endpoint for complete discovery of detected entities inside devices (the latter would be a completely natural extension of the API).
My second questions is if there is an easy documented way to extend the API with stuff like that or e.g. Status info like „is the box currently online“? Is there a roadmap towards what should and will be implemented regarding the exporsure through the API (maybe even write stuff?)
We have no custom documentation on how to add API calls. We use Django REST Framework to implement the API, so you would need to know your way around this framework, and have some knowledge of the NAV data model.
There's nothing specific about the API in our roadmap - we have previously stated that will add API endpoints as needed/requested.