synology_apm_repo.sdk.api.catalog module¶
Catalog: one catalog’s workload/version/provider operations, as
returned by Repository.catalogs()/Repository.catalog_by_id(); and the
frames a ref lands on.
- class synology_apm_repo.sdk.api.catalog.RootFrame¶
Bases:
objectA ref with no segments: the repository’s own top level.
- class synology_apm_repo.sdk.api.catalog.CatalogFrame(catalog)¶
Bases:
objectA ref that stopped at a catalog.
- class synology_apm_repo.sdk.api.catalog.WorkloadFrame(catalog, workload)¶
Bases:
objectA ref that stopped at a workload.
- class synology_apm_repo.sdk.api.catalog.NodeFrame(provider, node, catalog=None, workload=None, version=None)¶
Bases:
objectA ref that reached a node in a version’s tree. A version always continues into its tree, so a ref naming one lands on its root node.
catalog/workload/versionare kept for breadcrumbs and areNonefor a raw ref. The owningRepositorytracksprovideruntilRepository.release_provideror the repository’s close.- provider: ClosableUnitProvider¶
- async unit()¶
The restorable item this frame’s node names. It reads through
provider, so release that provider only once done with the item.- Raises:
NotRestorableError – The node is a folder.
- class synology_apm_repo.sdk.api.catalog.RawView(object_db_id=None)¶
Bases:
objectAsks for a SaaS version’s raw view: its object-name index listed as-is by
RawObjectProvider, with no application-layer decoding — a diagnostic view exposing internal names and object ids. A device version has no raw view and ignores it.- Variables:
object_db_id (str | None) – List this ObjectDB’s objects by id (
"<streamUuid>_<offset>_<length>") instead of the index’s named entries.
- class synology_apm_repo.sdk.api.catalog.VersionLocation(catalog, workload, version)¶
Bases:
objectA version with the catalog and workload it belongs to.
- class synology_apm_repo.sdk.api.catalog.Catalog(dedup_repo, connection, *, saas_streams, providers, keys)¶
Bases:
objectOne catalog within an opened
Repository: a singledb/ connection_configrow (connection) plus the workload/version/ provider operations scoped to it. Never constructed directly.A vault’s sibling
Catalog``s share one ``DedupRepo; on object storage each has its own (FORMAT-SPEC.md: Locating the repository root).workloads,versions,version_by_uidandverifyraiseKeyRequiredError/KeyMismatchErrorbefore any I/O while the owning repository is encrypted and not key-verified. Providers it hands out are tracked and closed by the owningRepository;Catalogitself has noclose().- property connection: Connection¶
The
db/connection_configrow this catalog is.
- property catalog_id: CatalogId¶
This catalog’s repo-id, or
str(connection_config_id)for a vault (which has no repo-id), as canonical refs spell it.
- property info: RepoInfo¶
This catalog’s own
repo_info— per-catalog for object storage, vault-wide for a vault.
- async workloads()¶
This catalog’s workloads.
- async versions(workload, *, include_deleted=False)¶
workload’s browsable versions, newest backup first (ties byversion_iddescending), deleted ones only withinclude_deleted. A version whose content can’t be resolved fails only when opened.
- async version_by_uid(workload_id, version_uid)¶
The version
version_uidof workloadworkload_id, deleted or not, looked up by id.Noneunless that version exists, is browsable, and belongs toworkload_idand to this catalog.
- async provider(version, *, raw=None)¶
Dispatches
versionto the rightUnitProviderbytarget_type/Workload.sub_type, degrading toRawObjectProviderwhen nothing recognizes it;rawasks for that raw view directly.- Raises:
NotFoundError –
raw.object_db_idis malformed or names another stream.
- async verify(level=VerifyLevel.QUICK, *, progress=None, tuning=None)¶
Integrity check over this catalog’s
DedupRepo— on a vault, the same check as every sibling catalog’s, not one scoped to this catalog’s rows.- Parameters:
level (VerifyLevel) – How deep to check.
progress (ProgressCallback | None) – Receives a
Progresssnapshot as checking advances.tuning (VerifyTuning | None) – How the check spreads its reads (default
VerifyTuning()).
- Returns:
Every
Findingfrom the check.- Raises:
StorageBackendError – A store call failed mid-check.
- Return type:
- async locate(segments, *, raw=None)¶
Walks human-ref display names below this catalog: workload -> version -> item, as far as
segmentsgo.- Parameters:
- Returns:
The frame the last segment reached.
- Raises:
ValueError –
segmentsis empty.NotFoundError – A segment matches nothing.
InvalidArgumentError – A segment matches ambiguously.
KeyRequiredError – The repository is encrypted and no key was supplied.
KeyMismatchError – The last key supplied was rejected.
- Return type:
- synology_apm_repo.sdk.api.catalog.match_or_raise(segment, pairs, objects, *, kind, hints=None)¶
match_display_name, raisingNotFoundErroron a miss, orInvalidArgumentErrornaming the candidates whensegmentis the pre-suffix name of several (seeambiguous_matches).