mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Enabling general search for ports, devices, and more (#11571)
* Search engine for device, through API * reviewed port search through API * fixed die * Update api_functions.inc.php * Update api_functions.inc.php * Update api_functions.inc.php * Update api_functions.inc.php * Update api.php * Update api.php * Update Ports.md Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
@@ -44,6 +44,52 @@ Output:
|
||||
}
|
||||
```
|
||||
|
||||
### `search_ports`
|
||||
|
||||
Search for ports matching the query.
|
||||
|
||||
Route: `/api/v0/ports/search/:search`
|
||||
|
||||
- search string to search in fields: ifAlias, ifDescr, and ifName
|
||||
|
||||
Input:
|
||||
|
||||
-
|
||||
|
||||
Example:
|
||||
|
||||
```curl
|
||||
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/ports/search/lo
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```json
|
||||
{
|
||||
"status": "ok",
|
||||
"ports": [
|
||||
{
|
||||
"device_id": 1,
|
||||
"port_id": 1,
|
||||
"ifIndex": 1,
|
||||
"ifName": "lo"
|
||||
},
|
||||
{
|
||||
"device_id": 2,
|
||||
"port_id": 3,
|
||||
"ifIndex": 1,
|
||||
"ifName": "lo"
|
||||
},
|
||||
{
|
||||
"device_id": 3,
|
||||
"port_id": 5,
|
||||
"ifIndex": 1,
|
||||
"ifName": "lo"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### `get_port_info`
|
||||
|
||||
Get all info for a particular port.
|
||||
|
||||
Reference in New Issue
Block a user