Added API route to update devices columns in DB

This commit is contained in:
laf
2015-12-08 22:53:52 +00:00
parent a2d97f4283
commit 977cdd558d
3 changed files with 66 additions and 0 deletions

View File

@@ -18,6 +18,7 @@
- [`list_devices`](#api-route-10)
- [`add_device`](#api-route-11)
- [`list_oxidized`](#api-route-21)
- [`update_device_field`](#api-route-update_device_field)
- [`routing`](#api-routing)
- [`list_bgp`](#api-route-1)
- [`switching`](#api-switching)
@@ -462,6 +463,33 @@ Output:
]
```
### <a name="api-route-update_device_field">Function: `update_device_field`</a> [`top`](#top)
Update devices field in the database.
Route: /api/v0/devices/:hostname
Input (JSON):
- field: The column name within the database
- data: The data to update the column with
Examples:
```curl
curl -X PATCH -d '{"field": "notes", "data": "This server should be kept online"}' -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/devices/localhost
```
Output:
```text
[
{
"status": "ok",
"message": "Device notes has been updated"
}
]
```
## <a name="api-routing">`Routing`</a> [`top`](#top)
### <a name="api-route-1">Function: `list_bgp`</a> [`top`](#top)