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:
StrEnumThe
Workload.workload_type/Version.target_typevalues: device workloads (VM/PC/PS/FS) and SaaS connector kinds (GWS/M365). Astrenum, so members compare equal to the raw column values; each member is named after its value exceptGWS, 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:
StrEnumThe known
Workload.sub_typevalues: a SaaS workload’sspec.workload_type.Workload.sub_typeholds 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:
objectOne
db/workload_configrow, with display fields extracted.- Variables:
workload_type (str) – The raw column value, normally a
TargetTypevalue.sub_type (str | None) – For SaaS,
spec.workload_type("MAIL","DRIVE","SITE", …);Noneotherwise, 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, orNone.spec (collections.abc.Mapping[str, object]) – The parsed
workload_specJSON.
- workload_id: WorkloadId¶
- workload_uid: WorkloadUid¶
- property type_hint: str¶
The classification
disambiguate’shintsuses to tell same-named workloads apart;sub_type, elseworkload_type.
- property tenant_id: str | None¶
The M365 tenant GUID,
workload_spec.spec.tenant_id(not the internalnamespaceUUID);Nonefor other workloads.
- async synology_apm_repo.sdk.catalog.workload.workloads(repo, connection)¶
connection’s workloads, sorted bydisplay_name(case-insensitive).- Raises:
DataCorruptError – A row’s
workload_specis not a JSON object.
- async synology_apm_repo.sdk.catalog.workload.workload_by_id(repo, workload_id)¶
The
Workloadwith primary keyworkload_id, orNone.- Raises:
DataCorruptError – The row’s
workload_specis not a JSON object.