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.

Each is a typing.NewType: plain int/str at runtime, but swapping two same-shaped identifiers is a mypy error.

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 a RecordHead within 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 as ConnectionConfigId.

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; not an on-disk column. A vault’s connection_config table is unique within that vault, but each object-storage sibling’s own table restarts at 1, so a bare connection_config_id can’t tell siblings apart. For a vault this is str(connection.connection_config_id); for object storage, the repo-id string (a directory name, unique per bucket).

alias of str

synology_apm_repo.sdk.identifiers.resolve_catalog_id(repo_id, connection_config_id)

The CatalogId formula shared by api.catalog.Catalog.catalog_id and units.node_ref.canonical_ref_for: repo_id when set (object storage), else str(connection_config_id) (a vault).

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 as VersionId above — both are int, and catalog.Version carries 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; forms copy_meta_file/<Type>_<VersionUid>. NOT the same space as target.db’s on-prem-minted version_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

class synology_apm_repo.sdk.identifiers.TargetId

db/copy_target_version.target_id — the on-prem workload UUID (device workloads) or stream uuid (SaaS).

alias of str

class synology_apm_repo.sdk.identifiers.StreamUuid

SaaS dedup-stream uuid (16 chars) — saas/<ccid>/<StreamUuid>/.

alias of str