Changeset View
Changeset View
Standalone View
Standalone View
swh/vault/api/client.py
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | def put_bundle(self, obj_type, obj_id, bundle): | ||||
hex_id = hashutil.hash_to_hex(obj_id) | hex_id = hashutil.hash_to_hex(obj_id) | ||||
return self.post('put_bundle/{}/{}' .format(obj_type, hex_id), | return self.post('put_bundle/{}/{}' .format(obj_type, hex_id), | ||||
data=bundle) | data=bundle) | ||||
def send_notif(self, obj_type, obj_id): | def send_notif(self, obj_type, obj_id): | ||||
hex_id = hashutil.hash_to_hex(obj_id) | hex_id = hashutil.hash_to_hex(obj_id) | ||||
return self.post('send_notif/{}/{}' .format(obj_type, hex_id), | return self.post('send_notif/{}/{}' .format(obj_type, hex_id), | ||||
data=None) | data=None) | ||||
# Batch endpoints | |||||
def batch_cook(self, batch): | |||||
return self.post('batch_cook', data=batch) | |||||
def batch_progress(self, batch_id): | |||||
return self.get('batch_progress/{}'.format(batch_id)) |