Add controller endpoints to get VirtualBox VMs, VMware VMs and Docker images

This commit is contained in:
grossmj
2022-06-07 00:38:59 +08:00
parent 3b7dfe5929
commit 7d49b80e6b
6 changed files with 91 additions and 66 deletions

View File

@ -620,23 +620,6 @@ class Compute:
raise ControllerError(f"Connection lost to {self._id} during {method} {action}")
return res.json
async def images(self, type):
"""
Return the list of images available for this type on the compute node.
"""
res = await self.http_query("GET", f"/{type}/images", timeout=None)
images = res.json
try:
if type in ["qemu", "dynamips", "iou"]:
images = sorted(images, key=itemgetter("filename"))
else:
images = sorted(images, key=itemgetter("image"))
except OSError as e:
raise ComputeError(f"Cannot list images: {str(e)}")
return images
async def list_files(self, project):
"""
List files in the project on computes