MCPcopy Create free account
hub / github.com/apache/cloudstack / reboot

Method reboot

extensions/MaaS/maas.py:208–217  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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")

Callers

nothing calls this directly

Calls 5

call_maasMethod · 0.95
failFunction · 0.70
succeedFunction · 0.70
getMethod · 0.65
sleepMethod · 0.45

Tested by

no test coverage detected