swh.storage.objstorage module

class swh.storage.objstorage.ObjStorage(objstorage_config: Dict)[source]

Bases: object

Objstorage collaborator in charge of adding objects to the objstorage.

content_get(obj_id: bytes) → Optional[bytes][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[swh.model.model.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.