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: object

One backup source: a db/connection_config row, 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), or connection_id when 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_version rows.

  • version_count (int) – This source’s copy_target_version rows, deleted versions included.

connection_config_id: ConnectionConfigId
connection_id: ConnectionId
display_name: str
namespaces: tuple[str, ...]
workload_count: int
version_count: int
async synology_apm_repo.sdk.catalog.connection.connections(repo)

Every backup source in repo, sorted by display_name (case-insensitive); connection_config has 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_spec is 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.