(taskid)
return jsonize({"success": True, "data": json_data_message, "error": json_errors_message})
Retrieve the data of a scan
Retrieve the data of a scan
Retrieve the data of a scan
def scan_data(taskid):
    """
    Retrieve the data of a scan
    """
    json_data_message = list()
    json_errors_message = list()

    if taskid not in DataStore.tasks:
        logger.warning("[%s] Invalid task ID provided to scan_data()" % taskid)
        return jsonize({"success": False, "message": "Invalid task ID"})

    # Read all data from the IPC database for the taskid
    for status, content_type, value in DataStore.current_db.execute(
            "SELECT status, content_type, value FROM data WHERE taskid = ? ORDER BY id ASC",
            (taskid,)):
        json_data_message.append(
            {"status": status, "type": content_type, "value": dejsonize(value)})

    # Read all error messages from the IPC database
    for error in DataStore.current_db.execute(
            "SELECT error FROM errors WHERE taskid = ? ORDER BY id ASC",
            (taskid,)):
        json_errors_message.append(error)

    logger.debug("[%s] Retrieved scan data and error messages" % taskid)
    return jsonize({"success": True, "data": json_data_message, "error": json_errors_message})
def scan_data ( taskid ) : json_data_message = list ( ) json_errors_message = list ( ) if taskid not in DataStore . tasks : logger . warning ( "[%s] Invalid task ID provided to scan_data()" % taskid ) return jsonize ( { "success" : False , "message" : "Invalid task ID" } ) # Read all data from the IPC database for the taskid for status , content_type , value in DataStore . current_db . execute ( "SELECT status, content_type, value FROM data WHERE taskid = ? ORDER BY id ASC" , ( taskid , ) ) : json_data_message . append ( { "status" : status , "type" : content_type , "value" : dejsonize ( value ) } ) # Read all error messages from the IPC database for error in DataStore . current_db . execute ( "SELECT error FROM errors WHERE taskid = ? ORDER BY id ASC" , ( taskid , ) ) : json_errors_message . append ( error ) logger . debug ( "[%s] Retrieved scan data and error messages" % taskid ) return jsonize ( { "success" : True , "data" : json_data_message , "error" : json_errors_message } )