Querying parameters for netbox api calls #16676
Unanswered
MichaelOjoko
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Firstly, you are querying for devices. A Netbox device doesn't have an attribute called "racks" - a device can only be in a single rack. The attribute would be called "rack". Secondly, the "brief" query parameter doesn't take a list of fields. According to the documentation it's used like this: What you are looking for is a new feature introduced in v4.0, called dynamic fields, which is query parameter
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using request module to only include fields that I need from objects in the response,
The url looks something like this:
https://ip-for-instance/api/dcim/devices/?brief=id
which will only return the id, url, display, and name fields of each object as a response.
lets say I now want the racks field included in the device object, using
https://ip-for-instance/api/dcim/devices/?brief=id, racks
Still wont include racks, is there any other query url parameters available for netbox api?
Beta Was this translation helpful? Give feedback.
All reactions