synology_apm_repo.sdk.catalog.connection module¶
Connection: one backup source (a db/connection_config row), and
connections(), a plain SQLite read that never touches Pool or
Composition.
workload_config has no connection_config_id column: a workload
belongs to a connection through copy_target_version, the only table
holding both ids.
- class synology_apm_repo.sdk.catalog.connection.Connection(connection_config_id, connection_id, display_name, namespaces, workload_count, version_count)¶
Bases:
objectOne backup source: a
db/connection_configrow, i.e. a distinct originating APM this repository has received Copy data from.- Variables:
connection_config_id (synology_apm_repo.sdk.identifiers.ConnectionConfigId) – The row’s id, local to this catalog’s database.
connection_id (synology_apm_repo.sdk.identifiers.ConnectionId) – The source’s own id, as named in link records.
display_name (str) – The source’s name from its link record (FORMAT-SPEC.md:
vault_link_key/ connection naming), orconnection_idwhen none matches.namespaces (tuple[str, ...]) – The distinct non-empty workload namespaces under this source, in first-seen order.
workload_count (int) – Distinct workloads in this source’s
copy_target_versionrows.version_count (int) – This source’s
copy_target_versionrows, deleted versions included.
- connection_config_id: ConnectionConfigId¶
- connection_id: ConnectionId¶
- async synology_apm_repo.sdk.catalog.connection.connections(repo)¶
Every backup source in
repo, sorted bydisplay_name(case-insensitive);connection_confighas no time field to sort by. Each enrichment (workload ids, namespaces, version counts) is one batched query for all rows.- Raises:
DataCorruptError – A workload’s
workload_specis not a JSON object.
- async synology_apm_repo.sdk.catalog.connection.workload_ids_by_connection(repo, connection_config_ids)¶
Each connection’s workload ids, through
copy_target_version, in one query; a connection with none is absent.