MCPcopy
hub / github.com/borgbackup/borg / put

Method put

src/borg/repository.py:488–500  ·  view source on GitHub ↗

put a repo object Note: when doing calls with wait=False this gets async and caller must deal with async results / exceptions later.

(self, id, data, wait=True)

Source from the content-addressed store, hash-verified

486 yield self.get(id_, read_data=read_data, raise_missing=raise_missing)
487
488 def put(self, id, data, wait=True):
489 """put a repo object
490
491 Note: when doing calls with wait=False this gets async and caller must
492 deal with async results / exceptions later.
493 """
494 self._lock_refresh()
495 data_size = len(data)
496 if data_size > MAX_DATA_SIZE:
497 raise IntegrityError(f"More than allowed put data [{data_size} > {MAX_DATA_SIZE}]")
498
499 key = "data/" + bin_to_hex(id)
500 self.store.store(key, data)
501
502 def delete(self, id, wait=True):
503 """delete a repo object

Callers 15

add_chunkMethod · 0.45
add_referenceMethod · 0.45
_parse_bracesFunction · 0.45
process_chunksFunction · 0.45
do_debug_put_objMethod · 0.45
add_keysFunction · 0.45
test_basic_operationsFunction · 0.45
test_read_dataFunction · 0.45
test_consistencyFunction · 0.45
test_consistency2Function · 0.45

Calls 3

_lock_refreshMethod · 0.95
IntegrityErrorClass · 0.85
bin_to_hexFunction · 0.85

Tested by 15

add_keysFunction · 0.36
test_basic_operationsFunction · 0.36
test_read_dataFunction · 0.36
test_consistencyFunction · 0.36
test_consistency2Function · 0.36
test_listFunction · 0.36
test_max_data_sizeFunction · 0.36
test_sparse1Function · 0.36
test_sparse2Function · 0.36