synology_apm_repo.sdk.identifiers module¶
Distinct identifier spaces that look identical on the wire (all int or
all str) but must never be mixed.
Declaring each as a typing.NewType costs nothing at runtime — these are
plain int/str at the bytes level — and turns “silently read the wrong
repository file because two same-shaped identifiers got swapped” from a
support incident into a mypy error, since mypy --strict is already
enabled for this project.
- class synology_apm_repo.sdk.identifiers.StreamId¶
ChunkAddress/ composition-path stream id (0-255,uint8).alias of
int
- class synology_apm_repo.sdk.identifiers.SessionId¶
Composition-path session id — one per backup version within a stream.
alias of
int
- class synology_apm_repo.sdk.identifiers.CompOffset¶
db/file_map.comp_offset— the global offset of aRecordHeadwithin a(StreamId, SessionId)composition.alias of
int
- class synology_apm_repo.sdk.identifiers.BucketId¶
Pool bucket id (0..2**40-1) — part of
ChunkAddress.alias of
int
- class synology_apm_repo.sdk.identifiers.ChunkIdx¶
Index of a 4 KiB chunk within a bucket (0..8191) — part of
ChunkAddress.alias of
int
- class synology_apm_repo.sdk.identifiers.ConnectionId¶
db/connection_config.connection_id— 12-char id identifying a Copy / Tiering connection. NOT the same space asConnectionConfigId.alias of
str
- class synology_apm_repo.sdk.identifiers.ConnectionConfigId¶
db/connection_config.connection_config_id— the local autoincrement primary key for a connection and version_type pair.alias of
int
- class synology_apm_repo.sdk.identifiers.CatalogId¶
Repository Layer identifier for one
api.Catalog— part of theSession/Repository/Catalogsplit that CLI/TUI code imports directly, with everything below that split treated as an implementation detail — distinct from every id above in that it’s not a raw on-disk column: a vault’s own catalogs share oneconnection_configtable (unique within that vault, sostr(connection_config_id)alone identifies one), but each object-storage sibling’s ownconnection_configtable independently starts back at 1 — a bareconnection_config_idcan’t tell two siblings apart. For a vault, this isstr(connection.connection_config_id); for object storage, the repo-id string itself (already unique per bucket by construction, being a directory name).alias of
str
- synology_apm_repo.sdk.identifiers.resolve_catalog_id(repo_id, connection_config_id)¶
The one shared place holding the
CatalogIdfallback formula —repo_idwhen set (object storage), elsestr(connection_config_id)(a vault) — used both byapi.catalog.Catalog.catalog_idandunits.node_ref.canonical_ref_for, which would otherwise each carry an identical, independently-drifting copy of this fallback.
- class synology_apm_repo.sdk.identifiers.WorkloadId¶
db/workload_config.workload_id— local autoincrement primary key.alias of
int
- class synology_apm_repo.sdk.identifiers.WorkloadUid¶
db/workload_config.workload_uid—"<uuid>;<serial>"composite.alias of
str
- class synology_apm_repo.sdk.identifiers.VersionId¶
db/copy_target_version.version_id— local autoincrement primary key.alias of
int
- class synology_apm_repo.sdk.identifiers.SaasVersionId¶
copy_target_version.saas_version_id/saas_version.version_info.version_id— a SaaS stream’s own, per-stream version numbering (resolved via(snapshot_id, SaasVersionId) -> stream_version,units/saas/stream.py). NOT the same space asVersionIdabove — both areint, andcatalog.Versioncarries one of each.alias of
int
- class synology_apm_repo.sdk.identifiers.VersionUid¶
db/copy_target_version.version_uid— the Copy-version UUID minted server-side; formscopy_meta_file/<Type>_<VersionUid>. NOT the same space astarget.db’s on-prem-mintedversion_table.version_uuid.alias of
str
- class synology_apm_repo.sdk.identifiers.SnapshotUuid¶
saas_snapshot.snapshot_info.snapshot_uuid— server-minted snapshot id.alias of
str