Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/interface.py
Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | def content_add(self, content: List[Content]) -> Dict: | ||||
Summary dict with the following keys and associated values: | Summary dict with the following keys and associated values: | ||||
content:add: New contents added | content:add: New contents added | ||||
content:add:bytes: Sum of the contents' length data | content:add:bytes: Sum of the contents' length data | ||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("content/update") | @remote_api_endpoint("content/update") | ||||
def content_update(self, content, keys=[]): | def content_update( | ||||
self, contents: List[Dict[str, Any]], keys: List[str] = [] | |||||
) -> None: | |||||
"""Update content blobs to the storage. Does nothing for unknown | """Update content blobs to the storage. Does nothing for unknown | ||||
contents or skipped ones. | contents or skipped ones. | ||||
Args: | Args: | ||||
content (iterable): iterable of dictionaries representing | content: iterable of dictionaries representing | ||||
individual pieces of content to update. Each dictionary has the | individual pieces of content to update. Each dictionary has the | ||||
following keys: | following keys: | ||||
- data (bytes): the actual content | - data (bytes): the actual content | ||||
- length (int): content length (default: -1) | - length (int): content length (default: -1) | ||||
- one key for each checksum algorithm in | - one key for each checksum algorithm in | ||||
:data:`swh.model.hashutil.ALGORITHMS`, mapped to the | :data:`swh.model.hashutil.ALGORITHMS`, mapped to the | ||||
corresponding checksum | corresponding checksum | ||||
▲ Show 20 Lines • Show All 1,182 Lines • Show Last 20 Lines |