mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-22 08:50:09 +00:00
Add controller endpoints to get VirtualBox VMs, VMware VMs and Docker images
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user