-
I was shocked to find out that the dcim/devices API only has a Am I really the only one who would want to query devices based on location? The external systems have no knowledge of any IDs; of course I could first resolve the location to ID but it is quite a surprising requirement. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Shocked, I tell you, shocked! :-) The queries you can use (in Netbox v3.4.5) are defined here: https://github.com/netbox-community/netbox/blob/v3.4.5/netbox/dcim/filtersets.py#L793-L970
I'm never surprised by how bad REST APIs are, or their documentation. I only ever used one which had half-decent documentation, and that was Salesforce. |
Beta Was this translation helpful? Give feedback.
-
It's a safeguard. Location names and slugs aren't globally unique, so querying for e.g. |
Beta Was this translation helpful? Give feedback.
Shocked, I tell you, shocked! :-)
The queries you can use (in Netbox v3.4.5) are defined here: https://github.com/netbox-community/netbox/blob/v3.4.5/netbox/dcim/filtersets.py#L793-L970
location_id
is a TreeNodeMultipleChoiceFilter, so I imagine it's an implementation limitation that this works with IDs directly, not an indirect reference like location name or slug.I'm never surprised by how bad REST APIs are, or their documentation. I only ever used one which had half-decent documentation, and that was Salesforce.