mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Add ability to fetch oxidized device config via the librenms API (#10913)
* Add get_oxidized_config api route * Add "get_oxidized_config" function. * add get_oxidized_config docs and fix typo in the search_oxidized docs.
This commit is contained in:
@@ -1204,6 +1204,17 @@ function search_oxidized(\Illuminate\Http\Request $request)
|
||||
}
|
||||
}
|
||||
|
||||
function get_oxidized_config(\Illuminate\Http\Request $request)
|
||||
{
|
||||
$hostname = $request->route('device_name');
|
||||
$result = json_decode(file_get_contents(Config::get('oxidized.url') . '/node/fetch/' . $hostname . '?format=json'), true);
|
||||
if (!$result) {
|
||||
return api_error(404, "Received no data from Oxidized");
|
||||
} else {
|
||||
return api_success($result, 'config');
|
||||
}
|
||||
}
|
||||
|
||||
function list_oxidized(\Illuminate\Http\Request $request)
|
||||
{
|
||||
$hostname = $request->route('hostname');
|
||||
|
||||
Reference in New Issue
Block a user