bartender.db.dao.job_dao#
Attributes#
Classes#
Class for accessing job table. |
Module Contents#
- class bartender.db.dao.job_dao.JobDAO(session: bartender.db.dependencies.CurrentSession)#
Class for accessing job table.
- Parameters:
session (bartender.db.dependencies.CurrentSession) –
- session#
- async create_job(name: str | None, application: str, submitter: str, updated_on: datetime.datetime | None = None, created_on: datetime.datetime | None = None) int | None#
Add single job to session.
- Parameters:
name (Optional[str]) – name of a job.
application (str) – name of application to run job for.
submitter (str) – User who submitted the job.
updated_on (Optional[datetime.datetime]) – Datetime when job was last updated.
created_on (Optional[datetime.datetime]) – Datetime when job was created.
- Returns:
id of a job.
- Return type:
Optional[int]
- async get_all_jobs(limit: int, offset: int, user: str) list[bartender.db.models.job_model.Job]#
Get all job models of user with limit/offset pagination.
- Parameters:
- Returns:
stream of jobs.
- Return type:
- async get_job(jobid: int, user: str) bartender.db.models.job_model.Job#
Get specific job model.
- Parameters:
- Returns:
job model.
- Return type:
- async update_job_state(jobid: int, state: bartender.db.models.job_model.State) None#
Update state of a job.
- Parameters:
jobid (int) – name of job instance.
state (bartender.db.models.job_model.State) – new state of job instance.
- Return type:
None
- async update_internal_job_id(jobid: int, internal_job_id: str, destination: str) None#
Update internal id and destination of a job.
- bartender.db.dao.job_dao.CurrentJobDAO#