mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
12 files changed
+125
-221
No files matched your search
@@ -52,10 +52,10 @@ class ATMSwitchHandler:
|
||||
|
||||
# Use the Dynamips ATM switch to simulate this node
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = yield from dynamips_manager.create_device(request.json.pop("name"),
|
||||
node = yield from dynamips_manager.create_node(request.json.pop("name"),
|
||||
request.match_info["project_id"],
|
||||
request.json.get("node_id"),
|
||||
device_type="atm_switch",
|
||||
node_type="atm_switch",
|
||||
mappings=request.json.get("mappings"))
|
||||
response.set_status(201)
|
||||
response.json(node)
|
||||
@@ -76,7 +76,7 @@ class ATMSwitchHandler:
|
||||
def show(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
response.json(node)
|
||||
|
||||
@Route.put(
|
||||
@@ -97,7 +97,7 @@ class ATMSwitchHandler:
|
||||
def update(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(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 "mappings" in request.json:
|
||||
@@ -120,7 +120,7 @@ class ATMSwitchHandler:
|
||||
def delete(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
yield from dynamips_manager.delete_device(request.match_info["node_id"])
|
||||
yield from dynamips_manager.delete_node(request.match_info["node_id"])
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
@@ -137,7 +137,7 @@ class ATMSwitchHandler:
|
||||
description="Start an ATM switch")
|
||||
def start(request, response):
|
||||
|
||||
Dynamips.instance().get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
Dynamips.instance().get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
@@ -154,7 +154,7 @@ class ATMSwitchHandler:
|
||||
description="Stop an ATM switch")
|
||||
def stop(request, response):
|
||||
|
||||
Dynamips.instance().get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
Dynamips.instance().get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
@@ -171,7 +171,7 @@ class ATMSwitchHandler:
|
||||
description="Suspend an ATM Relay switch")
|
||||
def suspend(request, response):
|
||||
|
||||
Dynamips.instance().get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
Dynamips.instance().get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
@@ -193,7 +193,7 @@ class ATMSwitchHandler:
|
||||
def create_nio(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
nio = yield from dynamips_manager.create_nio(node, request.json)
|
||||
port_number = int(request.match_info["port_number"])
|
||||
yield from node.add_nio(nio, port_number)
|
||||
@@ -217,7 +217,7 @@ class ATMSwitchHandler:
|
||||
def delete_nio(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
port_number = int(request.match_info["port_number"])
|
||||
nio = yield from node.remove_nio(port_number)
|
||||
yield from nio.delete()
|
||||
@@ -241,7 +241,7 @@ class ATMSwitchHandler:
|
||||
def start_capture(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
port_number = int(request.match_info["port_number"])
|
||||
pcap_file_path = os.path.join(node.project.capture_working_directory(), request.json["capture_file_name"])
|
||||
yield from node.start_capture(port_number, pcap_file_path, request.json["data_link_type"])
|
||||
@@ -264,7 +264,7 @@ class ATMSwitchHandler:
|
||||
def stop_capture(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
port_number = int(request.match_info["port_number"])
|
||||
yield from node.stop_capture(port_number)
|
||||
response.set_status(204)
|
||||
@@ -73,10 +73,11 @@ class DynamipsVMHandler:
|
||||
request.match_info["project_id"],
|
||||
request.json.get("node_id"),
|
||||
request.json.get("dynamips_id"),
|
||||
platform,
|
||||
platform=platform,
|
||||
console=request.json.get("console"),
|
||||
aux=request.json.get("aux"),
|
||||
chassis=request.json.pop("chassis", default_chassis))
|
||||
chassis=request.json.pop("chassis", default_chassis),
|
||||
node_type="dynamips")
|
||||
|
||||
yield from dynamips_manager.update_vm_settings(vm, request.json)
|
||||
response.set_status(201)
|
||||
|
||||
@@ -53,19 +53,12 @@ class EthernetHubHandler:
|
||||
|
||||
# Use the Dynamips Ethernet hub to simulate this node
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = yield from dynamips_manager.create_device(request.json.pop("name"),
|
||||
node = yield from dynamips_manager.create_node(request.json.pop("name"),
|
||||
request.match_info["project_id"],
|
||||
request.json.get("node_id"),
|
||||
device_type="ethernet_hub",
|
||||
node_type="ethernet_hub",
|
||||
ports=request.json.get("ports_mapping"))
|
||||
|
||||
# On Linux, use the generic hub
|
||||
# builtin_manager = Builtin.instance()
|
||||
# node = yield from builtin_manager.create_node(request.json.pop("name"),
|
||||
# request.match_info["project_id"],
|
||||
# request.json.get("node_id"),
|
||||
# node_type="ethernet_hub")
|
||||
|
||||
response.set_status(201)
|
||||
response.json(node)
|
||||
|
||||
@@ -85,10 +78,8 @@ class EthernetHubHandler:
|
||||
def show(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
|
||||
# builtin_manager = Builtin.instance()
|
||||
# node = builtin_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
response.json(node)
|
||||
|
||||
@Route.put(
|
||||
@@ -109,14 +100,12 @@ class EthernetHubHandler:
|
||||
def update(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(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_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"])
|
||||
node.updated()
|
||||
response.json(node)
|
||||
|
||||
@@ -135,9 +124,7 @@ class EthernetHubHandler:
|
||||
def delete(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
yield from dynamips_manager.delete_device(request.match_info["node_id"])
|
||||
# builtin_manager = Builtin.instance()
|
||||
# yield from builtin_manager.delete_node(request.match_info["node_id"])
|
||||
yield from dynamips_manager.delete_node(request.match_info["node_id"])
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
@@ -154,7 +141,7 @@ class EthernetHubHandler:
|
||||
description="Start an Ethernet hub")
|
||||
def start(request, response):
|
||||
|
||||
Dynamips.instance().get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
Dynamips.instance().get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
@@ -171,7 +158,7 @@ class EthernetHubHandler:
|
||||
description="Stop an Ethernet hub")
|
||||
def stop(request, response):
|
||||
|
||||
Dynamips.instance().get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
Dynamips.instance().get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
@@ -188,7 +175,7 @@ class EthernetHubHandler:
|
||||
description="Suspend an Ethernet hub")
|
||||
def suspend(request, response):
|
||||
|
||||
Dynamips.instance().get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
Dynamips.instance().get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
@@ -210,15 +197,11 @@ class EthernetHubHandler:
|
||||
def create_nio(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
nio = yield from dynamips_manager.create_nio(node, request.json)
|
||||
port_number = int(request.match_info["port_number"])
|
||||
yield from node.add_nio(nio, port_number)
|
||||
|
||||
#builtin_manager = Builtin.instance()
|
||||
#node = builtin_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
#nio = yield from builtin_manager.create_nio(request.json["nio"])
|
||||
|
||||
response.set_status(201)
|
||||
response.json(nio)
|
||||
|
||||
@@ -239,9 +222,7 @@ class EthernetHubHandler:
|
||||
def delete_nio(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
#builtin_manager = Builtin.instance()
|
||||
#node = builtin_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
port_number = int(request.match_info["port_number"])
|
||||
nio = yield from node.remove_nio(port_number)
|
||||
yield from nio.delete()
|
||||
@@ -265,9 +246,7 @@ class EthernetHubHandler:
|
||||
def start_capture(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
#builtin_manager = Builtin.instance()
|
||||
#node = builtin_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
port_number = int(request.match_info["port_number"])
|
||||
pcap_file_path = os.path.join(node.project.capture_working_directory(), request.json["capture_file_name"])
|
||||
yield from node.start_capture(port_number, pcap_file_path, request.json["data_link_type"])
|
||||
@@ -290,9 +269,7 @@ class EthernetHubHandler:
|
||||
def stop_capture(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
#builtin_manager = Builtin.instance()
|
||||
#node = builtin_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
port_number = int(request.match_info["port_number"])
|
||||
yield from node.stop_capture(port_number)
|
||||
response.set_status(204)
|
||||
@@ -53,10 +53,10 @@ class EthernetSwitchHandler:
|
||||
|
||||
# Use the Dynamips Ethernet switch to simulate this node
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = yield from dynamips_manager.create_device(request.json.pop("name"),
|
||||
node = yield from dynamips_manager.create_node(request.json.pop("name"),
|
||||
request.match_info["project_id"],
|
||||
request.json.get("node_id"),
|
||||
device_type="ethernet_switch",
|
||||
node_type="ethernet_switch",
|
||||
ports=request.json.get("ports_mapping"))
|
||||
|
||||
# On Linux, use the generic switch
|
||||
@@ -85,7 +85,7 @@ class EthernetSwitchHandler:
|
||||
def show(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
|
||||
# builtin_manager = Builtin.instance()
|
||||
# node = builtin_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
@@ -109,7 +109,7 @@ class EthernetSwitchHandler:
|
||||
def update(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(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_mapping" in request.json:
|
||||
@@ -136,9 +136,7 @@ class EthernetSwitchHandler:
|
||||
def delete(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
yield from dynamips_manager.delete_device(request.match_info["node_id"])
|
||||
# builtin_manager = Builtin.instance()
|
||||
# yield from builtin_manager.delete_node(request.match_info["node_id"])
|
||||
yield from dynamips_manager.delete_node(request.match_info["node_id"])
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
@@ -155,7 +153,7 @@ class EthernetSwitchHandler:
|
||||
description="Start an Ethernet switch")
|
||||
def start(request, response):
|
||||
|
||||
Dynamips.instance().get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
Dynamips.instance().get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
@@ -172,7 +170,7 @@ class EthernetSwitchHandler:
|
||||
description="Stop an Ethernet switch")
|
||||
def stop(request, response):
|
||||
|
||||
Dynamips.instance().get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
Dynamips.instance().get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
@@ -189,7 +187,7 @@ class EthernetSwitchHandler:
|
||||
description="Suspend an Ethernet switch")
|
||||
def suspend(request, response):
|
||||
|
||||
Dynamips.instance().get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
Dynamips.instance().get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
@@ -211,7 +209,7 @@ class EthernetSwitchHandler:
|
||||
def create_nio(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
nio = yield from dynamips_manager.create_nio(node, request.json)
|
||||
port_number = int(request.match_info["port_number"])
|
||||
yield from node.add_nio(nio, port_number)
|
||||
@@ -240,7 +238,7 @@ class EthernetSwitchHandler:
|
||||
def delete_nio(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
#builtin_manager = Builtin.instance()
|
||||
#node = builtin_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
port_number = int(request.match_info["port_number"])
|
||||
@@ -266,7 +264,7 @@ class EthernetSwitchHandler:
|
||||
def start_capture(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
#builtin_manager = Builtin.instance()
|
||||
#node = builtin_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
port_number = int(request.match_info["port_number"])
|
||||
@@ -291,7 +289,7 @@ class EthernetSwitchHandler:
|
||||
def stop_capture(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
#builtin_manager = Builtin.instance()
|
||||
#node = builtin_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
port_number = int(request.match_info["port_number"])
|
||||
|
||||
@@ -52,10 +52,10 @@ class FrameRelaySwitchHandler:
|
||||
|
||||
# Use the Dynamips Frame Relay switch to simulate this node
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = yield from dynamips_manager.create_device(request.json.pop("name"),
|
||||
node = yield from dynamips_manager.create_node(request.json.pop("name"),
|
||||
request.match_info["project_id"],
|
||||
request.json.get("node_id"),
|
||||
device_type="frame_relay_switch",
|
||||
node_type="frame_relay_switch",
|
||||
mappings=request.json.get("mappings"))
|
||||
response.set_status(201)
|
||||
response.json(node)
|
||||
@@ -76,7 +76,7 @@ class FrameRelaySwitchHandler:
|
||||
def show(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
response.json(node)
|
||||
|
||||
@Route.put(
|
||||
@@ -97,7 +97,7 @@ class FrameRelaySwitchHandler:
|
||||
def update(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(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 "mappings" in request.json:
|
||||
@@ -120,7 +120,7 @@ class FrameRelaySwitchHandler:
|
||||
def delete(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
yield from dynamips_manager.delete_device(request.match_info["node_id"])
|
||||
yield from dynamips_manager.delete_node(request.match_info["node_id"])
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
@@ -137,7 +137,7 @@ class FrameRelaySwitchHandler:
|
||||
description="Start a Frame Relay switch")
|
||||
def start(request, response):
|
||||
|
||||
Dynamips.instance().get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
Dynamips.instance().get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
@@ -154,7 +154,7 @@ class FrameRelaySwitchHandler:
|
||||
description="Stop a Frame Relay switch")
|
||||
def stop(request, response):
|
||||
|
||||
Dynamips.instance().get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
Dynamips.instance().get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
@@ -171,7 +171,7 @@ class FrameRelaySwitchHandler:
|
||||
description="Suspend a Frame Relay switch")
|
||||
def suspend(request, response):
|
||||
|
||||
Dynamips.instance().get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
Dynamips.instance().get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
@@ -193,7 +193,7 @@ class FrameRelaySwitchHandler:
|
||||
def create_nio(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
nio = yield from dynamips_manager.create_nio(node, request.json)
|
||||
port_number = int(request.match_info["port_number"])
|
||||
yield from node.add_nio(nio, port_number)
|
||||
@@ -217,7 +217,7 @@ class FrameRelaySwitchHandler:
|
||||
def delete_nio(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
port_number = int(request.match_info["port_number"])
|
||||
nio = yield from node.remove_nio(port_number)
|
||||
yield from nio.delete()
|
||||
@@ -241,7 +241,7 @@ class FrameRelaySwitchHandler:
|
||||
def start_capture(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
port_number = int(request.match_info["port_number"])
|
||||
pcap_file_path = os.path.join(node.project.capture_working_directory(), request.json["capture_file_name"])
|
||||
yield from node.start_capture(port_number, pcap_file_path, request.json["data_link_type"])
|
||||
@@ -264,7 +264,7 @@ class FrameRelaySwitchHandler:
|
||||
def stop_capture(request, response):
|
||||
|
||||
dynamips_manager = Dynamips.instance()
|
||||
node = dynamips_manager.get_device(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
node = dynamips_manager.get_node(request.match_info["node_id"], project_id=request.match_info["project_id"])
|
||||
port_number = int(request.match_info["port_number"])
|
||||
yield from node.stop_capture(port_number)
|
||||
response.set_status(204)
|
||||
Reference in new issue
Block a user