Using the API to enter and leave maintenance?

Using the API to enter and leave maintenance?

avatar

We have scheduled database server maintenance and we can script a pre and post action. I would like to use the API to enter and leave maintenance on all of the PSU servers while the database server is down.

I've tried calling PUT /api/v1/computer?id={id}&maintenance=true however this just results in a new computer object being created in the database, so I can't imagine this is the correct way to do this.

All Comments (3)

avatar

Hello @realslacker

Thank you for reporting this.

I found a previous discussion around automating Maintenance mode where the recommended approach was to use Set-PSUComputer with the -Maintenance parameter rather than calling the /api/v1/computer endpoint directly.

The current 2026.3.x PowerShell Universal module still includes Set-PSUComputer, but before recommending the exact syntax for your environment, could you please confirm the exact PSU version you are currently running?

Once we have that, I can verify the supported method for entering and leaving Maintenance mode on all of your PSU servers and determine whether the behavior you are seeing with the PUT request is expected for that version.

Best regards,
Ruben Tapia

avatar

If the API is supported to enable and disable maintenance mode then why should it not be used. If using the API to enable and disable maintenance mode is not supported then the API parameter should be removed. Having a feature with no documentation and no examples AND not providing support when asked seems to be pretty poor product support.

It is pretty irritating to be told to not use this portion of the product when what I need is the ability to turn on and off maintenance mode using a raw API call. Not everything can invoke a PowerShell command.

At any rate, I created an endpoint and calls the PSU cmdlet so for now this is a moot point... but it's a very hacky work around to the actual API endpoint being unusable.

avatar

I've opened an issue to get the API fixed and documented properly.

Adam Driscoll
PowerShell Expert and Software Architect at Devolutions