@get('/scan/<taskid>/data')
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'})
 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)})
 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})

@ get ( '/scan/<taskid>/data' ) 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' } ) 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 ) } ) 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 } )
retrieve the data of a scan .