Suspend link

This commit is contained in:
Julien Duponchelle committed 2017-07-19 17:30:25 +02:00
1 parent bce9c61e41
commit 5fd842e54d
7 files changed
+162 -9

No files matched your search

@@ -62,7 +62,10 @@ class LinkHandler:
project = yield from Controller.instance().get_loaded_project(request.match_info["project_id"])
link = yield from project.add_link()
yield from link.update_filters(request.json.get("filters", {}))
if "filters" in request.json:
yield from link.update_filters(request.json["filters"])
if "suspend" in request.json:
yield from link.update_suspend(request.json["suspend"])
try:
for node in request.json["nodes"]:
yield from link.add_node(project.get_node(node["node_id"]),
@@ -110,7 +113,10 @@ class LinkHandler:
project = yield from Controller.instance().get_loaded_project(request.match_info["project_id"])
link = project.get_link(request.match_info["link_id"])
yield from link.update_filters(request.json.get("filters", {}))
if "filters" in request.json:
yield from link.update_filters(request.json["filters"])
if "suspend" in request.json:
yield from link.update_suspend(request.json["suspend"])
if "nodes" in request.json:
yield from link.update_nodes(request.json["nodes"])
response.set_status(201)