mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 22:41:12 +02:00
Some cleaning + move "/version" endpoint to "/server/version".
This commit is contained in:
1 parent
87f15eafe0
commit
cd07a99118
18 files changed
+70
-187
No files matched your search
@@ -228,7 +228,7 @@ class IOUHandler:
|
||||
iou_manager = IOU.instance()
|
||||
vm = iou_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
nio_type = request.json["type"]
|
||||
if nio_type not in ("nio_udp", "nio_tap", "nio_generic_ethernet"):
|
||||
if nio_type not in ("nio_udp", "nio_tap", "nio_ethernet", "nio_generic_ethernet"):
|
||||
raise HTTPConflict(text="NIO of type {} is not supported".format(nio_type))
|
||||
nio = iou_manager.create_nio(vm.iouyap_path, request.json)
|
||||
yield from vm.adapter_add_nio_binding(int(request.match_info["adapter_number"]), int(request.match_info["port_number"]), nio)
|
||||
|
||||
@@ -25,7 +25,7 @@ from aiohttp.web import HTTPConflict
|
||||
class VersionHandler:
|
||||
|
||||
@Route.get(
|
||||
r"/version",
|
||||
r"/server/version",
|
||||
description="Retrieve the server version number",
|
||||
output=VERSION_SCHEMA)
|
||||
def version(request, response):
|
||||
@@ -35,7 +35,7 @@ class VersionHandler:
|
||||
response.json({"version": __version__, "local": local_server})
|
||||
|
||||
@Route.post(
|
||||
r"/version",
|
||||
r"/server/version",
|
||||
description="Check if version is the same as the server",
|
||||
output=VERSION_SCHEMA,
|
||||
input=VERSION_SCHEMA,
|
||||
|
||||
Reference in new issue
Block a user