synology_apm.sdk.collections.tiering_plans module¶
TieringPlanCollection — collection interface for tiering plans.
- class synology_apm.sdk.collections.tiering_plans.TieringPlanCollection(session)¶
Bases:
objectCollection interface for managing tiering plans.
Accessed via APMClient.tiering_plans; should not be instantiated directly. Tiering plans move backup versions to a remote storage destination after a configurable number of days.
- async list(name_contains=None, limit=500, offset=0)¶
List all Tiering Plans.
Destination details are resolved concurrently for all plans in the page.
- async get(plan_id)¶
Fetch a Tiering Plan by UUID.
- Parameters:
plan_id (str) – Plan UUID.
- Raises:
ResourceNotFoundError – No matching plan found.
- async get_by_name(name)¶
Fetch a Tiering Plan by name.
Pages through results with keyword=name until an exact name match is found. The destination is resolved only for the matching plan.
- Parameters:
name (str) – Plan name (exact match, case-insensitive).
- Raises:
ResourceNotFoundError – Plan not found.
- async create(request)¶
Create a Tiering Plan.
- Parameters:
request (TieringPlanCreateRequest) – Plan creation parameters (destination must be from apm.remote_storages).
- Returns:
The created plan with destination resolved.
- Raises:
PlanNameConflictError – A plan with this name already exists.
- Return type:
- async update(plan_id, request)¶
Update an existing Tiering Plan.
- Parameters:
plan_id (str) – UUID of the plan to update.
request (TieringPlanCreateRequest) – New plan configuration.
- Returns:
The updated plan with destination resolved.
- Raises:
PlanNameConflictError – The new name is already taken by another plan.
- Return type:
- async delete(plan)¶
Delete a Tiering Plan by plan object or UUID.
Deleting a plan that does not exist is a no-op (the operation succeeds silently).
- Parameters:
plan (TieringPlan | str) – TieringPlan object or plan UUID string.
- Raises:
PlanInUseError – Backup servers are assigned to this plan.