synology_apm.sdk.models.workload module¶
Workload data models.
- class synology_apm.sdk.models.workload.Workload(workload_id, name, category, namespace, last_backup_at, is_retired, protected_data_bytes, *, status, plan, backup_progress=None, items_backed_up=None, backup_server=None, backup_copy_destination=None, backup_copy_data_bytes=0)¶
Bases:
objectBase class for all Workloads.
- Variables:
workload_id (str) – Unique workload identifier within APM.
name (str) – Display name.
category (synology_apm.sdk.enums.WorkloadCategory) – Business domain (MACHINE / M365 / GWS).
namespace (str) – Namespace of the owning backup server.
last_backup_at (datetime.datetime | None) – Time of the last successful backup; None if never backed up.
is_retired (bool) – Whether the workload is retired.
protected_data_bytes (int) – Protected data size in bytes.
status (synology_apm.sdk.enums.WorkloadStatus) – Current backup status. RETIRED for workloads under a Retirement Plan.
plan (synology_apm.sdk.models.protection_plan.ProtectionPlan | synology_apm.sdk.models.retirement_plan.RetirementPlan) – The plan currently applied to this workload (protection or retirement). Only plan_id, name, and category are guaranteed; other fields are None unless the full plan was separately fetched via the plans / retirement_plans collection.
backup_progress (int | None) – Backup progress percentage (0–100); set for PC/PS/VM when BACKING_UP, else None.
items_backed_up (int | None) – Number of items backed up; set for FS/M365 when BACKING_UP, None for PC/PS/VM.
backup_server (synology_apm.sdk.models.location.LocationInfo | None) – Backup server location info; None if unknown.
backup_copy_destination (synology_apm.sdk.models.location.LocationInfo | None) – Backup Copy destination location info; None if not configured.
backup_copy_data_bytes (int) – Backup Copy storage space in bytes; 0 if no Backup Copy is configured.
- category: WorkloadCategory¶
- status: WorkloadStatus¶
- plan: ProtectionPlan | RetirementPlan¶
- backup_server: LocationInfo | None = None¶
- backup_copy_destination: LocationInfo | None = None¶
- class synology_apm.sdk.models.workload.MachineWorkload(workload_id, name, category, namespace, last_backup_at, is_retired, protected_data_bytes, workload_type, agent_version, *, status, plan, backup_progress=None, items_backed_up=None, backup_server=None, backup_copy_destination=None, backup_copy_data_bytes=0, verify_status=None, device_uuid=None, ip_address=None, inventory_name=None, inventory_type=None, fs_config=None)¶
Bases:
WorkloadDevice backup Workload (category=MACHINE).
Covers PCs, physical servers, VMs, and file servers (PC / PS / VM / FS sub-types). The category field is always WorkloadCategory.MACHINE.
- Variables:
workload_type (synology_apm.sdk.enums.MachineWorkloadType) – Device sub-type (PC / PS / VM / FS).
agent_version (str | None) – Installed agent version (PC/PS); None for VM and FS.
verify_status (synology_apm.sdk.enums.VerifyStatus | None) – Most recent backup verification result (PS/VM only); None for PC/FS.
device_uuid (str | None) – Device UUID (PC/PS/VM); None for FS.
ip_address (str | None) – IP address reported by the agent (PC/PS); None for VM and FS.
inventory_name (str | None) – Hypervisor inventory name where the VM resides (VM only); None otherwise.
inventory_type (str | None) – Hypervisor type, e.g. ESXi / HyperV (VM only); None otherwise.
fs_config (synology_apm.sdk.models.workload.FileServerConfig | None) – File server connection and scope config (FS only); None for PC/PS/VM.
- workload_type: MachineWorkloadType¶
- verify_status: VerifyStatus | None = None¶
- fs_config: FileServerConfig | None = None¶
- backup_copy_destination: LocationInfo | None = None¶
- backup_server: LocationInfo | None = None¶
- category: WorkloadCategory¶
- status: WorkloadStatus¶
- plan: ProtectionPlan | RetirementPlan¶
- class synology_apm.sdk.models.workload.M365UserInfo(user_principal_name)¶
Bases:
objectUser information for a Mailbox / OneDrive / TeamsChat Workload.
- class synology_apm.sdk.models.workload.M365SiteInfo(site_url, site_name)¶
Bases:
objectSite information for a SharePoint Site Workload.
- class synology_apm.sdk.models.workload.M365TeamInfo(team_id, team_name, web_url)¶
Bases:
objectTeam information for a Teams Workload.
- class synology_apm.sdk.models.workload.M365GroupInfo(group_id, display_name, mail)¶
Bases:
objectGroup information for a Group Exchange (M365 Group / shared mailbox) Workload.
- class synology_apm.sdk.models.workload.M365Workload(workload_id, name, category, namespace, last_backup_at, is_retired, protected_data_bytes, workload_type, tenant_id, info, *, status, plan, backup_progress=None, items_backed_up=None, backup_server=None, backup_copy_destination=None, backup_copy_data_bytes=0)¶
Bases:
WorkloadMicrosoft 365 SaaS backup Workload (category=M365).
Each M365Workload represents one service for one account. The category field is always WorkloadCategory.M365.
- Variables:
workload_type (synology_apm.sdk.enums.M365WorkloadType) – M365 service sub-type (EXCHANGE / ONEDRIVE, etc.).
tenant_id (str) – Azure AD tenant ID.
info (synology_apm.sdk.models.workload.M365UserInfo | synology_apm.sdk.models.workload.M365SiteInfo | synology_apm.sdk.models.workload.M365TeamInfo | synology_apm.sdk.models.workload.M365GroupInfo) – Resource info; type varies by workload_type.
- workload_type: M365WorkloadType¶
- info: M365UserInfo | M365SiteInfo | M365TeamInfo | M365GroupInfo¶
- backup_copy_destination: LocationInfo | None = None¶
- backup_server: LocationInfo | None = None¶
- category: WorkloadCategory¶
- status: WorkloadStatus¶
- plan: ProtectionPlan | RetirementPlan¶
- class synology_apm.sdk.models.workload.FileServerPathSelector(path, excluded_paths=())¶
Bases:
objectOne path scope entry for a File Server backup.
- Variables:
- class synology_apm.sdk.models.workload.FileServerConfig(host_ip, host_port, server_type, login_user, enable_vss, connection_timeout_seconds, selectors)¶
Bases:
objectFile server connection settings and backup scope.
Passwords are not included in this model.
- Variables:
host_ip (str) – File server IP address.
host_port (int) – SMB/NAS connection port.
server_type (synology_apm.sdk.enums.FileServerType) – File server protocol / OS type.
login_user (str) – Login account (password not included).
enable_vss (bool) – Whether Windows VSS is enabled (SMB only).
connection_timeout_seconds (int) – Connection timeout in seconds.
selectors (tuple[synology_apm.sdk.models.workload.FileServerPathSelector, ...]) – Backup scope selectors; always has at least one entry.
- server_type: FileServerType¶
- selectors: tuple[FileServerPathSelector, ...]¶
- class synology_apm.sdk.models.workload.FileServerAddRequest(namespace, host_ip, server_type, plan_id, login_user, login_password, host_port=445, enable_vss=False, connection_timeout_seconds=180, trigger_backup=False, selectors=(FileServerPathSelector(path='', excluded_paths=()),))¶
Bases:
objectSpec for registering one File Server workload in APM.
- Variables:
namespace (str) – Backup server namespace of the backup server to register this file server with.
host_ip (str) – File server IP address.
server_type (synology_apm.sdk.enums.FileServerType) – File server protocol / OS type (FileServerType enum).
plan_id (str) – UUID of the Protection Plan to apply to this file server.
login_user (str) – Login account for the file server.
login_password (str) – Login password for the file server (must be non-empty).
host_port (int) – Port for the SMB/NAS connection (default 445).
enable_vss (bool) – Enable Windows VSS snapshot (SMB only; ignored for other types).
connection_timeout_seconds (int) – Connection timeout in seconds (default 180).
trigger_backup (bool) – Trigger an immediate backup after successful registration.
selectors (tuple[synology_apm.sdk.models.workload.FileServerPathSelector, ...]) – Backup scope selectors; defaults to whole file server root.
- Raises:
ValueError – login_password must be non-empty.
- server_type: FileServerType¶
- selectors: tuple[FileServerPathSelector, ...] = (FileServerPathSelector(path='', excluded_paths=()),)¶
- class synology_apm.sdk.models.workload.FileServerUpdateRequest(host_ip, login_user, login_password, host_port=445, enable_vss=False, connection_timeout_seconds=180, selectors=(FileServerPathSelector(path='', excluded_paths=()),))¶
Bases:
objectSpec for updating an existing File Server workload in APM.
Server type cannot be changed after creation and is not included here.
- Variables:
host_ip (str) – Updated file server IP address.
login_user (str) – Updated login account.
login_password (str | None) – Updated password;
Nonekeeps the existing stored password. Empty or whitespace-only string is rejected.host_port (int) – Updated connection port (default 445).
enable_vss (bool) – Updated VSS setting (SMB only).
connection_timeout_seconds (int) – Updated connection timeout in seconds (default 180).
selectors (tuple[synology_apm.sdk.models.workload.FileServerPathSelector, ...]) – Updated backup scope selectors.
- Raises:
ValueError – login_password is an empty or whitespace-only string (pass None to keep the existing password).
- selectors: tuple[FileServerPathSelector, ...] = (FileServerPathSelector(path='', excluded_paths=()),)¶