Synchronizer Extension API
Synchronizer extension API
Global functions
synchronizer(config: dict)
Return an instance of a class that adheres to the synchronizer plug-in API (see below). muninn will pass the content of the
synchronizer:<name>section (minus themodulesetting) as a single positional argument to this function. The implementation of this function should only setup the configuration state and not initiate any network connections yet.
Methods
sync(self, archive: muninn.Archive, product_types: typing.List[str] = None, start: datetime.datetime = None,
end: datetime.datetime = None, force: bool = False)
A synchronizer object should have a
syncmethod that performs the catalogue sync. It should update the state of the catalogue of the archive based on the state of an external database. Synchronizations should be performed on a product type by product type basis. The global list of applicable product types can be hard-coded in the extension or provided as configuration to thesynchronizerglobal function. Thesyncmethod itself should limit itself to the list of product types given by theproduct_typesparameter if this parameter was set (and otherwise sync all product types from the internal global list). The sync should ideally be performed in chronological order, following the timestamps of modifications in the external database. Thestartandendparameters are meant to define the time range within the chronological timeline to synchronize. Thesyncmethod should only update the catalogue database by means of e.g.muninn.create_properties,muninn.update_properties, andmuninn.removecalls. It should explicitly not perform anymuninn.pullcalls. Theforceoption indicates that thesyncmethod should always call amuninn.update_propertiesfor entries that were already in the muninn catalogue. Any network activity should only happen within the scope of thissyncmethod. The synchronizer object should not keep any connection state active after the method returns.