Page MenuHomeSoftware Heritage

D4653.id16507.diff
No OneTemporary

D4653.id16507.diff

diff --git a/swh/web/client/client.py b/swh/web/client/client.py
--- a/swh/web/client/client.py
+++ b/swh/web/client/client.py
@@ -519,6 +519,21 @@
)
)
+ def origin_exists(self, origin: str, **req_args) -> bool:
+ """Check if an origin object exists in the archive
+
+ Args:
+ origin: the URL of a software origin
+ req_args: extra keyword arguments for requests.head()
+
+ Raises:
+ requests.HTTPError: if HTTP request fails
+
+ """
+ return bool(
+ self._call(f"origin/{origin}/get/", http_method="head", **req_args,)
+ )
+
def content_raw(self, swhid: SWHIDish, **req_args) -> Iterator[bytes]:
"""Iterate over the raw content of a content object

File Metadata

Mime Type
text/plain
Expires
Mon, Aug 18, 12:10 AM (1 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3225821

Event Timeline