swh.alter.operations module#

exception swh.alter.operations.RemoverError[source]#

Bases: Exception

class swh.alter.operations.Remover(storage: StorageInterface, graph_client: RemoteGraphClient, restoration_storage: StorageInterface | None = None, removal_searches: Dict[str, SearchInterface] | None = None, removal_storages: Dict[str, ObjectDeletionInterface] | None = None, removal_objstorages: Dict[str, ObjStorageInterface] | None = None, removal_journals: Dict[str, KafkaJournalWriter] | None = None, progressbar: ProgressBarInit | None = None)[source]#

Bases: object

Helper class used to perform a removal.

get_removable(swhids: List[ExtendedSWHID], *, output_inventory_subgraph: TextIO | None = None, output_removable_subgraph: TextIO | None = None, output_pruned_removable_subgraph: TextIO | None = None) List[ExtendedSWHID][source]#
register_object(obj: BaseModel) None[source]#
register_objects_from_bundle(recovery_bundle_path: str, object_secret_key: str)[source]#
create_recovery_bundle(secret_sharing: SecretSharing, removable_swhids: List[ExtendedSWHID], recovery_bundle_path: str, removal_identifier: str, reason: str | None = None, expire: datetime | None = None) str[source]#
restore_recovery_bundle() None[source]#
remove(progressbar=None) None[source]#
remove_from_storage(name: str, removal_storage: ObjectDeletionInterface) None[source]#
remove_from_journal(name: str, journal_writer: KafkaJournalWriter) None[source]#
remove_from_objstorage(name: str, objstorage: ObjStorageInterface) None[source]#
have_new_references(removed_swhids: List[ExtendedSWHID]) bool[source]#

Find out if any removed objects now have a new references coming from an object outside the set of removed objects.