Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/interface.py
Show First 20 Lines • Show All 171 Lines • ▼ Show 20 Lines | ) -> Iterable[Optional[Dict[str, bytes]]]: | ||||
- sha1 (bytes): content id | - sha1 (bytes): content id | ||||
- data (bytes): content's raw data | - data (bytes): content's raw data | ||||
""" | """ | ||||
... | ... | ||||
@deprecated | @deprecated | ||||
@remote_api_endpoint("content/range") | @remote_api_endpoint("content/range") | ||||
def content_get_range(self, start, end, limit=1000): | def content_get_range( | ||||
self, start: bytes, end: bytes, limit: int = 1000 | |||||
) -> Dict[str, Any]: | |||||
"""Retrieve contents within range [start, end] bound by limit. | """Retrieve contents within range [start, end] bound by limit. | ||||
Note that this function may return more than one blob per hash. The | Note that this function may return more than one blob per hash. The | ||||
limit is enforced with multiplicity (ie. two blobs with the same hash | limit is enforced with multiplicity (ie. two blobs with the same hash | ||||
will count twice toward the limit). | will count twice toward the limit). | ||||
Args: | Args: | ||||
**start** (bytes): Starting identifier range (expected smaller | **start**: Starting identifier range (expected smaller | ||||
than end) | than end) | ||||
**end** (bytes): Ending identifier range (expected larger | **end**: Ending identifier range (expected larger | ||||
than start) | than start) | ||||
**limit** (int): Limit result (default to 1000) | **limit**: Limit result (default to 1000) | ||||
Returns: | Returns: | ||||
a dict with keys: | a dict with keys: | ||||
- contents [dict]: iterable of contents in between the range. | - contents [dict]: iterable of contents in between the range. | ||||
- next (bytes): There remains content in the range | - next (bytes): There remains content in the range | ||||
starting from this next sha1 | starting from this next sha1 | ||||
""" | """ | ||||
▲ Show 20 Lines • Show All 1,097 Lines • Show Last 20 Lines |