qunicorn_core.db.database_services package
Submodules
qunicorn_core.db.database_services.db_service module
- qunicorn_core.db.database_services.db_service.get_all_database_objects(database_object_class: Type[DbModel]) DbModelTypes
Gets all database objects of a table
- Arguments:
database_object_class - class of the database objects
- qunicorn_core.db.database_services.db_service.get_database_object_by_id(db_object_id: int, database_object_class: Type[DbModel]) DbModelType
Gets a database object
- Arguments:
db_object_id - id of the database object database_object_class - class of the database object
- qunicorn_core.db.database_services.db_service.get_session()
qunicorn_core.db.database_services.deployment_db_service module
- qunicorn_core.db.database_services.deployment_db_service.create(deployment: DeploymentDataclass) DeploymentDataclass
Creates a database job with the given circuit and saves it in the database
- qunicorn_core.db.database_services.deployment_db_service.get_all_deployments() list[DeploymentDataclass]
Gets all deployments from the database
- qunicorn_core.db.database_services.deployment_db_service.get_deployment_by_id(deployment_id: int) DeploymentDataclass
Gets the Deployment with the deployment_id from the database
qunicorn_core.db.database_services.device_db_service module
- qunicorn_core.db.database_services.device_db_service.get_all_devices() list[DeviceDataclass]
Gets all Devices from the DB
- qunicorn_core.db.database_services.device_db_service.get_device_by_id(device_id: int) DeviceDataclass
Get a device by id
- qunicorn_core.db.database_services.device_db_service.get_device_by_name(device_name: str) DeviceDataclass
Returns the default device of the provider with the name provider_name
- qunicorn_core.db.database_services.device_db_service.save_device_by_name(device: DeviceDataclass) DeviceDataclass
Updates device object in database if it exists and creates new entry if it doesn’t exist
qunicorn_core.db.database_services.job_db_service module
- qunicorn_core.db.database_services.job_db_service.create_database_job(job_core: JobCoreDto) JobDataclass
Creates a database job with the given circuit and saves it in the database
- qunicorn_core.db.database_services.job_db_service.delete_jobs_by_deployment_id(deployment_id: int) list[JobDataclass]
Gets the job with the deployment_id from the database
- qunicorn_core.db.database_services.job_db_service.get_all() list[JobDataclass]
Gets all Jobs from the database
- qunicorn_core.db.database_services.job_db_service.get_job_by_id(job_id: int) JobDataclass
Gets the job with the job_id from the database
- qunicorn_core.db.database_services.job_db_service.get_jobs_by_deployment_id(deployment_id: int) list[JobDataclass]
Gets the job with the deployment_id from the database
- qunicorn_core.db.database_services.job_db_service.return_exception_and_update_job(job_id: int, exception: Exception) Exception
Update job with id job_id in DB with error state and return the exception
- qunicorn_core.db.database_services.job_db_service.update_attribute(job_id: int, attribute_value, attribute_name)
Updates one attribute (attribute_name) of the job with the id job_id
- qunicorn_core.db.database_services.job_db_service.update_finished_job(job_id: int, results: list[ResultDataclass], job_state: JobState = JobState.FINISHED)
Updates the attributes state and results of the job with the id job_id
qunicorn_core.db.database_services.provider_db_service module
- qunicorn_core.db.database_services.provider_db_service.get_all_providers() list[ProviderDataclass]
Gets all Providers from the DB
- qunicorn_core.db.database_services.provider_db_service.get_provider_by_id(provider_id: int) ProviderDataclass
Get a provider by id
- qunicorn_core.db.database_services.provider_db_service.get_provider_by_name(provider_name: str) ProviderDataclass
Returns the provider with the name provider_name