swh.storage.objstorage module#

class swh.storage.objstorage.ObjStorage(storage, objstorage_config: Dict | None)[source]#

Bases: object

Objstorage collaborator in charge of adding objects to the objstorage.

content_get(obj_id: bytes | HashDict) bytes | None[source]#

Retrieve data associated to the content from the objstorage

Parameters:

content – content identitier

Returns:

associated content’s data if any, None otherwise.

content_add(contents: Iterable[Content]) Dict[source]#

Add contents to the objstorage.

Parameters:

contents – List of contents to add1

Returns:

The summary dict of content and content bytes added to the objstorage.