Page MenuHomeSoftware Heritage

client.py
No OneTemporary

client.py

# 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

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

Event Timeline