示例#1
0
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)
示例#2
0
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)
示例#3
0
 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