Support to reset all console connections. Ref https://github.com/GNS3/gns3-server/issues/1619

This commit is contained in:
grossmj
2020-07-26 18:27:18 +09:30
parent 4acc457674
commit bdd703a0dc
17 changed files with 283 additions and 7 deletions

View File

@ -422,3 +422,23 @@ class VMwareHandler:
vmware_manager = VMware.instance()
vm = vmware_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
return await vm.start_websocket_console(request)
@Route.post(
r"/projects/{project_id}/vmware/nodes/{node_id}/console/reset",
description="Reset console",
parameters={
"project_id": "Project UUID",
"node_id": "Node UUID",
},
status_codes={
204: "Console has been reset",
400: "Invalid request",
404: "Instance doesn't exist",
409: "Container not started"
})
async def reset_console(request, response):
vmware_manager = VMware.instance()
vm = vmware_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
await vm.reset_console()
response.set_status(204)