synology_apm.sdk.collections.m365_auto_backup_rule module

M365AutoBackupRuleCollection — manage M365 auto-backup rules.

class synology_apm.sdk.collections.m365_auto_backup_rule.M365AutoBackupRuleCollection(session)

Bases: object

Collection interface for managing M365 auto-backup rules.

Accessed via APMClient.m365.auto_backup_rules; should not be instantiated directly.

Auto-backup rules have two independently-managed sections:

  • User Services (CRUD on per-plan rules): Exchange / OneDrive / Chat workloads are added automatically when their Azure AD group membership changes.

  • Collaboration Services (single settings object per tenant): Microsoft 365 Groups, SharePoint Sites, SharePoint Personal Sites, and Teams — all items of the enabled types are included automatically.

async list(tenant_id)

Return all auto-backup rules and collaboration service settings for a tenant.

Parameters:

tenant_id (str) – Azure AD tenant ID.

Returns:

M365AutoBackupRuleListResult containing user-service rules and per-type collaboration service settings. Rules pending deletion are excluded.

Return type:

M365AutoBackupRuleListResult

async create(tenant_id, namespace, plan_id, exchange_group_ids=None, onedrive_group_ids=None, chat_group_ids=None)

Create a new User Services auto-backup rule for an M365 tenant.

A single rule associates one protection plan and one backup server with a set of Azure AD groups for Exchange, OneDrive, and/or Chat service types.

Parameters:
  • tenant_id (str) – Azure AD tenant ID.

  • namespace (str) – Backup server namespace (= BackupServer.namespace).

  • plan_id (str) – Protection plan ID to apply (= ProtectionPlan.plan_id).

  • exchange_group_ids (Sequence[str] | None) – Azure AD group IDs whose Exchange members are auto-protected.

  • onedrive_group_ids (Sequence[str] | None) – Azure AD group IDs whose OneDrive members are auto-protected.

  • chat_group_ids (Sequence[str] | None) – Azure AD group IDs whose Chat members are auto-protected.

async update(rule, plan_id=None, exchange_group_ids=None, onedrive_group_ids=None, chat_group_ids=None)

Update an existing User Services auto-backup rule.

Only the supplied fields are changed; omit a parameter to keep its current value.

Parameters:
  • rule (M365AutoBackupRule) – Existing rule to update (obtained via list()).

  • plan_id (str | None) – Replacement protection plan ID, or None to keep current.

  • exchange_group_ids (Sequence[str] | None) – Replacement Exchange group IDs, or None to keep current.

  • onedrive_group_ids (Sequence[str] | None) – Replacement OneDrive group IDs, or None to keep current.

  • chat_group_ids (Sequence[str] | None) – Replacement Chat group IDs, or None to keep current.

async delete(rule)

Delete a User Services auto-backup rule.

Parameters:

rule (M365AutoBackupRule) – Rule to delete (obtained via list()).

async update_collab_settings(tenant_id, group_exchange=None, mysite=None, sharepoint=None, teams=None)

Replace the Collaboration Services auto-backup settings for an M365 tenant.

Replaces all four service-type settings atomically; any type not provided (or None) is set to disabled (empty plan). Pass the current M365CollabServiceSetting values from list() to preserve unmodified types.

Parameters: