mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added API route to update devices columns in DB
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user