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

Method status

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

Source from the content-addressed store, hash-verified

217 succeed({"status": "success", "power_state": "PowerOn", "message": "Reboot completed"})
218
219 def status(self):
220 sysid = self.data.get("system_id")
221 if not sysid:
222 fail("system_id missing for status")
223 resp = self.call_maas("GET", f"/machines/{sysid}/")
224 state = resp.get("power_state", "")
225 if state == "on":
226 mapped = "PowerOn"
227 elif state == "off":
228 mapped = "PowerOff"
229 else:
230 mapped = "PowerUnknown"
231 succeed({"status": "success", "power_state": mapped})
232
233
234def main():

Callers 1

maybeUpMethod · 0.45

Calls 4

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

Tested by

no test coverage detected