mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
API add_device: respond with more device information (#13251)
* Advanced Response Information API add_device * .
This commit is contained in:
@@ -1151,7 +1151,15 @@ Output:
|
||||
```json
|
||||
{
|
||||
"status": "ok",
|
||||
"message": "Device localhost.localdomain (57) has been added successfully"
|
||||
"message": "Device localhost.localdomain (57) has been added successfully",
|
||||
"devices": [
|
||||
{
|
||||
"device_id": "57",
|
||||
"hostname": "localhost",
|
||||
...
|
||||
"serial": null,
|
||||
"icon": null
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
@@ -419,7 +419,9 @@ function add_device(Illuminate\Http\Request $request)
|
||||
return api_error(500, $e->getMessage());
|
||||
}
|
||||
|
||||
return api_success_noresult(201, "Device $hostname ($device_id) has been added successfully");
|
||||
$device = device_by_id_cache($device_id);
|
||||
|
||||
return api_success([$device], 'devices', $response);
|
||||
}
|
||||
|
||||
function del_device(Illuminate\Http\Request $request)
|
||||
|
Reference in New Issue
Block a user