swh.vault.cache module#

class swh.vault.cache.VaultCache(**objstorage)[source]#

Bases: object

The Vault cache is an object storage that stores Vault bundles.

This implementation computes sha1(‘<bundle_type>:<swhid>’) as the internal identifiers used in the underlying objstorage.

add(bundle_type, swhid: CoreSWHID, content) None[source]#
get(bundle_type, swhid: CoreSWHID) bytes[source]#
download_url(bundle_type, swhid: CoreSWHID, content_disposition: Optional[str] = None, expiry: Optional[timedelta] = None) Optional[str][source]#
delete(bundle_type, swhid: CoreSWHID)[source]#
is_cached(bundle_type, swhid: CoreSWHID) bool[source]#