-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add API filters for all models #1203
Comments
Looking at the code, it seems these objects just need filters writing to enable querying. I'll see if I can have a go at this over the weekend unless there's particular reasons why these filters haven't already been implemented? My use case is that I'm trying to fully populate our NetBox instance using the API and a bunch of YAML data. When it comes to adding a device-type, it has a relationship with manufacturer so my code has to look up the manufacturer ID given its name so it can satisfy that relationship. Similarly, when adding a device then the device-role has to be looked up by name. |
Am I correct in saying that query filters aren't implemented for any model? |
Implemented query filters for all remaining models in 87e5687 |
Issue type: bug report
Python version: 2.7.13
NetBox version: 2.0.3
Given the following device-roles:
$ curl http://192.168.33.34/api/dcim/device-roles/
{"count":2,"next":null,"previous":null,"results":[{"id":1,"name":"Chassis","slug":"chassis","color":"ff0000"},{"id":2,"name":"OpenStack Node","slug":"openstacknode","color":"008000"}]}
I'd expect the following query to return just 1 device-role (as per other similar queries against other objects that work as expected):
$ curl http://192.168.33.34/api/dcim/device-roles/?name=Chassis
{"count":2,"next":null,"previous":null,"results":[{"id":1,"name":"Chassis","slug":"chassis","color":"ff0000"},{"id":2,"name":"OpenStack Node","slug":"openstacknode","color":"008000"}]}
The text was updated successfully, but these errors were encountered: