freezer.scheduler.freezer_scheduler module

class freezer.scheduler.freezer_scheduler.FreezerScheduler(apiclient, interval, job_path, concurrent_jobs=1, coordinator: SchedulerCoordinator | None = None)

Bases: object

create_backup_record(metadata_doc, project_id=None, user_credentials=None)

Create a backup record in freezer-api.

Parameters:
  • metadata_doc – dict containing backup metadata

  • project_id – optional project ID to scope the creation

  • user_credentials – dict containing user credentials/trust_id

Returns:

created backup_id string (or dict if API returns object)

create_job(job_doc)
delete_backup_record(backup_id, user_credentials=None)

Delete a backup record from freezer-api.

Parameters:
  • backup_id – string ID of the backup record to delete

  • user_credentials – dict containing user credentials/trust_id

end_session(session_id, job_id, session_tag, result)
filter_jobs(job_doc_list)

Filter jobs by supported capabilities.

Parameters:

job_doc_list (list[dict]) – list of jobs

Returns:

list of jobs

Return type:

list[dict]

get_jobs()
is_scheduled(job_id)
job_lock(job_id: str) AbstractContextManager[bool]

Always True in standalone mode; in clustered mode it reflects whether the per-job distributed lock was acquired.

owns_job(job_id: str) bool

Whether this scheduler should run the given job.

Always True in standalone mode. In clustered mode, only the member that owns the job on the coordination hash ring returns True.

poll()
process_agent_result(result_doc, project_id=None, user_credentials=None)

Process execution result payload returned by freezer-agent.

reload()
start()
start_session(session_id, job_id, session_tag)
stop()
update_job(job_id, job_doc, user_credentials=None)
update_job_metadata(job_id, job_doc, user_credentials=None)

Pushes to the API the updates the job_schedule, session_id and session_tag information of the job_doc. This avoids sending job_actions and causing 409 conflicts.

Parameters:
  • job_id – id of the job to modify

  • job_doc – dict containing the job information

  • user_credentials – dict containing user credentials

Returns:

None

upload_metadata(metadata_doc, project_id=None, user_credentials=None)

Upload or update backup metadata in freezer-api.

freezer.scheduler.freezer_scheduler.main()
freezer.scheduler.freezer_scheduler.update_auth_options(conf, client_opts)

Map options from the service_auth group onto a flat Namespace for freezerclient. Values from [service_auth] in the config file are used; CLI/env-var values (already resolved by oslo_config onto CONF.service_auth) naturally take precedence because oslo_config resolves them first.