BackupServerDriver (ROLE = "backup_server", TYPE_LABEL = "Backup Server"): declarations only, under TYPE_CHECKING, like every role base.
Reads: get_backup_datastores, get_backup_groups(datastore="") (each group with its newest snapshot), get_backup_snapshots(datastore, namespace, group_type, group_id), get_backup_jobs, get_backup_remotes.
Actions: start_garbage_collection, run_backup_job(kind, job_id), verify_backup_snapshot, set_backup_snapshot_protected, delete_backup_snapshot; they return a BackupTaskDict, followed with get_backup_task.
Shapes in napalm_device_types/backups.py (models.py is over the file size limit).
ClusterStorageDict.backup_server: NotRequired[BackupServerRefDict | None]: server, port, datastore, namespace, fingerprint of a hypervisor's backup storage.
README, docs/STRUCTURE.md, CHANGELOG (Unreleased; the release is a separate step).
Role key backup_server, not backup, like management_controller and residential_gateway.
Garbage collection is a job (kind: "gc", id = datastore) rather than a field on the datastore: it has a schedule and a last run like the other jobs, so there is one place for "did it run, did it fail".
No matching helper for storage ref → server here: docs/STRUCTURE.md keeps what an application does with a device out of this package. It moves to netOrk (NetOrk/netork#1919).
Added get_backup_snapshots (choose one snapshot to protect or delete) and get_backup_task (follow what an action started).
Checks
pytest: 1194 passed; new modules 100 % covered, total 96 %.
ruff format --check, ruff check, mypy --strict: clean.
napalm-standard check: meets the standard; napalm-standard ratchet: within the baseline.
Not breaking: the new key on ClusterStorageDict is optional, so existing hypervisor drivers stay valid. Minor bump (4.25.0) once merged.
Closes #82. Part of NetOrk/netork#1918 (Proxmox Backup Server support).
## What
- `BackupServerDriver` (`ROLE = "backup_server"`, `TYPE_LABEL = "Backup Server"`): declarations only, under `TYPE_CHECKING`, like every role base.
- Reads: `get_backup_datastores`, `get_backup_groups(datastore="")` (each group with its newest snapshot), `get_backup_snapshots(datastore, namespace, group_type, group_id)`, `get_backup_jobs`, `get_backup_remotes`.
- Actions: `start_garbage_collection`, `run_backup_job(kind, job_id)`, `verify_backup_snapshot`, `set_backup_snapshot_protected`, `delete_backup_snapshot`; they return a `BackupTaskDict`, followed with `get_backup_task`.
- Shapes in `napalm_device_types/backups.py` (`models.py` is over the file size limit).
- `ClusterStorageDict.backup_server: NotRequired[BackupServerRefDict | None]`: server, port, datastore, namespace, fingerprint of a hypervisor's backup storage.
- README, `docs/STRUCTURE.md`, CHANGELOG (Unreleased; the release is a separate step).
## Changed from the proposal in #82
1. Role key `backup_server`, not `backup`, like `management_controller` and `residential_gateway`.
2. Garbage collection is a job (`kind: "gc"`, `id` = datastore) rather than a field on the datastore: it has a schedule and a last run like the other jobs, so there is one place for "did it run, did it fail".
3. No matching helper for storage ref → server here: `docs/STRUCTURE.md` keeps what an application does with a device out of this package. It moves to netOrk (NetOrk/netork#1919).
4. Added `get_backup_snapshots` (choose one snapshot to protect or delete) and `get_backup_task` (follow what an action started).
## Checks
- `pytest`: 1194 passed; new modules 100 % covered, total 96 %.
- `ruff format --check`, `ruff check`, `mypy --strict`: clean.
- `napalm-standard check`: meets the standard; `napalm-standard ratchet`: within the baseline.
Not breaking: the new key on `ClusterStorageDict` is optional, so existing hypervisor drivers stay valid. Minor bump (4.25.0) once merged.
A backup server keeps datastores, one backup group per source with its
snapshots, and the jobs that keep them healthy: garbage collection,
verify, prune, sync and tape. None of that is a pool, a volume or a
replication job, so it is a role of its own instead of being bent into
StorageDriver. A server that manages its own disks lists StorageDriver
second.
The role declares the reads (datastores, groups with their newest
snapshot, a group's snapshots, jobs, remotes) and the actions (garbage
collection, running a job, verifying, protecting and deleting a
snapshot), which start a task and return its id for get_backup_task.
The shapes live in napalm_device_types.backups.
ClusterStorageDict gains an optional backup_server: which server,
datastore and namespace a hypervisor's backup storage writes to, with
the fingerprint it pins. Matching that to a server is the application's.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #82. Part of NetOrk/netork#1918 (Proxmox Backup Server support).
What
BackupServerDriver(ROLE = "backup_server",TYPE_LABEL = "Backup Server"): declarations only, underTYPE_CHECKING, like every role base.get_backup_datastores,get_backup_groups(datastore="")(each group with its newest snapshot),get_backup_snapshots(datastore, namespace, group_type, group_id),get_backup_jobs,get_backup_remotes.start_garbage_collection,run_backup_job(kind, job_id),verify_backup_snapshot,set_backup_snapshot_protected,delete_backup_snapshot; they return aBackupTaskDict, followed withget_backup_task.napalm_device_types/backups.py(models.pyis over the file size limit).ClusterStorageDict.backup_server: NotRequired[BackupServerRefDict | None]: server, port, datastore, namespace, fingerprint of a hypervisor's backup storage.docs/STRUCTURE.md, CHANGELOG (Unreleased; the release is a separate step).Changed from the proposal in #82
backup_server, notbackup, likemanagement_controllerandresidential_gateway.kind: "gc",id= datastore) rather than a field on the datastore: it has a schedule and a last run like the other jobs, so there is one place for "did it run, did it fail".docs/STRUCTURE.mdkeeps what an application does with a device out of this package. It moves to netOrk (NetOrk/netork#1919).get_backup_snapshots(choose one snapshot to protect or delete) andget_backup_task(follow what an action started).Checks
pytest: 1194 passed; new modules 100 % covered, total 96 %.ruff format --check,ruff check,mypy --strict: clean.napalm-standard check: meets the standard;napalm-standard ratchet: within the baseline.Not breaking: the new key on
ClusterStorageDictis optional, so existing hypervisor drivers stay valid. Minor bump (4.25.0) once merged.