swh.alter.operations module#

class swh.alter.operations.StorageWithDelete(*args, **kwargs)[source]#

Bases: StorageInterface, ObjectDeletionInterface, Protocol

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

Bases: Exception

class swh.alter.operations.Remover(storage: StorageWithDelete, graph_client: RemoteGraphClient, extra_storages: Dict[str, ObjectDeletionInterface] | 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]#
create_recovery_bundle(secret_sharing_conf: Dict[str, str], removable_swhids: List[ExtendedSWHID], recovery_bundle_path: str, removal_identifier: str, reason: str | None = None, expire: datetime | None = None) None[source]#
restore_recovery_bundle() None[source]#
remove(swhids: List[ExtendedSWHID]) 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.