from flask import request, Response
from db.repository import Repository
from db.entities import connected_run
import datetime
#from db.entities import clusterset #REMOVE?

repo = Repository()


def get_connected_run():
    ''' Gets Run from the database.

        :returns: Returns Run objects from the DB
        :rtype: Dict{_id,datetime}
    '''  
    result = repo.get_connected_run()
    if result is None or len(result) == 0:        
        print("#### Response 404")
        return Response(status=404)
    else:
        return result
    

