-
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
search for a single IP address via API #2194
Comments
Submitting a simple 12-line patch: #2195 |
|
@Poofik that will return 192.0.2.100 and about 109 other addresses, and anything that has 192.0.2.1 in the description (e.g. "new address replacing 192.0.2.199") :-( |
put a slash for subnet and cut it off |
poofik is correct, there is a way to get exact prefixes. |
While @Poofik's approach work, it's a hack. I don't see a reason not expose the It's important to note that the address field includes the IP address and its mask. It seems the most practical approach would be to match any IP address if the mask is omitted. That is, |
Thanks, @jeremystretch! I didn't like the hack because q=1.2.3.4/ will still return 11.2.3.4 and 21.2.3.4 etc? |
Issue type
[ ] Feature request
[X] Bug report
[ ] Documentation
Description
I want to find out whether an IP address exists in NetBox via the API. Currently it doesn't seem possible to do that, because the only searches available either:
I propose adding
?address=192.0.2.1
as a query endpoint.The text was updated successfully, but these errors were encountered: