(feature) Add snapshot discovery action to host view

Add a staff-only POST action on host detail pages to discover existing snapshots
for that host and record them into SQL. Show success or failure feedback through
Django messages, and keep the action non-destructive before adding heavier
backup or retention controls.

Cover the action with view tests for successful discovery, redirect behavior,
and method safety.
This commit is contained in:
2026-05-19 11:56:45 +02:00
parent b0c6afad09
commit 3f3bdf2d45
6 changed files with 91 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ from pobsync_backend import api, views
urlpatterns = [
path("", views.dashboard, name="dashboard"),
path("hosts/<str:host>/", views.host_detail, name="host_detail"),
path("hosts/<str:host>/discover-snapshots/", views.discover_host_snapshots, name="discover_host_snapshots"),
path("api/", api.api_index),
path("api/status/", api.status),
path("api/hosts/", api.hosts),