synology_apm_repo.sdk.catalog.workload module¶
Workload: one db/workload_config row, with its own display-name/
subtitle extraction (_device_display_name/_saas_display_name) as a
first-class output, not an afterthought: CLI/TUI show only
display_name/subtitle/attrs in the default (non-diagnostic)
mode, so this can’t be bolted on later.
workloads()’s own per-connection lookup, _workload_ids_for_connection,
relies on the same copy_target_version join catalog/connection.py
documents in its batched form.
- class synology_apm_repo.sdk.catalog.workload.TargetType(value)¶
Bases:
StrEnumThe six real
Workload.workload_type/Version.target_typevalues (db/workload_config/db/copy_target_versionon-disk strings) — device workloads (VM/PC/PS/FS) vs. SaaS connector kinds (GW/M365). Astrsubclass: every existing site comparing one against a plain"VM"/"GW"literal, or collecting it alongside the still-str-typedworkload_type/target_typefields, keeps working unchanged.- VM = 'VM'¶
- PC = 'PC'¶
- PS = 'PS'¶
- FS = 'FS'¶
- GW = 'GW'¶
- M365 = 'M365'¶
- class synology_apm_repo.sdk.catalog.workload.Workload(workload_id, workload_uid, workload_type, sub_type, display_name, subtitle, spec)¶
Bases:
objectOne
db/workload_configrow, with display fields extracted per this module’s docstring.- workload_id: WorkloadId¶
- workload_uid: WorkloadUid¶
- property type_hint: str¶
A short, human-meaningful classification for disambiguation —
sub_typewhere present, else the top-levelworkload_type. Deliberately not ``subtitle`` — that field carries workload-specific detail (an OS name, a host IP), not a type classification. Feedsdisambiguate’shintsparameter.
- property tenant_id: str | None¶
The real M365 (Microsoft 365) tenant GUID —
workload_spec.spec.tenant_id. Not the same thing asworkload_spec’s own top-levelnamespacefield, a backup-server-internal bookkeeping UUID that can differ across workloads sharing this sametenant_id.Nonefor non-M365 workloads — GW’s tenant-equivalent isdomain, a different field, never this one.
- property domain: str | None¶
The real GWS (Google Workspace) domain —
workload_spec.spec.domain, already a plain human-readable domain string — unlike M365’stenant_id, which is only ever a GUID (no field anywhere inworkload_speccarries a plain M365 tenant domain string).Nonefor non-GW workloads.
- async synology_apm_repo.sdk.catalog.workload.workloads(repo, connection)¶
Sorted by
display_name(case-insensitive), same reasoning asconnections().
- async synology_apm_repo.sdk.catalog.workload.workload_by_id(repo, workload_id)¶
A single
Workloadby its ownworkload_configprimary key — a directWHERE workload_id = ?lookup, not aconnections()+workloads(connection)scan followed by a linear match: unlikeConnection, no field of aWorkload(see_workload_from_row) depends on which connection it belongs to, so there is nothing a full catalog walk would supply that this direct lookup doesn’t already have.Noneifworkload_iddoesn’t resolve to any row.