Ejemplo n.º 1
0
def general_endpoint_api_list(endpoint_name):
    endpoint = MongoConn.get_endpoints_col()

    ept = endpoint.find_one({'endpoint_name': endpoint_name})

    if ept is not None:
        collection_list = MongoConn.get_collection(ept['collection_list'])

        collections = list(collection_list.find())

        return JSONUtils.JSONEncoder().encode(collections)

    else:
        msg = {
            'result': 'failed',
            'msg': "Endpoint " + endpoint_name + " does not exist"
        }

    return jsonify(msg)
Ejemplo n.º 2
0
def db_select():
    json = request.json

    rows = PostgreConn.db_table_select(json)

    return JSONUtils.JSONEncoder().encode(rows)
Ejemplo n.º 3
0
def admin_endpoint_api_list():
    endpoint = MongoConn.get_endpoints_col()

    endpoints = list(endpoint.find())

    return JSONUtils.JSONEncoder().encode(endpoints)
Ejemplo n.º 4
0
def admin_users_api_list():
    user = MongoConn.get_user_col()

    users = list(user.find())

    return JSONUtils.JSONEncoder().encode(users)