(self)
| 206 | succeed({"status": "success", "power_state": "PowerOff"}) |
| 207 | |
| 208 | def reboot(self): |
| 209 | sysid = self.data.get("system_id") |
| 210 | if not sysid: |
| 211 | fail("system_id missing for reboot") |
| 212 | |
| 213 | self.call_maas("POST", f"/machines/{sysid}/", {"op": "power_off"}) |
| 214 | time.sleep(5) |
| 215 | self.call_maas("POST", f"/machines/{sysid}/", {"op": "power_on"}) |
| 216 | |
| 217 | succeed({"status": "success", "power_state": "PowerOn", "message": "Reboot completed"}) |
| 218 | |
| 219 | def status(self): |
| 220 | sysid = self.data.get("system_id") |