Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/interface.py
Show First 20 Lines • Show All 996 Lines • ▼ Show 20 Lines | def origin_get(self, origins: List[str]) -> Iterable[Optional[Origin]]: | ||||
Returns: | Returns: | ||||
the list of associated existing origin model objects. The unknown origins | the list of associated existing origin model objects. The unknown origins | ||||
will be returned as None at the same index as the input. | will be returned as None at the same index as the input. | ||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("origin/get_sha1") | @remote_api_endpoint("origin/get_sha1") | ||||
def origin_get_by_sha1(self, sha1s): | def origin_get_by_sha1( | ||||
self, sha1s: List[bytes] | |||||
) -> Iterable[Optional[Dict[str, Any]]]: | |||||
"""Return origins, identified by the sha1 of their URLs. | """Return origins, identified by the sha1 of their URLs. | ||||
Args: | Args: | ||||
sha1s (list[bytes]): a list of sha1s | sha1s: a list of sha1s | ||||
Yields: | List: | ||||
dicts containing origin information as returned | Origins whose sha1 of their url match, None when the origins is not found. | ||||
by :meth:`swh.storage.storage.Storage.origin_get`, or None if an | |||||
origin matching the sha1 is not found. | |||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("origin/list") | @remote_api_endpoint("origin/list") | ||||
def origin_list( | def origin_list( | ||||
self, page_token: Optional[str] = None, limit: int = 100 | self, page_token: Optional[str] = None, limit: int = 100 | ||||
) -> PagedResult[Origin]: | ) -> PagedResult[Origin]: | ||||
▲ Show 20 Lines • Show All 269 Lines • Show Last 20 Lines |