mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Suspend for Docker nodes.
This commit is contained in:
1 parent
7ded71142f
commit
bd8816d14c
10 files changed
+48
-13
No files matched your search
@@ -188,7 +188,7 @@ class ATMSwitchHandler:
|
||||
400: "Invalid request",
|
||||
404: "Instance doesn't exist"
|
||||
},
|
||||
description="Suspend an ATM Relay switch")
|
||||
description="Suspend an ATM Relay switch (does nothing)")
|
||||
def suspend(request, response):
|
||||
|
||||
Dynamips.instance().get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
|
||||
@@ -168,7 +168,7 @@ class CloudHandler:
|
||||
400: "Invalid request",
|
||||
404: "Instance doesn't exist"
|
||||
},
|
||||
description="Suspend a cloud")
|
||||
description="Suspend a cloud (does nothing)")
|
||||
def suspend(request, response):
|
||||
|
||||
Builtin.instance().get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
|
||||
@@ -105,6 +105,24 @@ class DockerHandler:
|
||||
yield from container.stop()
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
r"/projects/{project_id}/docker/nodes/{node_id}/suspend",
|
||||
parameters={
|
||||
"project_id": "Project UUID",
|
||||
"node_id": "Node UUID"
|
||||
},
|
||||
status_codes={
|
||||
204: "Instance suspended",
|
||||
400: "Invalid request",
|
||||
404: "Instance doesn't exist"
|
||||
},
|
||||
description="Suspend a Docker container")
|
||||
def suspend(request, response):
|
||||
docker_manager = Docker.instance()
|
||||
container = docker_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
yield from container.pause()
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
r"/projects/{project_id}/docker/nodes/{node_id}/reload",
|
||||
parameters={
|
||||
|
||||
@@ -191,7 +191,7 @@ class EthernetHubHandler:
|
||||
400: "Invalid request",
|
||||
404: "Instance doesn't exist"
|
||||
},
|
||||
description="Suspend an Ethernet hub")
|
||||
description="Suspend an Ethernet hub (does nothing)")
|
||||
def suspend(request, response):
|
||||
|
||||
Dynamips.instance().get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
|
||||
@@ -204,7 +204,7 @@ class EthernetSwitchHandler:
|
||||
400: "Invalid request",
|
||||
404: "Instance doesn't exist"
|
||||
},
|
||||
description="Suspend an Ethernet switch")
|
||||
description="Suspend an Ethernet switch (does nothing)")
|
||||
def suspend(request, response):
|
||||
|
||||
Dynamips.instance().get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
|
||||
@@ -188,7 +188,7 @@ class FrameRelaySwitchHandler:
|
||||
400: "Invalid request",
|
||||
404: "Instance doesn't exist"
|
||||
},
|
||||
description="Suspend a Frame Relay switch")
|
||||
description="Suspend a Frame Relay switch (does nothing)")
|
||||
def suspend(request, response):
|
||||
|
||||
Dynamips.instance().get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
|
||||
@@ -207,6 +207,24 @@ class IOUHandler:
|
||||
yield from vm.stop()
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
r"/projects/{project_id}/iou/nodes/{node_id}/suspend",
|
||||
parameters={
|
||||
"project_id": "Project UUID",
|
||||
"node_id": "Node UUID"
|
||||
},
|
||||
status_codes={
|
||||
204: "Instance suspended",
|
||||
400: "Invalid request",
|
||||
404: "Instance doesn't exist"
|
||||
},
|
||||
description="Suspend an IOU instance (does nothing)")
|
||||
def suspend(request, response):
|
||||
|
||||
iou_manager = IOU.instance()
|
||||
iou_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
r"/projects/{project_id}/iou/nodes/{node_id}/reload",
|
||||
parameters={
|
||||
|
||||
@@ -166,7 +166,7 @@ class NatHandler:
|
||||
400: "Invalid request",
|
||||
404: "Instance doesn't exist"
|
||||
},
|
||||
description="Suspend a nat")
|
||||
description="Suspend a nat (does nothing)")
|
||||
def suspend(request, response):
|
||||
|
||||
Builtin.instance().get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
|
||||
@@ -184,16 +184,15 @@ class VPCSHandler:
|
||||
"node_id": "Node UUID"
|
||||
},
|
||||
status_codes={
|
||||
204: "Instance stopped",
|
||||
204: "Instance suspended",
|
||||
400: "Invalid request",
|
||||
404: "Instance doesn't exist"
|
||||
},
|
||||
description="Suspend a VPCS instance (stop it)")
|
||||
def stop(request, response):
|
||||
description="Suspend a VPCS instance (does nothing)")
|
||||
def suspend(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()
|
||||
vpcs_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
|
||||
Reference in new issue
Block a user