synology_apm_repo.sdk.units.saas.raw_object module¶
RawObjectProvider: the SaaS fallback UnitProvider, listing the
named objects of a version’s object-name index raw, with no service DB.
dispatch.py falls back to it when no application-layer provider
recognizes a version (or its sub_type is unknown); Catalog.provider’s
raw view requests it directly. It exposes internal index names and
object ids, so it is a diagnostic view.
- class synology_apm_repo.sdk.units.saas.raw_object.RawObjectProvider(repo, version)¶
Bases:
AsyncClosingUnitProviderover one SaaSVersion’s raw object-name-index entries: a flat list under the version root, one leaf per index entry (or, givenobject_db_id, one per object in that ObjectDB), each a byte range of the version’ssaas_obj. Build one withcreate.- async classmethod create(repo, version, saas_streams, *, object_db_id=None, shared=None)¶
Open the version’s
saas_objand its object-name index.- Parameters:
repo (DedupRepo) – The repository
versionbelongs to.version (Version) – The SaaS version to list.
saas_streams (SaasStreamCache) – Borrowed, not owned; the
saas_objstays cached there.object_db_id (str | None) – List this ObjectDB’s objects by id instead of the index’s named entries.
shared (SharedSaasContext | None) – The version’s resolved stream object and index, when
units/dispatch.pyalready resolved them; resolved here otherwise.
- Raises:
NotFoundError –
object_db_idis malformed or names another stream, orsharedis omitted and the version’ssaas_objcan’t be located.
- async close()¶
Close the
object_db_idObjectDB and release this provider’s hold on the index’s; the borrowed stream stays open. Safe after a partialcreate()and more than once.
- root()¶
- async children(node, offset=0, limit=None)¶
- async unit(node)¶
Open
nodeas a restorable unit.- Raises:
NotFoundError –
nodeis the unreadable-index placeholder.NotRestorableError –
nodeis not a restorable unit.