New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Oxidized "config search" as an API #10648
Conversation
routes/api.php
Outdated
@@ -73,6 +73,7 @@ | |||
Route::put('rules', 'LegacyApiController@add_edit_rule')->name('edit_rule'); | |||
Route::delete('rules/{id}', 'LegacyApiController@delete_rule')->name('delete_rule'); | |||
Route::post('services/{hostname}', 'LegacyApiController@add_service_for_host')->name('add_service_for_host'); | |||
Route::get('oxidized/configsearch/{searchstring}', 'LegacyApiController@search_oxidized')->name('search_oxidized'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why you added this under the admin middleware?
As far as I know you don't need admin in the web interface for oxidized
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for replying :)
The reason behind it was that getting to search through config files is something i would imagine only admins should have access to.
I can move it anywhere you want it to be :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You do need to be an admin. Many want it able to be separated, but that isn't an option yet.
routes/api.php
Outdated
@@ -73,6 +73,7 @@ | |||
Route::put('rules', 'LegacyApiController@add_edit_rule')->name('edit_rule'); | |||
Route::delete('rules/{id}', 'LegacyApiController@delete_rule')->name('delete_rule'); | |||
Route::post('services/{hostname}', 'LegacyApiController@add_service_for_host')->name('add_service_for_host'); | |||
Route::get('oxidized/configsearch/{searchstring}', 'LegacyApiController@search_oxidized')->name('search_oxidized'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe change this to /config/search/{searchstring}
? We can then use /config
to return the devices config from the api at a later stage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just updated it to follow your example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating the doc @laf stupid of me to miss that :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This pull request has been mentioned on LibreNMS Community. There might be relevant details there: https://community.librenms.org/t/v1-57-release-changelog-october-2019/9969/1 |
DO NOT DELETE THIS TEXT
Please note
Testers
If you would like to test this pull request then please run:
./scripts/github-apply <pr_id>
, i.e./scripts/github-apply 5926
After you are done testing, you can remove the changes with
./scripts/github-remove
. If there are schema changes, you can ask on discord how to revert.