mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 10:28:13 +00:00
api: Added the ability to list devices by location in the api (#5693)
* Adding location based filter for api-device calls * I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md. * configured linting etc, now pr should pass * rebase and add entry to docs
This commit is contained in:
parent
8559137587
commit
8b401fd05b
@ -171,10 +171,14 @@ LibreNMS contributors:
|
||||
- Robert Towster <rnt-github at towster.com> (towster)
|
||||
- Rocky Luke <rockyluke@offline.net> (rockyluke)
|
||||
- Tim Jackson <jackson.tim@gmail.com> (jackson-tim)
|
||||
<<<<<<< HEAD
|
||||
- Jørn-Stian Lønsetteig <jeg@glemte.no> (gilrim)
|
||||
=======
|
||||
- Viktoria Rei Bauer <vbauer@stargazer.at> (ToeiRei)
|
||||
- Ryan Eno <ryaneno@gmail.com> (VimCommando)
|
||||
- Matt Peterson <matt@peterson.org> (dorkmatt)
|
||||
- William George <wrgeorge1983@gmail.com> (wrgeorge1983)
|
||||
>>>>>>> 665f9e902e31a70c05ceae9f3589db4fd76107a7
|
||||
|
||||
Observium was written by:
|
||||
- Adam Armstrong
|
||||
|
@ -729,6 +729,7 @@ Input:
|
||||
- mac: search by mac address
|
||||
- ipv4: search by IPv4 address
|
||||
- ipv6: search by IPv6 address (compressed or uncompressed)
|
||||
- location: search by location
|
||||
- query: If searching by, then this will be used as the input.
|
||||
Example:
|
||||
```curl
|
||||
|
@ -210,6 +210,8 @@ function list_devices()
|
||||
|
||||
if ($type == 'all' || empty($type)) {
|
||||
$sql = '1';
|
||||
} elseif ($type == 'location') {
|
||||
$sql = "`location` LIKE '%".$query."%'";
|
||||
} elseif ($type == 'ignored') {
|
||||
$sql = "`ignore`='1' AND `disabled`='0'";
|
||||
} elseif ($type == 'up') {
|
||||
|
Loading…
Reference in New Issue
Block a user