synology_apm_repo.sdk.format.repo_info module

repo_info — magic RpiF, 64-byte header + JSON payload (FORMAT-SPEC.md: repo_info).

Pure bytes -> dataclass decode; callers fetch the bytes via an ObjectStore and hand them to parse_repo_info.

DedupRepo.open() always parses this file, and a missing or corrupt one blocks opening. No parsed value drives a chunk-decode decision: storage_algorithm.encrypt_algorithm is not a reliable encryption signal (FORMAT-SPEC.md: Header & mode bits; see BucketFileHeader.is_vault_encrypted), and every other field is for display and diagnostics.

Generation selection (repo_info.<N> on S3/Azure, FORMAT-SPEC.md: Multi-generation selection) lives in storage/generations.py.

class synology_apm_repo.sdk.format.repo_info.RepoInfo(uuid, major, minor, repo_type, repo_flag, is_global_dedup_supported, is_worm_supported, compress_algorithm, encrypt_algorithm, raw)

Bases: object

Parsed repo_info: header UUID plus the display-only JSON body fields below; raw keeps the whole decoded payload.

uuid is the 16 header bytes at offset 20 as text when they are ASCII (as every writer makes them), otherwise their lowercase hex. The field is display-only in the format, so odd bytes never fail an open, but frontends derive ids from it, so distinct bytes stay distinct.

uuid: str
major: int
minor: int
repo_type: int | None
repo_flag: int | None
is_global_dedup_supported: bool | None
is_worm_supported: bool | None
compress_algorithm: int | None
encrypt_algorithm: int | None
raw: dict[str, object]
synology_apm_repo.sdk.format.repo_info.parse_repo_info(data)

Parse a repo_info file’s full bytes (header + JSON payload). A body field of the wrong JSON type reads as None.

Raises:
  • DataCorruptError – A magic or CRC32 mismatch, or a payload that is not a JSON object.

  • FormatError – data is shorter than the 64-byte header, or the payload is truncated relative to the length the header declares.