Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/interface.py
Show First 20 Lines • Show All 1,016 Lines • ▼ Show 20 Lines | def origin_get_range(self, origin_from=1, origin_count=100): | ||||
Yields: | Yields: | ||||
dicts containing origin information as returned | dicts containing origin information as returned | ||||
by :meth:`swh.storage.storage.Storage.origin_get`. | by :meth:`swh.storage.storage.Storage.origin_get`. | ||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("origin/list") | @remote_api_endpoint("origin/list") | ||||
def origin_list(self, page_token: Optional[str] = None, limit: int = 100) -> dict: | def origin_list( | ||||
self, page_token: Optional[str] = None, limit: int = 100 | |||||
) -> PagedResult[Origin]: | |||||
"""Returns the list of origins | """Returns the list of origins | ||||
Args: | Args: | ||||
page_token: opaque token used for pagination. | page_token: opaque token used for pagination. | ||||
limit: the maximum number of results to return | limit: the maximum number of results to return | ||||
Returns: | Returns: | ||||
dict: dict with the following keys: | Page of Origin data model objects. if next_page_token is None, there is | ||||
- **next_page_token** (str, optional): opaque token to be used as | no longer data to retrieve. | ||||
`page_token` for retrieving the next page. if absent, there is | |||||
no more pages to gather. | |||||
- **origins** (List[dict]): list of origins, as returned by | |||||
`origin_get`. | |||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("origin/search") | @remote_api_endpoint("origin/search") | ||||
def origin_search( | def origin_search( | ||||
self, url_pattern, offset=0, limit=50, regexp=False, with_visit=False | self, url_pattern, offset=0, limit=50, regexp=False, with_visit=False | ||||
): | ): | ||||
"""Search for origins whose urls contain a provided string pattern | """Search for origins whose urls contain a provided string pattern | ||||
▲ Show 20 Lines • Show All 248 Lines • Show Last 20 Lines |