Closed n3wtype closed 5 years ago
This would introduce excessive overhead for the request. It's the same reason the response doesn't include the connected device's site, rack, etc. You'll need to make a separate API request for the device if you need that information.
Environment
Proposed Functionality
Expose device role in /dcim/interfaces/ connected_endpoints
now it looks like
after a change
Use Case
Let's say that I have an access switch and bunch of servers connected to it within netbox. Based on device_role.name of connected device I would like to do some automated configuration of access port. To do that I fetch a list of interfaces of this switch and look within connected_endpoint section. Currently device_role.name is not exposed by this api. So get this information I need to do additional API calls. Imagine I have 100+ switches with 48 ports connected to different devices. It make a lot of additional API calls. It would be lot simpler connected_endpoint section would provide this information right away. It would make automation based on data from netbox easier. Making automation decision based on data from netbox keeps netbox consistent with actual configuration and for bigger environments it could be reasonable to provide some more data right away to avoid massive amount of additional API calls.
Database Changes
As far as I'm aware no additional schema change is required. The only required change is probably additional JOIN in orm to fetch device_role.name for each device.
External Dependencies
n/a