Beispiel #1
0
def get_analyses_report(**kwargs):
    """View brief report of the current system analyses status."""
    try:
        parse_dates(kwargs)
    except Exception as exc:
        return {'error': str(exc)}, 400
    return construct_analyses_report(**kwargs), 200
def get_analyses_report(ecosystem, from_date=None, to_date=None):
    if from_date:
        try:
            from_date = parse_datetime(from_date)
        except Exception as exc:
            return {"error": "Cannot parse string format for 'from_date': %s" % str(exc)}, 400

    if to_date:
        try:
            to_date = parse_datetime(to_date)
        except Exception as exc:
            return {"error": "Cannot parse string format for 'to_date': %s" % str(exc)}, 400

    return construct_analyses_report(ecosystem, from_date, to_date), 200