synology_apm_repo.sdk.catalog.workload module

Workload: one db/workload_config row with its display name and subtitle extracted, and the queries that list or look one up.

class synology_apm_repo.sdk.catalog.workload.TargetType(*values)

Bases: StrEnum

The Workload.workload_type/Version.target_type values: device workloads (VM/PC/PS/FS) and SaaS connector kinds (GWS/M365). A str enum, so members compare equal to the raw column values; each member is named after its value except GWS, stored on disk as "GW".

VM = 'VM'
PC = 'PC'
PS = 'PS'
FS = 'FS'
GWS = 'GW'
M365 = 'M365'
class synology_apm_repo.sdk.catalog.workload.SaasSubType(*values)

Bases: StrEnum

The known Workload.sub_type values: a SaaS workload’s spec.workload_type. Workload.sub_type holds the raw string, which a member compares equal to, and may be a value not listed here.

MAIL = 'MAIL'
CONTACT = 'CONTACT'
CALENDAR = 'CALENDAR'
DRIVE = 'DRIVE'
TEAM_DRIVE = 'TEAM_DRIVE'
USER_EXCHANGE = 'USER_EXCHANGE'
GROUP_EXCHANGE = 'GROUP_EXCHANGE'
USER_DRIVE = 'USER_DRIVE'
USER_CHAT = 'USER_CHAT'
SITE = 'SITE'
TEAMS = 'TEAMS'
class synology_apm_repo.sdk.catalog.workload.Workload(workload_id, workload_uid, workload_type, sub_type, display_name, subtitle, spec)

Bases: object

One db/workload_config row, with display fields extracted.

Variables:
  • workload_type (str) – The raw column value, normally a TargetType value.

  • sub_type (str | None) – For SaaS, spec.workload_type ("MAIL", "DRIVE", "SITE", …); None otherwise, or when it is not a non-empty string.

  • display_name (str) – The device’s or SaaS entity’s name, or a placeholder naming the workload’s kind when it has none.

  • subtitle (str | None) – A device’s OS or hypervisor name, a SaaS workload’s sub_type, or None.

  • spec (collections.abc.Mapping[str, object]) – The parsed workload_spec JSON.

workload_id: WorkloadId
workload_uid: WorkloadUid
workload_type: str
sub_type: str | None
display_name: str
subtitle: str | None
spec: Mapping[str, object]
property is_saas: bool

Whether this is a SaaS (GWS/M365) workload.

property type_hint: str

The classification disambiguate’s hints uses to tell same-named workloads apart; sub_type, else workload_type.

property tenant_id: str | None

The M365 tenant GUID, workload_spec.spec.tenant_id (not the internal namespace UUID); None for other workloads.

property domain: str | None

The Google Workspace domain, workload_spec.spec.domain; None for other workloads.

property user_info: dict[str, object] | None

The backed-up SaaS account’s profile (email, name, …), workload_spec.status.entity_meta.spec.user_info; None when absent.

async synology_apm_repo.sdk.catalog.workload.workloads(repo, connection)

connection’s workloads, sorted by display_name (case-insensitive).

Raises:

DataCorruptError – A row’s workload_spec is not a JSON object.

async synology_apm_repo.sdk.catalog.workload.workload_by_id(repo, workload_id)

The Workload with primary key workload_id, or None.

Raises:

DataCorruptError – The row’s workload_spec is not a JSON object.