api: API allow cidr network searches of the ARP table (#6378)

* api: API allow cidr network searches of the ARP table

* Allow non-encoded / in request
I also noticed that all is allowed to be called without device, which the sql query does not support.
This commit is contained in:
Tony Murray
2017-04-07 15:05:46 -05:00
committed by Neil Lathwood
parent b1483e3d2e
commit 4ab358501d
3 changed files with 16 additions and 5 deletions

View File

@@ -1826,6 +1826,7 @@ Retrieve a specific ARP entry or all ARP enties for a device
Route: /api/v0/resources/ip/arp/:ip
- ip is the specific IP you would like to query, if this is all then you need to pass ?device=_hostname_ (or device id)
- This may also be a cidr network, for example 192.168.1.0/24
Input:
@@ -1834,7 +1835,8 @@ Input:
Example:
```curl
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/resources/ip/arp/1.1.1.1
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/resources/ip/arp/1.1.1.1?device=localhost
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/resources/ip/arp/192.168.1.0/24
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/resources/ip/arp/all?device=localhost
```
Output: