Пример #1
0
async def do_delete_table_api(table_name: str = None):
    try:
        index_client, conn, cursor = init_conn()
        status = do_delete_table(index_client, conn, cursor, table_name)
        return "{}".format(status)
    except Exception as e:
        logging.error(e)
        return "Error with {}".format(e), 400
Пример #2
0
def do_delete_table_api():
    args = reqparse.RequestParser(). \
        add_argument('Table', type=str). \
        parse_args()
    try:
        index_client, conn, cursor = init_conn()
        table_name = args['Table']
        status = do_delete_table(index_client, conn, cursor, table_name)
        return "{}".format(status)
    except Exception as e:
        write_log(e, 1)
        return "Error with {}".format(e), 400