Skip to content

Standardize device and device group maintenance API#14153

Merged
murrant merged 2 commits intolibrenms:masterfrom
rhinoau:maintenance
Jul 28, 2022
Merged

Standardize device and device group maintenance API#14153
murrant merged 2 commits intolibrenms:masterfrom
rhinoau:maintenance

Conversation

@rhinoau
Copy link
Copy Markdown
Contributor

@rhinoau rhinoau commented Jul 28, 2022

This PR standardises the behaviour of the devices and devicegroups maintenance API:

  • defaults to immediate now() maintenance if no start given
  • accepts scheduled maintenance start if given
  • handles host not found errors cleanly
  • documentation clarity

Prior, the two routines made different assumptions, devices could only have immediate maintenance, and basic errors were not handled for omitted data or device not found.

DO NOT DELETE THE UNDERLYING TEXT

Please note

Please read this information carefully. You can run ./lnms dev:check to check your code before submitting.

  • Have you followed our code guidelines?
  • If my Pull Request does some changes/fixes/enhancements in the WebUI, I have inserted a screenshot of it.
  • If my Pull Request makes discovery/polling/yaml changes, I have added/updated test data.

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.

@librenms-bot
Copy link
Copy Markdown

This pull request has been mentioned on LibreNMS Community. There might be relevant details there:

https://community.librenms.org/t/api-api-v0-devicesgroups-name-maintenance-server-error-set-app-debug-true-to-see-details/19164/10

Copy link
Copy Markdown
Member

@murrant murrant left a comment

Choose a reason for hiding this comment

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

I would be a little more strict on this, since the two API endpoints were broken up until very recently, LGTM. Improved consistency is definitely welcome.

@murrant murrant added the API label Jul 28, 2022
@murrant murrant changed the title Standardise device and devicegroup maintenance API Standardize device and device group maintenance API Jul 28, 2022
@murrant murrant merged commit d248e65 into librenms:master Jul 28, 2022
@librenms-bot
Copy link
Copy Markdown

This pull request has been mentioned on LibreNMS Community. There might be relevant details there:

https://community.librenms.org/t/api-functions/18593/3

@rhinoau rhinoau deleted the maintenance branch October 13, 2022 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants