synology_apm_repo.sdk.units.device module¶
DeviceProvider: VM/PC/PS workloads via copy_meta_file.
The smallest backed-up unit for these workload types is a whole
disk/volume image (FORMAT-SPEC.md: Landing directory layout); this
provider’s disk-image leaves are exactly that. When a Dissect package is
installed, every supported dedup disk image also gets one sibling node,
“<name> (filesystem)”, built via
units.device_disk_fs by parsing the guest filesystem inside the
image with units.content.disk_fs. When no filesystem is recognized,
that sibling is absent or shows one diagnostic leaf; the whole-image
node is unaffected.
Two paths, dispatched directly on Version.target_type ("VM" vs
{"PC", "PS"}), never by probing which files exist:
VM:
target.db→version_table→device_table(one row per disk device) →object_table(one row per disk image, joined onconfig_device_id). Handled directly in this module.PC/PS: no
target.db, onlysnapshot_info.json. The disk list comes fromdb/copy_target_file(version_id→fid) joined withdb/file_meta(fid→path), looked up indb/file_map. Handled bydevice_pcps.PcpsDiskTree, since one physical PC/PS disk can land as several fragment objects that need reassembling.
Trap: a PC/PS landing directory exists for every normally-landed
version too, just without target.db — target_type is the only
reliable dispatch signal.
- class synology_apm_repo.sdk.units.device.DeviceProvider(repo, version)¶
Bases:
AsyncClosingClosableUnitProviderfor one VM/PC/PS workload version. Build one withcreate.- async classmethod create(repo, version)¶
Build a provider for
version. No I/O happens here.
- property disk_fs: DiskFsSibling¶
The disk-fs sibling collaborator, through which
PcpsDiskTreebuilds a PC/PS disk’s “(filesystem)” sibling node.
- extra_ref(*extra)¶
This provider’s version ref with
extrasegments appended (never a nestedrepo_path, whose literal#would not surviveNodeRef.parse()).
- async close()¶
Close the
target.dbconnection, if opened.
- root()¶
The top node: “Disks” for PC/PS, “Devices” for VM. No I/O.
- async children(node, offset=0, limit=None)¶
- async unit(node)¶
Open
nodeas a restorable unit.- Raises:
NotFoundError –
nodeis a diagnostic placeholder, or its data is missing from this repository.DataCorruptError – Its
file_mapentry is marked Corrupted/Tainted.UnsupportedDataFormatError – A VM disk object is not plain dedup content (a CBT chain).
NotRestorableError –
nodeis not a restorable unit.