swh.vault.interface module

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

Bases: typing_extensions.Protocol

Backend Interface for the Software Heritage vault.

fetch(obj_type: str, obj_id: Union[str, bytes]) → Dict[str, Any][source]

Fetch information from a bundle

cook(obj_type: str, obj_id: Union[str, bytes], 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(obj_type: str, obj_id: Union[str, bytes])[source]
set_progress(obj_type: str, obj_id: Union[str, bytes], progress: str) → None[source]

Set the cooking progress of a bundle

set_status(obj_type: str, obj_id: Union[str, bytes], status: str) → None[source]

Set the cooking status of a bundle

put_bundle(obj_type: str, obj_id: Union[str, bytes], bundle)[source]

Store bundle in vault cache

send_notif(obj_type: str, obj_id: Union[str, bytes])[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