Hi;
I am looking for a way to reboot both MacOS and iOS/tvOS devices via API commands, either with classic API or uAPI.
I've found that I can use the classic API's mobiledevicecommands RestartDevice <id> endpoint to reboot mobile devices. But this doesn't apply to Computers. Oddly, the classic API computercommands endpoint does not include a Restart command like Devices does.
I've found that I can create a Policy for computers and setup the Restart Immediately policy, and setup a custom event trigger such as "Reboot" to trigger it.
Two questions -
First, how to trigger a Policy custom event via either of the APIs?
Second, how do I scope this so that I can select only one or some subset of Computers to reboot? I don't want to create a separate policy for every computer, but definitely don't want to reboot all my computers!
I do realize that I could setup reboots to happen at specified times, but I really need this to be an on-demand type of trigger that get's initiated via an API call.