swh.vault.interface module

class swh.vault.interface.VaultInterface(*args, **kwds)[source]

Bases: typing_extensions.Protocol

Backend Interface for the Software Heritage vault.

fetch(bundle_type: str, swhid: swh.model.swhids.CoreSWHID) Optional[bytes][source]

Fetch information from a bundle

cook(bundle_type: str, swhid: swh.model.swhids.CoreSWHID, email: Optional[str] = None) Dict[str, Any][source]

Main entry point for cooking requests. This starts a cooking task if needed, and add the given e-mail to the notify list

progress(bundle_type: str, swhid: swh.model.swhids.CoreSWHID)[source]
set_progress(bundle_type: str, swhid: swh.model.swhids.CoreSWHID, progress: str) None[source]

Set the cooking progress of a bundle

set_status(bundle_type: str, swhid: swh.model.swhids.CoreSWHID, status: str) bool[source]

Set the cooking status of a bundle

put_bundle(bundle_type: str, swhid: swh.model.swhids.CoreSWHID, bundle)[source]

Store bundle in vault cache

send_notif(bundle_type: str, swhid: swh.model.swhids.CoreSWHID)[source]

Send all the e-mails in the notification list of a bundle

batch_cook(batch: List[Tuple[str, str]]) int[source]

Cook a batch of bundles and returns the cooking id.

batch_progress(batch_id: int) Dict[str, Any][source]

Fetch information from a batch of bundles