mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
api: add hostname search for list_devices function (#10652)
* api: add domain type for list_devices function api: add domain type query for list_devices undo librenms-docker specification. * api: list_devices change domain query by hostname. fix to search pattern in hostname * Update Devices.md
This commit is contained in:
@@ -927,6 +927,7 @@ Input:
|
||||
- ipv4: search by IPv4 address
|
||||
- ipv6: search by IPv6 address (compressed or uncompressed)
|
||||
- location: search by location
|
||||
- hostname: search by hostname
|
||||
- query: If searching by, then this will be used as the input.
|
||||
|
||||
Example:
|
||||
|
||||
@@ -300,6 +300,8 @@ function list_devices(\Illuminate\Http\Request $request)
|
||||
$sql = "`d`.`ignore`='0' AND `d`.`disabled`='0'";
|
||||
} elseif ($type == 'location') {
|
||||
$sql = "`locations`.`location` LIKE '%".$query."%'";
|
||||
} elseif ($type == 'hostname') {
|
||||
$sql = "`d`.`hostname` LIKE '%".$query."%'";
|
||||
} elseif ($type == 'ignored') {
|
||||
$sql = "`d`.`ignore`='1' AND `d`.`disabled`='0'";
|
||||
} elseif ($type == 'up') {
|
||||
|
||||
Reference in New Issue
Block a user