Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/interface.py
Show First 20 Lines • Show All 1,041 Lines • ▼ Show 20 Lines | def origin_count(self, url_pattern, regexp=False, with_visit=False): | ||||
with_visit (bool): if True, filter out origins with no visit | with_visit (bool): if True, filter out origins with no visit | ||||
Returns: | Returns: | ||||
int: The number of origins matching the search criterion. | int: The number of origins matching the search criterion. | ||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("origin/add_multi") | @remote_api_endpoint("origin/add_multi") | ||||
def origin_add(self, origins: Iterable[Origin]) -> List[Dict]: | def origin_add(self, origins: Iterable[Origin]) -> Dict[str, int]: | ||||
"""Add origins to the storage | """Add origins to the storage | ||||
Args: | Args: | ||||
origins: list of dictionaries representing the individual origins, | origins: list of dictionaries representing the individual origins, | ||||
with the following keys: | with the following keys: | ||||
- type: the origin type ('git', 'svn', 'deb', ...) | - type: the origin type ('git', 'svn', 'deb', ...) | ||||
- url (bytes): the url the origin points to | - url (bytes): the url the origin points to | ||||
Returns: | Returns: | ||||
list: given origins as dict updated with their id | Summary dict of keys with associated count as values | ||||
origin:add: Count of object actually stored in db | |||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("origin/add") | @remote_api_endpoint("origin/add") | ||||
def origin_add_one(self, origin: Origin) -> str: | def origin_add_one(self, origin: Origin) -> str: | ||||
"""Add origin to the storage | """Add origin to the storage | ||||
▲ Show 20 Lines • Show All 222 Lines • Show Last 20 Lines |