Replies: 1 comment 5 replies
-
q= is a text search and is casting a wider net than what you want, you might query instead by name= to get a more exact match. Look at the API docs in Swagger to see the full list of query parameters each API endpoint supports /api/docs/ as there are more options than is obvious if you are using the UI queries as your guide. ah you mentioned the filter tab, so this is related to queries through the web interface not the api and is related to netbox 3.x. I attempted to replicate and was not able, if I go to demo.netbox.dev then Devices and the Filter tab and in the Sites filter add "Athens" the query looks is https://demo.netbox.dev/dcim/devices/?q=&site_id=43 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I've ran into a weird one that is kind of preventing us from filtering devices (or prefixes/vm's) by site in the UI. All of our sites are numbers and letters, generally less then five characters. For example we have a site named 85 and 85A. We have around 1000 sites following that format. The issue comes in when you try to filter by site(when using the filter tab on a primary object). When I look up 85 it returns nothing. The specific query it is using is this (found via the inspector in chrome (F12)):
https://dev.netbox.test.com/api/dcim/sites/?brief=true&q=85
The problem is that this returns 833 results and the site called 85 isn't in the first 50 (it paginates and only looks at the first 50).
So I guess I have two questions:
Let me know if I can provide more info.
Thanks so much!
Joel McGuire
Beta Was this translation helpful? Give feedback.
All reactions