def cluster_list(): """List clusters with the filter e.g., GET /clusters?consensus_plugin=pbft Return objs of the clusters. """ request_debug(r, logger) f = {} if r.method == 'GET': f.update(r.args.to_dict()) elif r.method == 'POST': f.update(request_json_body(r)) logger.info(f) result = cluster_handler.list(filter_data=f) logger.error(result) return make_ok_response(data=result)
def cluster_list(): """List clusters with the filter e.g., GET /clusters?consensus_plugin=pbft Return objs of the clusters. """ request_debug(r, logger) f = {} if r.method == 'GET': f.update(r.args.to_dict()) elif r.method == 'POST': f.update(request_json_body(r)) logger.info(f) result = cluster_handler.list(filter_data=f) logger.error(result) return make_ok_resp(data=result)
def make_response_invalid(msg=""): response_fail["error"] = msg or "Invalid request data" response_fail["data"] = request_json_body(r) return jsonify(response_fail), CODE_BAD_REQUEST