synology_apm.sdk.collections.retirement_plans module¶
RetirementPlanCollection — collection interface for retirement plans.
- class synology_apm.sdk.collections.retirement_plans.RetirementPlanCollection(session)¶
Bases:
objectCollection interface for managing retirement plans.
Accessed via APMClient.retirement_plans; should not be instantiated directly. Retirement plans are category-agnostic and apply across all workload categories.
- async list(name_contains=None, limit=500, offset=0)¶
List all Retirement Plans.
- async get(plan_id)¶
Fetch a Retirement Plan by UUID.
- Parameters:
plan_id (str) – Plan UUID.
- Raises:
ResourceNotFoundError – No matching plan found.
- async get_by_name(name)¶
Fetch a Retirement Plan by name.
- Parameters:
name (str) – Plan name (exact match, case-insensitive).
- Raises:
ResourceNotFoundError – Plan not found.
- async create(request)¶
Create a Retirement Plan.
- Parameters:
request (RetirementPlanCreateRequest) – Plan creation parameters.
- Returns:
The created plan.
- Raises:
PlanNameConflictError – A plan with this name already exists.
- Return type:
- async update(plan_id, request)¶
Update an existing Retirement Plan.
- Parameters:
plan_id (str) – UUID of the plan to update.
request (RetirementPlanCreateRequest) – New plan configuration.
- Returns:
The updated plan.
- Raises:
PlanNameConflictError – The new name is already taken by another plan.
- Return type:
- async delete(plan)¶
Delete a Retirement Plan by plan object or UUID.
Deleting a plan that does not exist is a no-op (the operation succeeds silently).
- Parameters:
plan (RetirementPlan | str) – RetirementPlan object or plan UUID string.
- Raises:
PlanInUseError – The plan is still assigned to workloads.