Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/interface.py
Show First 20 Lines • Show All 181 Lines • ▼ Show 20 Lines | ) -> PagedResult[Content]: | ||||
Returns: | Returns: | ||||
PagedResult of Content model objects within the partition. If | PagedResult of Content model objects within the partition. If | ||||
next_page_token is None, there is no longer data to retrieve. | next_page_token is None, there is no longer data to retrieve. | ||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("content/metadata") | @remote_api_endpoint("content/metadata") | ||||
def content_get_metadata(self, contents: List[bytes]) -> Dict[bytes, List[Dict]]: | def content_get(self, contents: List[Sha1]) -> List[Optional[Content]]: | ||||
"""Retrieve content metadata in bulk | """Retrieve content metadata in bulk | ||||
Args: | Args: | ||||
content: iterable of content identifiers (sha1) | content: List of content identifiers | ||||
Returns: | Returns: | ||||
a dict with keys the content's sha1 and the associated value | List of contents model objects when they exist, None otherwise. | ||||
either the existing content's metadata or None if the content does | |||||
not exist. | |||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("content/missing") | @remote_api_endpoint("content/missing") | ||||
def content_missing( | def content_missing( | ||||
self, contents: List[Dict[str, Any]], key_hash: str = "sha1" | self, contents: List[Dict[str, Any]], key_hash: str = "sha1" | ||||
) -> Iterable[bytes]: | ) -> Iterable[bytes]: | ||||
▲ Show 20 Lines • Show All 1,069 Lines • Show Last 20 Lines |