Move the generation of the list of ports to the server

Ref #676
This commit is contained in:
Julien Duponchelle committed 2016-09-14 15:21:37 +02:00
1 parent f06c00fdb8
commit 2f0e2260ab
50 files changed
+1347 -240

No files matched your search

@@ -55,7 +55,7 @@ class CloudHandler:
request.match_info["project_id"],
request.json.get("node_id"),
node_type="cloud",
ports=request.json.get("ports"))
ports=request.json.get("ports_mapping"))
response.set_status(201)
response.json(node)
@@ -57,7 +57,7 @@ class EthernetHubHandler:
request.match_info["project_id"],
request.json.get("node_id"),
device_type="ethernet_hub",
ports=request.json.get("ports"))
ports=request.json.get("ports_mapping"))
# On Linux, use the generic hub
# builtin_manager = Builtin.instance()
@@ -112,8 +112,8 @@ class EthernetHubHandler:
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
if "name" in request.json and node.name != request.json["name"]:
yield from node.set_name(request.json["name"])
if "ports" in request.json:
node.ports = request.json["ports"]
if "ports_mapping" in request.json:
node.ports_mapping = request.json["ports_mapping"]
# builtin_manager = Builtin.instance()
# node = builtin_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
@@ -57,7 +57,7 @@ class EthernetSwitchHandler:
request.match_info["project_id"],
request.json.get("node_id"),
device_type="ethernet_switch",
ports=request.json.get("ports"))
ports=request.json.get("ports_mapping"))
# On Linux, use the generic switch
# builtin_manager = Builtin.instance()
@@ -112,8 +112,8 @@ class EthernetSwitchHandler:
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
if "name" in request.json and node.name != request.json["name"]:
yield from node.set_name(request.json["name"])
if "ports" in request.json:
node.ports = request.json["ports"]
if "ports_mapping" in request.json:
node.ports_mapping = request.json["ports_mapping"]
# builtin_manager = Builtin.instance()
# node = builtin_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
@@ -55,7 +55,7 @@ class NatHandler:
request.match_info["project_id"],
request.json.get("node_id"),
node_type="nat",
ports=request.json.get("ports"))
ports=request.json.get("ports_mapping"))
response.set_status(201)
response.json(node)