device_manager.api.db ===================== .. py:module:: device_manager.api.db .. autoapi-nested-parse:: Definition of device database ORM models. Attributes ---------- .. autoapisummary:: device_manager.api.db.Base device_manager.api.db.postgres_user_filepath device_manager.api.db.postgres_password_filepath device_manager.api.db.postgres_db_name_filepath device_manager.api.db.postgres_user Classes ------- .. autoapisummary:: device_manager.api.db.Device Functions --------- .. autoapisummary:: device_manager.api.db.init_db Module Contents --------------- .. py:data:: Base :type: sqlalchemy.orm.decl_api.DeclarativeMeta .. py:data:: postgres_user_filepath :value: '/run/secrets/scanhub_database_postgres_user' .. py:data:: postgres_password_filepath :value: '/run/secrets/scanhub_database_postgres_password' .. py:data:: postgres_db_name_filepath :value: '/run/secrets/scanhub_database_postgres_db_name' .. py:data:: postgres_user .. py:function:: init_db() -> None Create database helper function. .. py:class:: Device Bases: :py:obj:`Base` Device ORM model. .. py:attribute:: __tablename__ :value: 'device' .. py:attribute:: id :type: sqlalchemy.orm.Mapped[uuid.UUID] .. py:attribute:: name :type: sqlalchemy.orm.Mapped[str] .. py:attribute:: description :type: sqlalchemy.orm.Mapped[str] .. py:attribute:: token_hash :type: sqlalchemy.orm.Mapped[str] .. py:attribute:: salt :type: sqlalchemy.orm.Mapped[str] .. py:attribute:: device_name :type: sqlalchemy.orm.Mapped[str] .. py:attribute:: serial_number :type: sqlalchemy.orm.Mapped[str] .. py:attribute:: status :type: sqlalchemy.orm.Mapped[scanhub_libraries.models.DeviceStatus] .. py:attribute:: manufacturer :type: sqlalchemy.orm.Mapped[str] .. py:attribute:: modality :type: sqlalchemy.orm.Mapped[str] .. py:attribute:: site :type: sqlalchemy.orm.Mapped[str] .. py:attribute:: parameter :type: sqlalchemy.orm.Mapped[dict] .. py:attribute:: datetime_created :type: sqlalchemy.orm.Mapped[datetime.datetime] .. py:attribute:: datetime_updated :type: sqlalchemy.orm.Mapped[datetime.datetime] .. py:method:: update(data: dict) -> None Update attributes of orm model. :param data {dict} -- Entries to be updated: