mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
Support duplicate for Docker
Ref https://github.com/GNS3/gns3-gui/issues/1065
This commit is contained in:
2 files changed
+36
-2
No files matched your search
@@ -141,6 +141,26 @@ class DockerHandler:
|
||||
yield from container.delete()
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
r"/projects/{project_id}/docker/nodes/{node_id}/duplicate",
|
||||
parameters={
|
||||
"project_id": "Project UUID",
|
||||
"node_id": "Node UUID"
|
||||
},
|
||||
status_codes={
|
||||
201: "Instance duplicated",
|
||||
404: "Instance doesn't exist"
|
||||
},
|
||||
description="Duplicate a Docker instance")
|
||||
def duplicate(request, response):
|
||||
|
||||
new_node = yield from Docker.instance().duplicate_node(
|
||||
request.match_info["node_id"],
|
||||
request.json["destination_node_id"]
|
||||
)
|
||||
response.set_status(201)
|
||||
response.json(new_node)
|
||||
|
||||
@Route.post(
|
||||
r"/projects/{project_id}/docker/nodes/{node_id}/pause",
|
||||
parameters={
|
||||
|
||||
Reference in new issue
Block a user