summaryrefslogtreecommitdiff
path: root/src/server/rz_api.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/rz_api.py')
-rw-r--r--src/server/rz_api.py75
1 files changed, 0 insertions, 75 deletions
diff --git a/src/server/rz_api.py b/src/server/rz_api.py
index f2fb9936..2217e4e2 100644
--- a/src/server/rz_api.py
+++ b/src/server/rz_api.py
@@ -41,81 +41,6 @@ def __common_exec(op, on_success=common_resp_handle, on_error=common_resp_handle
log.error(traceback.print_exc())
return on_error(error='error occurred')
-def load_node_set_by_id_attr():
- """
- load node-set by ID attribute
-
- @param id_set: list of node ids to match id attribute against
- @return: a list of nodes whose id attribute matches 'id' or
- an empty list if the requested node is not found
- @raise exception: on error
- """
- req_json = request.get_json()
- id_set = req_json['id_set']
-
- __sanitize_input(id_set)
-
- return __load_node_set_by_id_attr_common(id_set)
-
-def __load_node_set_by_id_attr_common(id_set):
- """
- @param f_k: optional attribute filter key
- @param f_vset: possible key values to match against
- """
- op = DBO_match_node_set_by_id_attribute(id_set=id_set)
- try:
- n_set = db_ctl.exec_op(op)
- return common_resp_handle(data=n_set)
- except Exception as e:
- log.exception(e)
- return common_resp_handle(error='unable to load node with ids: {0}'.format(id_set))
-
-def match_node_set_by_attr_filter_map(attr_filter_map):
- """
- @param attr_filter_map
-
- @return: a set of node DB id's
- """
- op = DBO_match_node_id_set(attr_filter_map)
- return __common_exec(op)
-
-def load_link_set_by_link_ptr_set():
-
- def deserialize_param_set(param_json):
- l_ptr_set_raw = param_json['link_ptr_set']
-
- __sanitize_input(l_ptr_set_raw)
-
- l_ptr_set = []
- for lptr_dict in l_ptr_set_raw:
- src_id = lptr_dict.get('__src_id')
- dst_id = lptr_dict.get('__dst_id')
- l_ptr_set += [Link.Link_Ptr(src_id=src_id, dst_id=dst_id) ]
-
- return l_ptr_set
-
- l_ptr_set = deserialize_param_set(request.get_json())
-
- op = DBO_load_link_set.init_from_link_ptr_set(l_ptr_set)
- return __common_exec(op)
-
-def diff_commit__set():
- """
- commit a diff set
- """
- def sanitize_input(req):
- diff_set_dict = req.get_json()['diff_set']
- topo_diff_dict = diff_set_dict['__diff_set_topo'][0]
- topo_diff = Topo_Diff.from_json_dict(topo_diff_dict)
-
- sanitize_input__topo_diff(topo_diff)
- return topo_diff;
-
- topo_diff = sanitize_input(request)
-
- op = DBO_diff_commit__topo(topo_diff)
- return __common_exec(op)
-
def index():
# fetch rz_username for welcome message