Changeset View
Changeset View
Standalone View
Standalone View
swh/scheduler/interface.py
# Copyright (C) 2015-2021 The Software Heritage developers | # Copyright (C) 2015-2022 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
import datetime | import datetime | ||||
from typing import Any, Dict, Iterable, List, Optional, Tuple, Union | from typing import Any, Dict, Iterable, List, Optional, Tuple, Union | ||||
from uuid import UUID | from uuid import UUID | ||||
▲ Show 20 Lines • Show All 370 Lines • ▼ Show 20 Lines | ) -> List[ListedOrigin]: | ||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("origins/get") | @remote_api_endpoint("origins/get") | ||||
def get_listed_origins( | def get_listed_origins( | ||||
self, | self, | ||||
lister_id: Optional[UUID] = None, | lister_id: Optional[UUID] = None, | ||||
url: Optional[str] = None, | url: Optional[str] = None, | ||||
enabled: Optional[bool] = True, | |||||
limit: int = 1000, | limit: int = 1000, | ||||
page_token: Optional[ListedOriginPageToken] = None, | page_token: Optional[ListedOriginPageToken] = None, | ||||
) -> PaginatedListedOriginList: | ) -> PaginatedListedOriginList: | ||||
"""Get information on the listed origins matching either the `url` or | """Get information on listed origins, possibly filtered, in a paginated way. | ||||
`lister_id`, or both arguments. | |||||
Use the `limit` and `page_token` arguments for continuation. The next | Args: | ||||
page token, if any, is returned in the PaginatedListedOriginList object. | lister_id: if provided, return origins discovered with that lister | ||||
url: if provided, return origins matching that URL | |||||
enabled: If :const:`True` return only enabled origins, if :const:`False` | |||||
return only disabled origins, if :const:`None` return all origins. | |||||
limit: maximum number of origins per page | |||||
page_token: to get the next page of origins, is returned in the | |||||
:class:`PaginatedListedOriginList` object | |||||
Returns: | |||||
A page of listed origins | |||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("origins/grab_next") | @remote_api_endpoint("origins/grab_next") | ||||
def grab_next_visits( | def grab_next_visits( | ||||
self, | self, | ||||
visit_type: str, | visit_type: str, | ||||
count: int, | count: int, | ||||
▲ Show 20 Lines • Show All 103 Lines • Show Last 20 Lines |