Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/interface.py
Show First 20 Lines • Show All 938 Lines • ▼ Show 20 Lines | def object_find_by_sha1_git(self, ids): | ||||
- sha1_git: the input id | - sha1_git: the input id | ||||
- type: the type of object found | - type: the type of object found | ||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("origin/get") | @remote_api_endpoint("origin/get") | ||||
def origin_get(self, origins): | def origin_get(self, origins: Iterable[str]) -> Iterable[Optional[Origin]]: | ||||
"""Return origins, either all identified by their ids or all | """Return origins. | ||||
identified by tuples (type, url). | |||||
If the url is given and the type is omitted, one of the origins with | |||||
that url is returned. | |||||
Args: | Args: | ||||
origin: a list of dictionaries representing the individual | origin: a list of urls to find | ||||
origins to find. | |||||
vlorentz: shouldn't have removed that line | |||||
These dicts have the key url: | |||||
- url (bytes): the url the origin points to | |||||
Returns: | Returns: | ||||
dict: the origin dictionary with the keys: | the list of associated existing origin model objects. The unknown origins | ||||
will be returned as None at the same index as the input. | |||||
- id: origin's id | |||||
- url: origin's url | |||||
Raises: | |||||
ValueError: if the url or the id don't exist. | |||||
""" | """ | ||||
... | ... | ||||
@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): | ||||
"""Return origins, identified by the sha1 of their URLs. | """Return origins, identified by the sha1 of their URLs. | ||||
▲ Show 20 Lines • Show All 300 Lines • Show Last 20 Lines |
shouldn't have removed that line