Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9697560
D4653.id16507.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
777 B
Subscribers
None
D4653.id16507.diff
View Options
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
Details
Attached
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
Attached To
D4653: client: add origin_exists() method
Event Timeline
Log In to Comment