mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-24 23:16:44 +00:00
Fix CORS response on node deletion, Fixes: #1446
This commit is contained in:
parent
2764828f38
commit
249b2255f6
@ -108,6 +108,23 @@ class NodeHandler:
|
|||||||
response.set_status(200)
|
response.set_status(200)
|
||||||
response.json(node)
|
response.json(node)
|
||||||
|
|
||||||
|
@Route.delete(
|
||||||
|
r"/projects/{project_id}/nodes/{node_id}",
|
||||||
|
parameters={
|
||||||
|
"project_id": "Project UUID",
|
||||||
|
"node_id": "Node UUID"
|
||||||
|
},
|
||||||
|
status_codes={
|
||||||
|
204: "Instance deleted",
|
||||||
|
400: "Invalid request",
|
||||||
|
404: "Instance doesn't exist"
|
||||||
|
},
|
||||||
|
description="Delete a node instance")
|
||||||
|
async def delete(request, response):
|
||||||
|
project = await Controller.instance().get_loaded_project(request.match_info["project_id"])
|
||||||
|
await project.delete_node(request.match_info["node_id"])
|
||||||
|
response.set_status(204)
|
||||||
|
|
||||||
@Route.post(
|
@Route.post(
|
||||||
r"/projects/{project_id}/nodes/start",
|
r"/projects/{project_id}/nodes/start",
|
||||||
parameters={
|
parameters={
|
||||||
@ -291,23 +308,6 @@ class NodeHandler:
|
|||||||
response.json(node)
|
response.json(node)
|
||||||
response.set_status(200)
|
response.set_status(200)
|
||||||
|
|
||||||
@Route.delete(
|
|
||||||
r"/projects/{project_id}/nodes/{node_id}",
|
|
||||||
parameters={
|
|
||||||
"project_id": "Project UUID",
|
|
||||||
"node_id": "Node UUID"
|
|
||||||
},
|
|
||||||
status_codes={
|
|
||||||
204: "Instance deleted",
|
|
||||||
400: "Invalid request",
|
|
||||||
404: "Instance doesn't exist"
|
|
||||||
},
|
|
||||||
description="Delete a node instance")
|
|
||||||
async def delete(request, response):
|
|
||||||
project = await Controller.instance().get_loaded_project(request.match_info["project_id"])
|
|
||||||
await project.delete_node(request.match_info["node_id"])
|
|
||||||
response.set_status(204)
|
|
||||||
|
|
||||||
@Route.get(
|
@Route.get(
|
||||||
r"/projects/{project_id}/nodes/{node_id}/links",
|
r"/projects/{project_id}/nodes/{node_id}/links",
|
||||||
parameters={
|
parameters={
|
||||||
|
Loading…
Reference in New Issue
Block a user