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

API endpoints for maintenance #2927

Open
indy-independence opened this issue May 28, 2024 · 1 comment
Open

API endpoints for maintenance #2927

indy-independence opened this issue May 28, 2024 · 1 comment

Comments

@indy-independence
Copy link

Is your feature request related to a problem? Please describe.

We want to be able to schedule maintenance / downtime of devices via API, for example when triggering an OS/firmware upgrade from NMS we want to suppress alerts for a short while

Describe the solution you'd like

Addition of new API endpoints to add maintenance tasks , probably also list and delete maintenance tasks but not sure we will use those to start
Our intended solution is just before the reboot switch command is sent, we make an API call to NAV to start a ~15 min maintenance task. If the API can handle adding up to ~50 tiny maintenance windows with one device each in rapid succession that would be good, or maybe we can also try to schedule a bit longer window for up to 50 devices at a time with one API call

Describe alternatives you've considered

Additional context

We have discussed this in meetings a while back but I think I never actually created the issue on github before (or if I did I can't find it anymore)

@lunkwill42
Copy link
Member

lunkwill42 commented May 29, 2024

Making this available through API sounds worthwhile to me, at least.

Our intended solution is just before the reboot switch command is sent, we make an API call to NAV to start a ~15 min maintenance task.

Just be aware that in the current implementation, maintenance schedules are processed only every 5 minutes by a cron job. I.e. you can create a new maintenance task that has a start time of "now", but up to 5 minutes could potentially pass until the components are actually marked as being on maintenance.

If the API can handle adding up to ~50 tiny maintenance windows with one device each in rapid succession that would be good, or maybe we can also try to schedule a bit longer window for up to 50 devices at a time with one API call

Are you asking that a single API request can be used to create 50 separate maintenance tasks in one go?

This sounds counterintuitive to me, given how maintenance tasks work in NAV: You'd seriously crowd your maintenance calendar if you added single tasks for each device in this manner. If your intention is to reboot 50 devices in bulk over the course of the next 15 minutes, I'd try to post that as a single maintenance task that contains all those 50 devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants