Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/interface.py
Show First 20 Lines • Show All 1,137 Lines • ▼ Show 20 Lines | |||||
def raw_extrinsic_metadata_get( | def raw_extrinsic_metadata_get( | ||||
self, | self, | ||||
object_type: MetadataTargetType, | object_type: MetadataTargetType, | ||||
id: Union[str, SWHID], | id: Union[str, SWHID], | ||||
authority: MetadataAuthority, | authority: MetadataAuthority, | ||||
after: Optional[datetime.datetime] = None, | after: Optional[datetime.datetime] = None, | ||||
page_token: Optional[bytes] = None, | page_token: Optional[bytes] = None, | ||||
limit: int = 1000, | limit: int = 1000, | ||||
) -> Dict[str, Union[Optional[bytes], List[RawExtrinsicMetadata]]]: | ) -> PagedResult[RawExtrinsicMetadata]: | ||||
"""Retrieve list of all raw_extrinsic_metadata entries for the id | """Retrieve list of all raw_extrinsic_metadata entries for the id | ||||
Args: | Args: | ||||
object_type: one of the values of swh.model.model.MetadataTargetType | object_type: one of the values of swh.model.model.MetadataTargetType | ||||
id: an URL if object_type is 'origin', else a core SWHID | id: an URL if object_type is 'origin', else a core SWHID | ||||
authority: a dict containing keys `type` and `url`. | authority: a dict containing keys `type` and `url`. | ||||
after: minimum discovery_date for a result to be returned | after: minimum discovery_date for a result to be returned | ||||
page_token: opaque token, used to get the next page of results | page_token: opaque token, used to get the next page of results | ||||
limit: maximum number of results to be returned | limit: maximum number of results to be returned | ||||
Returns: | Returns: | ||||
dict with keys `next_page_token` and `results`. | PagedResult of RawExtrinsicMetadata | ||||
`next_page_token` is an opaque token that is used to get the | |||||
next page of results, or `None` if there are no more results. | |||||
`results` is a list of RawExtrinsicMetadata objects: | |||||
""" | """ | ||||
... | ... | ||||
@remote_api_endpoint("metadata_fetcher/add") | @remote_api_endpoint("metadata_fetcher/add") | ||||
def metadata_fetcher_add(self, fetchers: List[MetadataFetcher],) -> None: | def metadata_fetcher_add(self, fetchers: List[MetadataFetcher],) -> None: | ||||
"""Add new metadata fetchers to the storage. | """Add new metadata fetchers to the storage. | ||||
▲ Show 20 Lines • Show All 128 Lines • Show Last 20 Lines |