mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
API for creating a qemu disk image
This commit is contained in:
1 parent
5d8c90d138
commit
5b0c36c0d6
6 files changed
+123
-60
No files matched your search
@@ -316,6 +316,21 @@ class QEMUHandler:
|
||||
binaries = yield from Qemu.img_binary_list()
|
||||
response.json(binaries)
|
||||
|
||||
@classmethod
|
||||
@Route.post(
|
||||
r"/qemu/img",
|
||||
status_codes={
|
||||
201: "Image created",
|
||||
},
|
||||
description="Create a Qemu image"
|
||||
)
|
||||
def create_img(request, response):
|
||||
|
||||
qemu_img = request.json.pop("qemu_img")
|
||||
path = request.json.pop("path")
|
||||
yield from Qemu.instance().create_disk(qemu_img, path, request.json)
|
||||
response.set_status(201)
|
||||
|
||||
@Route.get(
|
||||
r"/qemu/vms",
|
||||
status_codes={
|
||||
|
||||
Reference in new issue
Block a user