mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-12 19:38:57 +00:00
parent
1d70a18b11
commit
6e7f6a94ec
@ -452,7 +452,7 @@ class Compute:
|
||||
elif response.status == 403:
|
||||
raise aiohttp.web.HTTPForbidden(text=msg)
|
||||
elif response.status == 404:
|
||||
raise aiohttp.web.HTTPNotFound(text=msg)
|
||||
raise aiohttp.web.HTTPNotFound(text="{} {} not found".format(method, path))
|
||||
elif response.status == 409:
|
||||
try:
|
||||
raise ComputeConflict(json.loads(body))
|
||||
|
@ -159,6 +159,25 @@ class VPCSHandler:
|
||||
yield from vm.stop()
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
r"/projects/{project_id}/vpcs/nodes/{node_id}/suspend",
|
||||
parameters={
|
||||
"project_id": "Project UUID",
|
||||
"node_id": "Node UUID"
|
||||
},
|
||||
status_codes={
|
||||
204: "Instance stopped",
|
||||
400: "Invalid request",
|
||||
404: "Instance doesn't exist"
|
||||
},
|
||||
description="Suspend a VPCS instance (stop it)")
|
||||
def stop(request, response):
|
||||
|
||||
vpcs_manager = VPCS.instance()
|
||||
vm = vpcs_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
yield from vm.stop()
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
r"/projects/{project_id}/vpcs/nodes/{node_id}/reload",
|
||||
parameters={
|
||||
|
Loading…
Reference in New Issue
Block a user