Add generic api toggle for extended data output #7699

Closed
opened 2025-12-29 20:27:13 +01:00 by adam · 2 comments
Owner

Originally created by @stavr666 on GitHub (Mar 1, 2023).

NetBox version

v3.4.4

Feature type

Data model extension

Proposed functionality

Add generic api toggle for extended data output. Example
https://netbox.local/api/dcim/devices/1/?extended_output=True

Use case

We are increasing number of things, that stored in Netbox. Most crucial part for us right now: extended info about virtual server, maintenance, contacts etc. in Grafana directly form Netbox.
We can get some data, but still wish, that some of them require less hops and data transformations.

For example, we can get following attributes for physical machine:
image

There some crucial parts of data is missing:

  • IP lacks status label, dns name, description, creation date
  • Cluster lacks status label, type name, group name, description
  • tags lacks description (most valuable part)

For tags we can attach custom config with same description role (most of them IS human-readable CCs, after all), but it must either keep some unique naming or CCs will replace each other.

Other way - parse links 1 by 1. It greatly increases request complexity, to the point that there is no direct way, to get required data directly from Grafana (without exposing logon data to external non-netbox processing services and to dashboard template) or any other services, that have no extended processing capabilities.

Database changes

None, that I aware of. Only api will be affected.

External dependencies

No response

Originally created by @stavr666 on GitHub (Mar 1, 2023). ### NetBox version v3.4.4 ### Feature type Data model extension ### Proposed functionality Add generic api toggle for extended data output. Example https://netbox.local/api/dcim/devices/1/?extended_output=True ### Use case We are increasing number of things, that stored in Netbox. Most crucial part for us right now: extended info about virtual server, maintenance, contacts etc. in Grafana directly form Netbox. We can get some data, but still wish, that some of them require less hops and data transformations. For example, we can get following attributes for physical machine: ![image](https://user-images.githubusercontent.com/84839985/222150087-52e0f8a6-de42-44da-a97d-5394d16f6149.png) There some crucial parts of data is missing: - IP lacks status label, dns name, description, creation date - Cluster lacks status label, type name, group name, description - tags lacks description (most valuable part) For tags we can attach custom config with same description role (most of them IS human-readable CCs, after all), but it must either keep some unique naming or CCs will replace each other. Other way - parse links 1 by 1. It greatly increases request complexity, to the point that there is no direct way, to get required data directly from Grafana (without exposing logon data to external non-netbox processing services and to dashboard template) or any other services, that have no extended processing capabilities. ### Database changes None, that I aware of. Only api will be affected. ### External dependencies _No response_
adam added the type: feature label 2025-12-29 20:27:13 +01:00
adam closed this issue 2025-12-29 20:27:13 +01:00
Author
Owner

@jeremystretch commented on GitHub (Mar 1, 2023):

There are many reasons (both technical and philosophical) that REST APIs do not operate in the proposed manner, which I won't get into, but at a high level the proposed functionality is untenable. Maybe NetBox's GraphQL API would better suit your needs.

@jeremystretch commented on GitHub (Mar 1, 2023): There are many reasons (both technical and philosophical) that REST APIs do not operate in the proposed manner, which I won't get into, but at a high level the proposed functionality is untenable. Maybe NetBox's [GraphQL API](https://docs.netbox.dev/en/stable/integrations/graphql-api/) would better suit your needs.
Author
Owner

@stavr666 commented on GitHub (Mar 2, 2023):

Maybe NetBox's GraphQL API would better suit your needs.

Never before tried GraphQL, but it's surprisingly easy and good. Thanks, it's actually resolved our cases.

@stavr666 commented on GitHub (Mar 2, 2023): > Maybe NetBox's [GraphQL API](https://docs.netbox.dev/en/stable/integrations/graphql-api/) would better suit your needs. Never before tried GraphQL, but it's surprisingly easy and good. Thanks, it's actually resolved our cases.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7699