Skip to content
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

Merged
merged 5 commits into from Oct 17, 2019
Merged

Implement Oxidized "config search" as an API #10648

merged 5 commits into from Oct 17, 2019

Conversation

theochita
Copy link
Contributor

DO NOT DELETE THIS TEXT

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

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.

@CLAassistant
Copy link

CLAassistant commented Oct 3, 2019

CLA assistant check
All committers have signed the CLA.

@Jellyfrog Jellyfrog added the API label Oct 3, 2019
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');
Copy link
Member

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

Copy link
Contributor Author

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 :)

Copy link
Member

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');
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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 :(

Copy link
Member

@laf laf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@murrant murrant merged commit 25e8de3 into librenms:master Oct 17, 2019
@murrant
Copy link
Member

murrant commented Oct 29, 2019

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

@lock lock bot locked as resolved and limited conversation to collaborators Dec 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants