admin_backups.go RawHistoryFolder
1package dto
2
3import "time"
4
5// BackupJob represents backup metadata in admin API responses. App is the
6// canonical backup identity: a domain is never used.
7type BackupJob struct {
8 ID string `json:"id"`
9 App string `json:"app"`
10 Service string `json:"service,omitempty"`
11 Database string `json:"database,omitempty"`
12 Schedule string `json:"schedule,omitempty"`
13 Type string `json:"type"`
14 Status string `json:"status"`
15 StartedAt *time.Time `json:"started_at,omitempty"`
16 CompletedAt *time.Time `json:"completed_at,omitempty"`
17 SizeBytes int64 `json:"size_bytes"`
18 Error string `json:"error,omitempty"`
19}
20
21// BackupsResponse is returned by backup listing endpoints.
22type BackupsResponse struct {
23 Backups []BackupJob `json:"backups"`
24}
25
26// BackupRunRequest triggers one declared database backup. Service and
27// Database are explicit selectors; an omitted selector only succeeds when
28// exactly one compatible target exists.
29type BackupRunRequest struct {
30 Service string `json:"service"`
31 Database string `json:"database,omitempty"`
32}
33
34// BackupRunResponse is returned after triggering a backup.
35type BackupRunResponse struct {
36 Status string `json:"status"`
37 Backup *BackupJob `json:"backup,omitempty"`
38}
39
40// VolumeBackupJob represents volume backup metadata in admin API
41// responses. App, service, and the declared volume name are the identity.
42type VolumeBackupJob struct {
43 ID string `json:"id"`
44 App string `json:"app"`
45 Service string `json:"service,omitempty"`
46 VolumeName string `json:"volume"`
47 RuntimeVolumeName string `json:"runtime_volume,omitempty"`
48 MountPath string `json:"mount_path,omitempty"`
49 Compression string `json:"compression,omitempty"`
50 Type string `json:"type"`
51 Status string `json:"status"`
52 StartedAt *time.Time `json:"started_at,omitempty"`
53 CompletedAt *time.Time `json:"completed_at,omitempty"`
54 SizeBytes int64 `json:"size_bytes"`
55 ArtifactRef string `json:"artifact_ref,omitempty"`
56 Error string `json:"error,omitempty"`
57}
58
59// VolumeBackupsResponse is returned by volume backup listing endpoints.
60type VolumeBackupsResponse struct {
61 Backups []VolumeBackupJob `json:"backups"`
62}
63
64// VolumeBackupRunRequest triggers one declared volume backup.
65type VolumeBackupRunRequest struct {
66 Service string `json:"service"`
67 Volume string `json:"volume,omitempty"`
68}
69
70// VolumeBackupRunResponse is returned after triggering a volume backup.
71type VolumeBackupRunResponse struct {
72 Status string `json:"status"`
73 Backups []VolumeBackupJob `json:"backups,omitempty"`
74 Error string `json:"error,omitempty"`
75}