Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/interface.py
Show First 20 Lines • Show All 765 Lines • ▼ Show 20 Lines | def origin_visit_add(self, visits: Iterable[OriginVisit]) -> Iterable[OriginVisit]: | ||||
... | ... | ||||
@remote_api_endpoint("origin/visit_status/add") | @remote_api_endpoint("origin/visit_status/add") | ||||
def origin_visit_status_add( | def origin_visit_status_add( | ||||
self, visit_statuses: Iterable[OriginVisitStatus], | self, visit_statuses: Iterable[OriginVisitStatus], | ||||
) -> None: | ) -> None: | ||||
"""Add origin visit statuses. | """Add origin visit statuses. | ||||
If there is already a status for the same origin and visit id at the same | |||||
date, the new one will be either dropped or will replace the existing one | |||||
(it is unspecified which one of these two behaviors happens). | |||||
Args: | Args: | ||||
visit_statuses: origin visit statuses to add | visit_statuses: origin visit statuses to add | ||||
Raises: StorageArgumentException if the origin of the visit status is unknown | Raises: StorageArgumentException if the origin of the visit status is unknown | ||||
""" | """ | ||||
... | ... | ||||
▲ Show 20 Lines • Show All 334 Lines • ▼ Show 20 Lines | |||||
) -> None: | ) -> None: | ||||
"""Add a content_metadata for the content at discovery_date, | """Add a content_metadata for the content at discovery_date, | ||||
obtained using the `fetcher` from the `authority`. | obtained using the `fetcher` from the `authority`. | ||||
The authority and fetcher must be known to the storage before | The authority and fetcher must be known to the storage before | ||||
using this endpoint. | using this endpoint. | ||||
If there is already content metadata for the same content, authority, | If there is already content metadata for the same content, authority, | ||||
fetcher, and at the same date, it will be replaced by this one. | fetcher, and at the same date; the new one will be either dropped or | ||||
will replace the existing one | |||||
(it is unspecified which one of these two behaviors happens). | |||||
Args: | Args: | ||||
discovery_date: when the metadata was fetched. | discovery_date: when the metadata was fetched. | ||||
authority: a dict containing keys `type` and `url`. | authority: a dict containing keys `type` and `url`. | ||||
fetcher: a dict containing keys `name` and `version`. | fetcher: a dict containing keys `name` and `version`. | ||||
format: text field indicating the format of the content of the | format: text field indicating the format of the content of the | ||||
metadata: blob of raw metadata | metadata: blob of raw metadata | ||||
""" | """ | ||||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
) -> None: | ) -> None: | ||||
"""Add an origin_metadata for the origin at discovery_date, | """Add an origin_metadata for the origin at discovery_date, | ||||
obtained using the `fetcher` from the `authority`. | obtained using the `fetcher` from the `authority`. | ||||
The authority and fetcher must be known to the storage before | The authority and fetcher must be known to the storage before | ||||
using this endpoint. | using this endpoint. | ||||
If there is already origin metadata for the same origin, authority, | If there is already origin metadata for the same origin, authority, | ||||
fetcher, and at the same date, it will be replaced by this one. | fetcher, and at the same date; the new one will be either dropped or | ||||
will replace the existing one | |||||
(it is unspecified which one of these two behaviors happens). | |||||
Args: | Args: | ||||
discovery_date: when the metadata was fetched. | discovery_date: when the metadata was fetched. | ||||
authority: a dict containing keys `type` and `url`. | authority: a dict containing keys `type` and `url`. | ||||
fetcher: a dict containing keys `name` and `version`. | fetcher: a dict containing keys `name` and `version`. | ||||
format: text field indicating the format of the content of the | format: text field indicating the format of the content of the | ||||
metadata: blob of raw metadata | metadata: blob of raw metadata | ||||
""" | """ | ||||
▲ Show 20 Lines • Show All 168 Lines • Show Last 20 Lines |