swh.vault.api.client module#
- class swh.vault.api.client.RemoteVaultClient(url, api_exception=None, timeout=None, chunk_size=4096, reraise_exceptions=None, **kwargs)[source]#
Bases:
RPCClient
Client to the Software Heritage vault cache.
- backend_class#
alias of
VaultInterface
- reraise_exceptions: ClassVar[List[Type[Exception]]] = [<class 'swh.vault.exc.NotFoundExc'>]#
On server errors, if any of the exception classes in this list has the same name as the error name, then the exception will be instantiated and raised instead of a generic RemoteException.
- extra_type_decoders: Dict[str, Callable] = {'core_swhid': <bound method _BaseSWHID.from_string of <class 'swh.model.swhids.CoreSWHID'>>}#
Value of extra_decoders passed to json_loads or msgpack_loads to be able to deserialize more object types.
- extra_type_encoders: List[Tuple[type, str, Callable]] = [(<class 'swh.model.swhids.CoreSWHID'>, 'core_swhid', <class 'str'>)]#
Value of extra_encoders passed to json_dumps or msgpack_dumps to be able to serialize more object types.
- cook(bundle_type: str, swhid: CoreSWHID, email: Optional[str] = None) Dict[str, Any] #
Main entry point for cooking requests. This starts a cooking task if needed, and add the given e-mail to the notify list
- download_url(bundle_type: str, swhid: CoreSWHID, content_disposition: Optional[str] = None, expiry: Optional[timedelta] = None) Optional[str] #
Obtain bundle direct download link if the vault cache backend supports it.
- send_notif(bundle_type: str, swhid: CoreSWHID)#
Send all the e-mails in the notification list of a bundle