mirror of
https://github.com/GNS3/gns3-server
synced 2025-01-01 11:40:56 +00:00
parent
1d70a18b11
commit
6e7f6a94ec
@ -452,7 +452,7 @@ class Compute:
|
|||||||
elif response.status == 403:
|
elif response.status == 403:
|
||||||
raise aiohttp.web.HTTPForbidden(text=msg)
|
raise aiohttp.web.HTTPForbidden(text=msg)
|
||||||
elif response.status == 404:
|
elif response.status == 404:
|
||||||
raise aiohttp.web.HTTPNotFound(text=msg)
|
raise aiohttp.web.HTTPNotFound(text="{} {} not found".format(method, path))
|
||||||
elif response.status == 409:
|
elif response.status == 409:
|
||||||
try:
|
try:
|
||||||
raise ComputeConflict(json.loads(body))
|
raise ComputeConflict(json.loads(body))
|
||||||
|
@ -159,6 +159,25 @@ class VPCSHandler:
|
|||||||
yield from vm.stop()
|
yield from vm.stop()
|
||||||
response.set_status(204)
|
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(
|
@Route.post(
|
||||||
r"/projects/{project_id}/vpcs/nodes/{node_id}/reload",
|
r"/projects/{project_id}/vpcs/nodes/{node_id}/reload",
|
||||||
parameters={
|
parameters={
|
||||||
|
Loading…
Reference in New Issue
Block a user