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:
objectParsed
repo_info: header UUID plus the display-only JSON body fields below;rawkeeps the whole decoded payload.uuidis 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.
- synology_apm_repo.sdk.format.repo_info.parse_repo_info(data)¶
Parse a
repo_infofile’s full bytes (header + JSON payload). A body field of the wrong JSON type reads asNone.- Raises:
DataCorruptError – A magic or CRC32 mismatch, or a payload that is not a JSON object.
FormatError –
datais shorter than the 64-byte header, or the payload is truncated relative to the length the header declares.