Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8393275
client.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
907 B
Subscribers
None
client.py
View Options
# Copyright (C) 2016-2017 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
from
swh.core
import
hashutil
from
swh.core.api
import
SWHRemoteAPI
from
swh.storage.exc
import
StorageAPIError
class
RemoteVaultCache
(
SWHRemoteAPI
):
"""Client to the Software Heritage vault cache."""
def
__init__
(
self
,
base_url
):
super
()
.
__init__
(
api_exception
=
StorageAPIError
,
url
=
base_url
)
def
directory_ls
(
self
):
return
self
.
get
(
'vault/directory/'
)
def
directory_get
(
self
,
obj_id
):
return
self
.
get
(
'vault/directory/
%s
/'
%
(
hashutil
.
hash_to_hex
(
obj_id
)))
def
directory_cook
(
self
,
obj_id
):
return
self
.
post
(
'vault/directory/
%s
/'
%
hashutil
.
hash_to_hex
(
obj_id
),
data
=
{})
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Jun 4 2025, 7:11 PM (9 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3371088
Attached To
rDSTOC swh-storage-cassandra
Event Timeline
Log In to Comment