Page MenuHomeSoftware Heritage
Paste P1276

swh.storage.interface new endpoint proposal
ActivePublic

Authored by ardumont on Feb 4 2022, 3:55 PM.
```
@remote_api_endpoint("origin/visit_status/find_by_date")
def origin_visit_status_find_by_date(
self, origin: str, visit_date: datetime.datetime
) -> Optional[OriginVisit]:
"""Retrieves the origin visit status whose date is superior to the provided
timestamp. If no such visit exists, returns None.
Args:
origin: origin (URL)
visit_date: expected visit date
Returns:
A visit status if found, None otherwise
"""
...
```