mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
VPCS reload
This commit is contained in:
1 parent
1a43ff118c
commit
8d3ea60404
18 files changed
+69
-22
No files matched your search
@@ -169,3 +169,21 @@ class VPCSHandler:
|
||||
vm = vpcs_manager.get_vm(request.match_info["uuid"])
|
||||
nio = vm.port_remove_nio_binding(int(request.match_info["port_id"]))
|
||||
response.set_status(204)
|
||||
|
||||
@classmethod
|
||||
@Route.post(
|
||||
r"/vpcs/{uuid}/reload",
|
||||
parameters={
|
||||
"uuid": "VPCS instance UUID",
|
||||
},
|
||||
status_codes={
|
||||
204: "VPCS reloaded",
|
||||
404: "VPCS instance doesn't exist"
|
||||
},
|
||||
description="Remove a NIO from a VPCS")
|
||||
def reload(request, response):
|
||||
|
||||
vpcs_manager = VPCS.instance()
|
||||
vm = vpcs_manager.get_vm(request.match_info["uuid"])
|
||||
nio = vm.reload()
|
||||
response.set_status(204)
|
||||
@@ -252,6 +252,15 @@ class VPCSVM(BaseVM):
|
||||
self._process = None
|
||||
self._started = False
|
||||
|
||||
@asyncio.coroutine
|
||||
def reload(self):
|
||||
"""
|
||||
Reload the VPCS process. (Stop / Start)
|
||||
"""
|
||||
|
||||
yield from self.stop()
|
||||
yield from self.start()
|
||||
|
||||
def _kill_process(self):
|
||||
"""Kill the process if running"""
|
||||
|
||||
@@ -271,7 +280,6 @@ class VPCSVM(BaseVM):
|
||||
Reads the standard output of the VPCS process.
|
||||
Only use when the process has been stopped or has crashed.
|
||||
"""
|
||||
# TODO: should be async
|
||||
output = ""
|
||||
if self._vpcs_stdout_file:
|
||||
try:
|
||||
|
||||
@@ -38,7 +38,7 @@ class Documentation(object):
|
||||
f.write('.. contents::\n')
|
||||
for method in handler_doc["methods"]:
|
||||
f.write('\n{} {}\n'.format(method["method"], path.replace("{", '**{').replace("}", "}**")))
|
||||
f.write('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n')
|
||||
f.write('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n')
|
||||
f.write('{}\n\n'.format(method["description"]))
|
||||
|
||||
if len(method["parameters"]) > 0:
|
||||
|
||||
Reference in new issue
Block a user