mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Adds API call to update port notes on devices. (#13834)
* Adds API call to update port notes on devices. * Lint fixes. * Fixes file permissions to proper values.
This commit is contained in:
@@ -1252,6 +1252,35 @@ Output:
|
||||
]
|
||||
```
|
||||
|
||||
### `update_device_port_notes`
|
||||
|
||||
Update a device port notes field in the devices_attrs database.
|
||||
|
||||
Route: `/api/v0/devices/:hostname/port/:portid`
|
||||
|
||||
- hostname can be either the device hostname or id
|
||||
- portid needs to be the port unique id (int).
|
||||
|
||||
Input (JSON):
|
||||
- notes: The string data to populate on the port notes field.
|
||||
|
||||
Examples:
|
||||
|
||||
```curl
|
||||
curl -X PATCH -d '{"notes": "This port is in a scheduled maintenance with the provider."}' -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/devices/localhost/port/5
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"status": "ok",
|
||||
"message": "Port notes field has been updated"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
```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
|
||||
```
|
||||
|
Reference in New Issue
Block a user