admin_backups.go RawHistoryFolder
1package dto
2
3import "time"
4
5// BackupJob represents backup metadata in admin API responses.
6type BackupJob struct {
7 ID string `json:"id"`
8 Domain string `json:"domain"`
9 DBName string `json:"db_name"`
10 Schedule string `json:"schedule,omitempty"`
11 Type string `json:"type"`
12 Status string `json:"status"`
13 StartedAt *time.Time `json:"started_at,omitempty"`
14 CompletedAt *time.Time `json:"completed_at,omitempty"`
15 SizeBytes int64 `json:"size_bytes"`
16 Error string `json:"error,omitempty"`
17}
18
19// BackupsResponse is returned by backup listing endpoints.
20type BackupsResponse struct {
21 Backups []BackupJob `json:"backups"`
22}
23
24// BackupRunRequest triggers a backup run.
25type BackupRunRequest struct {
26 DB string `json:"db,omitempty"`
27}
28
29// BackupRunResponse is returned after triggering a backup.
30type BackupRunResponse struct {
31 Status string `json:"status"`
32 Backup *BackupJob `json:"backup,omitempty"`
33}
34
35// DatabaseInfo represents a detected database attachment.
36type DatabaseInfo struct {
37 Type string `json:"type"`
38 Name string `json:"name"`
39 Version string `json:"version,omitempty"`
40 Host string `json:"host"`
41 Port int `json:"port"`
42 ContainerID string `json:"container_id"`
43 ImageName string `json:"image_name"`
44}
45
46// BackupDetectResponse is returned by detect endpoints.
47type BackupDetectResponse struct {
48 Databases []DatabaseInfo `json:"databases"`
49}
50
51// VolumeBackupJob represents volume backup metadata in admin API responses.
52type VolumeBackupJob struct {
53 ID string `json:"id"`
54 Domain string `json:"domain"`
55 ContainerName string `json:"container_name,omitempty"`
56 ContainerID string `json:"container_id,omitempty"`
57 VolumeName string `json:"volume_name"`
58 MountPath string `json:"mount_path,omitempty"`
59 Compression string `json:"compression,omitempty"`
60 Type string `json:"type"`
61 Status string `json:"status"`
62 StartedAt *time.Time `json:"started_at,omitempty"`
63 CompletedAt *time.Time `json:"completed_at,omitempty"`
64 SizeBytes int64 `json:"size_bytes"`
65 ArtifactRef string `json:"artifact_ref,omitempty"`
66 Error string `json:"error,omitempty"`
67}
68
69// VolumeBackupsResponse is returned by volume backup listing endpoints.
70type VolumeBackupsResponse struct {
71 Backups []VolumeBackupJob `json:"backups"`
72}
73
74// VolumeBackupRunRequest triggers volume backups.
75type VolumeBackupRunRequest struct {
76 Volume string `json:"volume,omitempty"`
77}
78
79// VolumeBackupRunResponse is returned after triggering volume backups.
80type VolumeBackupRunResponse struct {
81 Status string `json:"status"`
82 Backups []VolumeBackupJob `json:"backups,omitempty"`
83 Error string `json:"error,omitempty"`
84}