mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Support listing images in subdirectories
It's a part of the OVA support: https://github.com/GNS3/gns3-gui/issues/700
This commit is contained in:
1 parent
dd7f6eb021
commit
034ac392b7
11 files changed
+84
-79
No files matched your search
@@ -20,12 +20,12 @@ import base64
|
||||
|
||||
from ...web.route import Route
|
||||
from ...schemas.nio import NIO_SCHEMA
|
||||
from ...schemas.vm import VM_LIST_IMAGES_SCHEMA
|
||||
from ...schemas.dynamips_vm import VM_CREATE_SCHEMA
|
||||
from ...schemas.dynamips_vm import VM_UPDATE_SCHEMA
|
||||
from ...schemas.dynamips_vm import VM_CAPTURE_SCHEMA
|
||||
from ...schemas.dynamips_vm import VM_OBJECT_SCHEMA
|
||||
from ...schemas.dynamips_vm import VM_CONFIGS_SCHEMA
|
||||
from ...schemas.dynamips_vm import VMS_LIST_SCHEMA
|
||||
from ...modules.dynamips import Dynamips
|
||||
from ...modules.dynamips.dynamips_error import DynamipsError
|
||||
from ...modules.project_manager import ProjectManager
|
||||
@@ -460,7 +460,7 @@ class DynamipsVMHandler:
|
||||
200: "List of Dynamips VM retrieved",
|
||||
},
|
||||
description="Retrieve the list of Dynamips VMS",
|
||||
output=VMS_LIST_SCHEMA)
|
||||
output=VM_LIST_IMAGES_SCHEMA)
|
||||
def list_vms(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
@@ -469,7 +469,7 @@ class DynamipsVMHandler:
|
||||
response.json(vms)
|
||||
|
||||
@Route.post(
|
||||
r"/dynamips/vms/{filename}",
|
||||
r"/dynamips/vms/{path}",
|
||||
status_codes={
|
||||
204: "Image uploaded",
|
||||
},
|
||||
@@ -478,5 +478,5 @@ class DynamipsVMHandler:
|
||||
def upload_vm(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
yield from dynamips_manager.write_image(request.match_info["filename"], request.content)
|
||||
yield from dynamips_manager.write_image(request.match_info["path"], request.content)
|
||||
response.set_status(204)
|
||||
@@ -26,7 +26,7 @@ from ...schemas.iou import IOU_UPDATE_SCHEMA
|
||||
from ...schemas.iou import IOU_OBJECT_SCHEMA
|
||||
from ...schemas.iou import IOU_CAPTURE_SCHEMA
|
||||
from ...schemas.iou import IOU_CONFIGS_SCHEMA
|
||||
from ...schemas.iou import IOU_LIST_VMS_SCHEMA
|
||||
from ...schemas.vm import VM_LIST_IMAGES_SCHEMA
|
||||
from ...modules.iou import IOU
|
||||
|
||||
|
||||
@@ -373,7 +373,7 @@ class IOUHandler:
|
||||
200: "List of IOU VM retrieved",
|
||||
},
|
||||
description="Retrieve the list of IOU VMS",
|
||||
output=IOU_LIST_VMS_SCHEMA)
|
||||
output=VM_LIST_IMAGES_SCHEMA)
|
||||
def list_vms(request, response):
|
||||
|
||||
iou_manager = IOU.instance()
|
||||
@@ -382,7 +382,7 @@ class IOUHandler:
|
||||
response.json(vms)
|
||||
|
||||
@Route.post(
|
||||
r"/iou/vms/{filename}",
|
||||
r"/iou/vms/{path}",
|
||||
status_codes={
|
||||
204: "Image uploaded",
|
||||
},
|
||||
@@ -391,5 +391,5 @@ class IOUHandler:
|
||||
def upload_vm(request, response):
|
||||
|
||||
iou_manager = IOU.instance()
|
||||
yield from iou_manager.write_image(request.match_info["filename"], request.content)
|
||||
yield from iou_manager.write_image(request.match_info["path"], request.content)
|
||||
response.set_status(204)
|
||||
@@ -26,8 +26,8 @@ from ...schemas.qemu import QEMU_CREATE_SCHEMA
|
||||
from ...schemas.qemu import QEMU_UPDATE_SCHEMA
|
||||
from ...schemas.qemu import QEMU_OBJECT_SCHEMA
|
||||
from ...schemas.qemu import QEMU_BINARY_LIST_SCHEMA
|
||||
from ...schemas.qemu import QEMU_LIST_IMAGES_SCHEMA
|
||||
from ...schemas.qemu import QEMU_IMAGE_CREATE_SCHEMA
|
||||
from ...schemas.vm import VM_LIST_IMAGES_SCHEMA
|
||||
from ...modules.qemu import Qemu
|
||||
from ...config import Config
|
||||
|
||||
@@ -348,7 +348,7 @@ class QEMUHandler:
|
||||
200: "List of Qemu images retrieved",
|
||||
},
|
||||
description="Retrieve the list of Qemu images",
|
||||
output=QEMU_LIST_IMAGES_SCHEMA)
|
||||
output=VM_LIST_IMAGES_SCHEMA)
|
||||
def list_vms(request, response):
|
||||
|
||||
qemu_manager = Qemu.instance()
|
||||
@@ -357,7 +357,7 @@ class QEMUHandler:
|
||||
response.json(vms)
|
||||
|
||||
@Route.post(
|
||||
r"/qemu/vms/{filename}",
|
||||
r"/qemu/vms/{path}",
|
||||
status_codes={
|
||||
204: "Image uploaded",
|
||||
},
|
||||
@@ -366,5 +366,5 @@ class QEMUHandler:
|
||||
def upload_vm(request, response):
|
||||
|
||||
qemu_manager = Qemu.instance()
|
||||
yield from qemu_manager.write_image(request.match_info["filename"], request.content)
|
||||
yield from qemu_manager.write_image(request.match_info["path"], request.content)
|
||||
response.set_status(204)
|
||||
Reference in new issue
Block a user