Beispiel #1
0
def get_tasks(
    job_id: int,
    dao: Dao = Depends(get_dao),
    status: List[TaskStatus] = Query(
        [TaskStatus.created, TaskStatus.pending, TaskStatus.running]),
    auth: authorization.Rules = Depends(get_rules),
    skip: int = 0,
    limit: int = PAGINATION_LIMIT,
):
    auth.assert_jobs()
    return dao.get_tasks(job_id, status, skip, limit)
Beispiel #2
0
def get_tasks(
    job_id: int,
    dao: Dao = Depends(get_dao),
    status: List[TaskStatus] = Query(
        [TaskStatus.created, TaskStatus.pending, TaskStatus.running]
    ),
    auth: authorization.Rules = Depends(get_rules),
    skip: int = 0,
    limit: int = PAGINATION_LIMIT,
    job: job_db_models.Job = Depends(get_job_or_fail),
):
    auth.assert_jobs(owner_id=job.owner_id)
    return dao.get_tasks(job.id, status, skip, limit)