genvid.toolbox.JobsAPI
- class genvid.toolbox.JobsAPI(parent_api: BaseHttpApiTool, **kwargs)
Bases:
BaseHttpApiTool
The jobs api. See Bastion API and Cluster API
New in version 1.12.0.
- NAME = 'logs-api'
The name of the logger for this tool. Must be redefined in children.
- get_job_definitions(timeout=0.0) dict
Get the list of all job definitions.
- Parameters:
timeout – The timeout in seconds.
New in version 1.12.0.
- update_job_definitions(jobs: dict, timeout=0.0) dict
Create or update the job’s definitions.
- Parameters:
jobs – The job definition.
timeout – The timeout in seconds.
New in version 1.12.0.
- get_job_definition(job_id: str, timeout=0.0) dict
Get a job definitions.
- Parameters:
job_id – The job ID.
timeout – The timeout in seconds.
New in version 1.12.0.
- add_job_definition(job_id: str, job: dict, timeout=0.0) dict
Create a job definitions.
- Parameters:
job_id – The job ID.
job – The job definition.
timeout – The timeout in seconds.
New in version 1.12.0.
- update_job_definition(job_id: str, job: dict, timeout=0.0) dict
Update a job definitions.
- Parameters:
job_id – The job ID.
job – The job definition.
timeout – The timeout in seconds.
New in version 1.12.0.
- delete_job_definitions(timeout=0.0) dict
Delete all job definitions.
- Parameters:
timeout – The timeout in seconds.
New in version 1.12.0.
- delete_job_definition(job_id: str, timeout=0.0) dict
Delete a job definitions.
- Parameters:
job_id – The job ID.
timeout – The timeout in seconds.
New in version 1.12.0.
- get_jobs_summary(timeout=0.0) List[dict]
Get the jobs summary for all jobs.
- Parameters:
timeout – The timeout in seconds.
- get_job_summary(job_id: str, timeout=0.0) List[dict]
Get a job summary
- Parameters:
job_id – The job ID.
timeout – The timeout in seconds.
- start_job(job_id: str, timeout=0.0, *, force: bool = False) List[dict]
Start or refresh a job.
- Parameters:
job_id – The job ID.
timeout – The timeout in seconds.
force – In case the job is already running, also update the task count. Elsewhere, the task counts will be preserved.
Changed in version 1.45.0: Allow the job to be refreshed and add the
force
parameter.
- stop_job(job_id: str, timeout=0.0, *, purge: bool = False) List[dict]
Stop a job
- Parameters:
job_id – The job ID.
timeout – The timeout in seconds.
purge – Immediately purge the job off Nomad.
Changed in version 1.45.0: Added the
purge
parameter.
- start_all_job(timeout=0.0, *, force: bool = False) List[dict]
Start all jobs
- Parameters:
timeout – The timeout in seconds.
force – In case a job is already running, also update the task count. Elsewhere, the task counts will be preserved.
Changed in version 1.45.0: Allow the jobs to be refreshed and add the
force
parameter.
- stop_all_job(timeout=0.0, *, purge: bool = False) List[dict]
Stop all jobs
- Parameters:
timeout – The timeout in seconds.
purge – Immediately purge the job off Nomad.
Changed in version 1.45.0: Added the
purge
parameter.
- update_job_count(job_id: str, task_group: str, count: int, timeout=0.0) List[dict]
Update job’s task group count by an increment or decrement
- Parameters:
job_id – The job ID
task_group – The task group.
count – The task group count delta. 0 to stop the job.
timeout – The timeout in seconds.
- class api_jobs.JobsAPI
Implementation of
genvid.toolbox.JobsAPI