api: Added support for updating multiple device table fields in one call #4954 (#5033)

This commit is contained in:
Neil Lathwood
2016-11-26 20:55:24 +00:00
committed by GitHub
parent 78f5c26cd6
commit 32668026a7
2 changed files with 39 additions and 4 deletions

View File

@@ -678,8 +678,8 @@ Route: /api/v0/devices/:hostname
Input (JSON):
- field: The column name within the database
- data: The data to update the column with
- field: The column name within the database (can be an array of fields)
- data: The data to update the column with (can be an array of data))
Examples:
```curl
@@ -697,6 +697,21 @@ Output:
]
```
```curl
curl -X PATCH -d '{"field": ["notes","purpose"], "data": ["This server should be kept online", "For serving web traffic"]}' -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/devices/localhost
```
Output:
```text
[
{
"status": "ok",
"message": "Device fields have been updated"
}
]
```
### <a name="api-route-get_device_groups">Function `get_device_groups`</a> [`top`](#top)
List the device groups that a device is matched on.