Esempio n. 1
0
def save_data():
    logger.info(f'Saving data...')

    content = request.get_json()
    uuid = data_store.save(content['data'])
    logger.info(f"Data saved with UUID '{uuid}' sucessfuly")

    return jsonify({"status": "sucess", "message": "data saved sucessfuly", "uuid": uuid})
Esempio n. 2
0
def save_data():
    logger.info(f"Saving data...")

    content = request.get_json()

    uuid = data_store.save(content["data"])

    logger.info(f"Data saved with uuid '{uuid}' succesfully")

    return jsonify({"status": "success", "message": "data saved with succesfully", "uuid": uuid})
Esempio n. 3
0
def save_data():
    logger.info('Saving data...')

    content = request.get_json()

    uuid = data_store.save(content['data'])

    logger.info(f'Data saved with UUID `{uuid}` successfully')

    return jsonify({
        'status': 'success',
        'message': 'data saved successfully',
        'uuid': uuid
    })
Esempio n. 4
0
def save_data():
    # configuração do log
    logger.info(f"Saving Data...")

    # conteúdo da requisição (no formato json)
    content = request.get_json()

    # armazenamento dos dados (mais especificamente, das informações contidas no campo "data")
    uuid = data_store.save(content["data"])
        # o "data_store" retornará um "uuid" (identificador do dado salvo na API)

    logger.info(f"Data saved with wid '{uuid}' successfully")

    return jsonify({"status": "success", "message": "data saved successfully", "uuid": uuid})
Esempio n. 5
0
def save_data():
    # setting log for this action
    logger.info(f"Saving data...")

    # transform content requisition to json
    content = request.get_json()

    # save in a module just the "data" field
    # The uuid of the data
    uuid = data_store.save(content["data"])

    # set log for las action
    logger.info(f"Data saved with UUID '{uuid}' successfully")

    # define information to be returned
    return jsonify({"status": "success",
                    "message": "data saved successfully",
                    "uuid": uuid})