reboot device in program

Hi, in program how to reboot or shutdown a
digi device? for example CP X4
thanks!

One way to reboot a CPX4:
import digicli
digicli.digicli(“boot action=reset”)

Thanks Very much! it is well