Search IP Addresses By Description Via REST API #4897

Closed
opened 2025-12-29 19:21:54 +01:00 by adam · 4 comments
Owner

Originally created by @coder0xff on GitHub (May 11, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

2.11.3

Feature type

New functionality

Proposed functionality

https://github.com/netbox-community/netbox/issues/358 requested the ability to search by description, and it was eventually implemented. However, it appears that version 2.11.3 no longer has this ability. Due to being a new major version, I was unsure if this was a regression, so I've made it a feature request.

Use case

Getting IP addresses by description.

Database changes

No response

External dependencies

No response

Originally created by @coder0xff on GitHub (May 11, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version 2.11.3 ### Feature type New functionality ### Proposed functionality https://github.com/netbox-community/netbox/issues/358 requested the ability to search by description, and it was eventually implemented. However, it appears that version 2.11.3 no longer has this ability. Due to being a new major version, I was unsure if this was a regression, so I've made it a feature request. ### Use case Getting IP addresses by description. ### Database changes _No response_ ### External dependencies _No response_
adam added the status: acceptedtype: feature labels 2025-12-29 19:21:54 +01:00
adam closed this issue 2025-12-29 19:21:54 +01:00
Author
Owner

@jeremystretch commented on GitHub (May 11, 2021):

Please elaborate on what specifically you're doing, or would like to do.

@jeremystretch commented on GitHub (May 11, 2021): Please elaborate on what specifically you're doing, or would like to do.
Author
Owner

@coder0xff commented on GitHub (May 11, 2021):

I have a bash script with a list of descriptions and would like to programmatically map them to IP addresses.

curl -X GET "https://netbox.****.com/api/ipam/ip-addresses/?description=foobar" -H  "accept: application/json" -H  "Authorization: Token *****************************************"  | grep -oP "\"address\":\"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d+\"" | grep -oP --color=never "\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"

The query returns the entire collection of ip address objects rather than ones matching the description.

@coder0xff commented on GitHub (May 11, 2021): I have a bash script with a list of descriptions and would like to programmatically map them to IP addresses. ```bash curl -X GET "https://netbox.****.com/api/ipam/ip-addresses/?description=foobar" -H "accept: application/json" -H "Authorization: Token *****************************************" | grep -oP "\"address\":\"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d+\"" | grep -oP --color=never "\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}" ``` The query returns the entire collection of ip address objects rather than ones matching the description.
Author
Owner

@DanSheps commented on GitHub (May 12, 2021):

Is there any reason you cannot use the query to do this (q=foobar).

The query searches:

  • DNS Name
  • Description
  • Address
@DanSheps commented on GitHub (May 12, 2021): Is there any reason you cannot use the query to do this (q=foobar). The query searches: * DNS Name * Description * Address
Author
Owner

@jeremystretch commented on GitHub (May 12, 2021):

I see no harm in adding the description field specifically, although as Dan points out you probably want to use ?q= in most cases.

@jeremystretch commented on GitHub (May 12, 2021): I see no harm in adding the `description` field specifically, although as Dan points out you probably want to use `?q=` in most cases.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4897