swh.objstorage.backends.http module#

class swh.objstorage.backends.http.HTTPReadOnlyObjStorage(url=None, compression=None, **kwargs)[source]#

Bases: ObjStorage

Simple ObjStorage retrieving objects from an HTTP server.

For example, can be used to retrieve objects from S3:


cls: http url: https://softwareheritage.s3.amazonaws.com/content/

check_config(*, check_write)[source]#

Check the configuration for this object storage

add(content: bytes, obj_id: bytes | CompositeObjId, check_presence: bool = True) None[source]#
delete(obj_id: bytes | CompositeObjId)[source]#
restore(content: bytes, obj_id: bytes | CompositeObjId) None[source]#
list_content(last_obj_id: bytes | CompositeObjId | None = None, limit: int | None = 10000) Iterator[CompositeObjId][source]#
get(obj_id: bytes | CompositeObjId) bytes[source]#
download_url(obj_id: bytes | CompositeObjId, content_disposition: str | None = None, expiry: timedelta | None = None) str | None[source]#
check(obj_id: bytes | CompositeObjId) None[source]#