mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
/start /stop and /suspend API for VM via container
This commit is contained in:
5 files changed
+144
-1
No files matched your search
@@ -110,6 +110,27 @@ class VM:
|
||||
else:
|
||||
self._properties[key] = value
|
||||
|
||||
@asyncio.coroutine
|
||||
def start(self):
|
||||
"""
|
||||
Start a VM
|
||||
"""
|
||||
yield from self._hypervisor.post("/projects/{}/{}/vms/{}/start".format(self._project.id, self._vm_type, self._id))
|
||||
|
||||
@asyncio.coroutine
|
||||
def stop(self):
|
||||
"""
|
||||
Stop a VM
|
||||
"""
|
||||
yield from self._hypervisor.post("/projects/{}/{}/vms/{}/stop".format(self._project.id, self._vm_type, self._id))
|
||||
|
||||
@asyncio.coroutine
|
||||
def suspend(self):
|
||||
"""
|
||||
Suspend a VM
|
||||
"""
|
||||
yield from self._hypervisor.post("/projects/{}/{}/vms/{}/suspend".format(self._project.id, self._vm_type, self._id))
|
||||
|
||||
@asyncio.coroutine
|
||||
def post(self, path, data={}):
|
||||
"""
|
||||
|
||||
Reference in new issue
Block a user