Added API calls for device groups

This commit is contained in:
laf
2015-12-12 12:58:07 +00:00
parent 52647a92a0
commit 62b4c21a12
4 changed files with 127 additions and 2 deletions
+73
View File
@@ -19,6 +19,9 @@
- [`add_device`](#api-route-11)
- [`list_oxidized`](#api-route-21)
- [`update_device_field`](#api-route-update_device_field)
- [`get_device_groups`](#api-route-get_device_groups)
- [`devicegroups`](#api-devicegroups)
- [`get_devicegroups`](#api-route-get_devicegroups)
- [`routing`](#api-routing)
- [`list_bgp`](#api-route-1)
- [`switching`](#api-switching)
@@ -490,6 +493,76 @@ Output:
]
```
### <a name="api-route-get_device_groups">Function `get_device_groups`</a> [`top`](#top)
List the device groups that a device is matched on.
Route: /api/v0/devices/:hostname/groups
Input (JSON):
-
Examples:
```curl
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/devices/localhost/groups
```
Output:
```text
[
{
"status": "ok",
"message": "Found 1 device groups",
"count": 1,
"groups": [
{
"id": "1",
"name": "Testing",
"desc": "Testing",
"pattern": "%devices.status = \"1\" &&"
}
]
}
]
```
## <a name="api-devicegroups">`Device Groups`</a> [`top`](#top)
### <a name="api-route-get_devicegroups">Function `get_devicegroups`</a> [`top`](#top)
List all device groups.
Route: /api/v0/devicegroups
Input (JSON):
-
Examples:
```curl
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/devicegroups
```
Output:
```text
[
{
"status": "ok",
"message": "Found 1 device groups",
"count": 1,
"groups": [
{
"id": "1",
"name": "Testing",
"desc": "Testing",
"pattern": "%devices.status = \"1\" &&"
}
]
}
]
```
## <a name="api-routing">`Routing`</a> [`top`](#top)
### <a name="api-route-1">Function: `list_bgp`</a> [`top`](#top)