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)
def db_select(): json = request.json rows = PostgreConn.db_table_select(json) return JSONUtils.JSONEncoder().encode(rows)
def admin_endpoint_api_list(): endpoint = MongoConn.get_endpoints_col() endpoints = list(endpoint.find()) return JSONUtils.JSONEncoder().encode(endpoints)
def admin_users_api_list(): user = MongoConn.get_user_col() users = list(user.find()) return JSONUtils.JSONEncoder().encode(users)