cowbird.database.stores ======================= .. py:module:: cowbird.database.stores .. autoapi-nested-parse:: Stores to read/write data to from/to `MongoDB` using pymongo. Attributes ---------- .. autoapisummary:: cowbird.database.stores.LOGGER Classes ------- .. autoapisummary:: cowbird.database.stores.StoreInterface cowbird.database.stores.MongodbStore cowbird.database.stores.MonitoringStore Module Contents --------------- .. py:data:: LOGGER .. py:class:: StoreInterface Bases: :py:obj:`object` Check that the store implementation defines its type and index_fields. .. py:attribute:: type :type: str :value: None .. py:attribute:: index_fields :type: List[str] :value: [] .. py:class:: MongodbStore(collection: pymongo.collection.Collection, *_: Any, **__: Any) Base class extended by all concrete store implementations. Validate and hold the collection for all the implementation. .. py:attribute:: collection :type: pymongo.collection.Collection .. py:method:: get_args_kwargs(*args: Any, **kwargs: Any) -> Tuple[Tuple[Any, Ellipsis], Dict[str, Any]] :classmethod: Filters :class:`MongodbStore`-specific arguments to safely pass them down its ``__init__``. .. py:class:: MonitoringStore(*args: Any, **kwargs: Any) Bases: :py:obj:`StoreInterface`, :py:obj:`MongodbStore` Registry for monitoring instances. Uses `MongoDB` to store what is monitored and by whom. Init the store used to save monitors. .. py:attribute:: type :value: 'monitors' .. py:attribute:: index_fields :value: ['callback', 'path'] .. py:method:: save_monitor(monitor: cowbird.monitoring.monitor.Monitor) -> None Stores Monitor in `MongoDB` storage. .. py:method:: delete_monitor(monitor: cowbird.monitoring.monitor.Monitor) -> None Removes Monitor from `MongoDB` storage. .. py:method:: list_monitors() -> List[cowbird.monitoring.monitor.Monitor] Lists all Monitor in `MongoDB` storage. .. py:method:: clear_services(drop: bool = True) -> None Removes all Monitor from `MongoDB` storage.