Documentation
¶
Overview ¶
Package systembackup owns Arcane system-recovery backup orchestration and its HTTP surface.
Index ¶
- Variables
- func RegisterSystemBackups(api huma.API, service *SystemBackupService, ...)
- type BrowseSystemBackupFilesInput
- type CreateSystemBackupInput
- type DeleteSystemBackupInput
- type DiscoverSystemBackupsInput
- type GenerateSystemBackupRecoveryKeyOutput
- type ListBackupHistoryInput
- type ListSystemBackupsInput
- type Module
- type RestoreSystemBackupFilesInput
- type RestoreSystemBackupInput
- type RunSystemVolumeBackupsInput
- type SetSystemBackupRecoveryKeyInput
- type SystemBackupHandler
- func (h *SystemBackupHandler) BrowseFiles(ctx context.Context, input *BrowseSystemBackupFilesInput) (*handlerutil.Page[backuptypes.BackupFileEntry], error)
- func (h *SystemBackupHandler) Create(ctx context.Context, input *CreateSystemBackupInput) (*SystemBackupOutput, error)
- func (h *SystemBackupHandler) Delete(ctx context.Context, input *DeleteSystemBackupInput) (*handlerutil.Out[base.MessageResponse], error)
- func (h *SystemBackupHandler) Discover(ctx context.Context, input *DiscoverSystemBackupsInput) (*handlerutil.Out[int], error)
- func (h *SystemBackupHandler) GenerateRecoveryKey(_ context.Context, _ *struct{}) (*GenerateSystemBackupRecoveryKeyOutput, error)
- func (h *SystemBackupHandler) GetPolicies(ctx context.Context, _ *struct{}) (*SystemBackupPoliciesOutput, error)
- func (h *SystemBackupHandler) GetSystemVolumeConfig(ctx context.Context, _ *struct{}) (*SystemVolumeBackupConfigOutput, error)
- func (h *SystemBackupHandler) List(ctx context.Context, input *ListSystemBackupsInput) (*handlerutil.Page[backuptypes.SystemBackupRun], error)
- func (h *SystemBackupHandler) ListHistory(ctx context.Context, input *ListBackupHistoryInput) (*handlerutil.Page[backuptypes.HistoryEntry], error)
- func (h *SystemBackupHandler) ListSystemVolumeOptions(ctx context.Context, _ *struct{}) (*SystemVolumeBackupOptionsOutput, error)
- func (h *SystemBackupHandler) Restore(ctx context.Context, input *RestoreSystemBackupInput) (*handlerutil.Out[base.MessageResponse], error)
- func (h *SystemBackupHandler) RestoreFiles(ctx context.Context, input *RestoreSystemBackupFilesInput) (*handlerutil.Out[base.MessageResponse], error)
- func (h *SystemBackupHandler) RunSystemVolumeBackups(ctx context.Context, input *RunSystemVolumeBackupsInput) (*SystemVolumeBackupRunOutput, error)
- func (h *SystemBackupHandler) SetRecoveryKey(ctx context.Context, input *SetSystemBackupRecoveryKeyInput) (*SystemBackupRecoveryKeyOutput, error)
- func (h *SystemBackupHandler) UpdatePolicies(ctx context.Context, input *UpdateSystemBackupPoliciesInput) (*SystemBackupPoliciesOutput, error)
- func (h *SystemBackupHandler) UpdateSystemVolumeConfig(ctx context.Context, input *UpdateSystemVolumeBackupConfigInput) (*SystemVolumeBackupConfigOutput, error)
- func (h *SystemBackupHandler) Upload(ctx context.Context, input *UploadSystemBackupInput) (*SystemBackupOutput, error)
- type SystemBackupOutput
- type SystemBackupPoliciesOutput
- type SystemBackupPolicy
- type SystemBackupRecoveryConfig
- type SystemBackupRecoveryKeyOutput
- type SystemBackupRun
- type SystemBackupService
- func (s *SystemBackupService) BrowseBackupFiles(ctx context.Context, id, recoveryKey, requestedPath string, ...) ([]backuptypes.BackupFileEntry, pagination.Response, error)
- func (s *SystemBackupService) CreateBackup(ctx context.Context, user common.User, trigger SystemBackupTrigger, ...) (*SystemBackupRun, error)
- func (s *SystemBackupService) DeleteBackup(ctx context.Context, id, recoveryKey string) error
- func (s *SystemBackupService) DiscoverRemoteBackups(ctx context.Context, request backuptypes.DiscoverSystemBackupsRequest) (int, error)
- func (s *SystemBackupService) GenerateRecoveryKey() (*backuptypes.SystemBackupRecoveryKey, error)
- func (s *SystemBackupService) GetPolicies(ctx context.Context) (*backuptypes.SystemBackupPolicyCollection, error)
- func (s *SystemBackupService) GetSystemVolumeBackupConfig(ctx context.Context) (*backuptypes.SystemVolumeBackupPolicyCollection, error)
- func (s *SystemBackupService) ListBackupHistory(ctx context.Context, params pagination.QueryParams) ([]backuptypes.HistoryEntry, pagination.Response, error)
- func (s *SystemBackupService) ListBackups(ctx context.Context, params pagination.QueryParams) ([]backuptypes.SystemBackupRun, pagination.Response, error)
- func (s *SystemBackupService) ListSystemVolumeBackupOptions(ctx context.Context) ([]backuptypes.SystemVolumeBackupOption, error)
- func (s *SystemBackupService) ReconcileInterruptedBackups(ctx context.Context) error
- func (s *SystemBackupService) RegisterBackupJobOnStartup(ctx context.Context)
- func (s *SystemBackupService) RestoreBackup(ctx context.Context, id, recoveryKey string, user common.User) error
- func (s *SystemBackupService) RestoreBackupFiles(ctx context.Context, id string, ...) error
- func (s *SystemBackupService) SetRecoveryKey(ctx context.Context, recoveryKey string) (*backuptypes.SystemBackupRecoveryKeyStatus, error)
- func (s *SystemBackupService) SetScheduler(ctx context.Context, scheduler schedulertypes.DynamicScheduler, ...) error
- func (s *SystemBackupService) StartBackup(ctx context.Context, user common.User, ...) (*backuptypes.SystemBackupRun, error)
- func (s *SystemBackupService) StartSystemVolumeBackups(ctx context.Context, user common.User, ...) (*backuptypes.BackupRunAccepted, error)
- func (s *SystemBackupService) SupportedDatabaseProvider() bool
- func (s *SystemBackupService) UpdatePolicies(ctx context.Context, updates []backuptypes.UpdateSystemBackupPolicy) (*backuptypes.SystemBackupPolicyCollection, error)
- func (s *SystemBackupService) UpdateSystemVolumeBackupConfig(ctx context.Context, updates []backuptypes.UpdateSystemVolumeBackupPolicy) (*backuptypes.SystemVolumeBackupPolicyCollection, error)
- func (s *SystemBackupService) UploadBackup(ctx context.Context, id string, request backuptypes.UploadSystemBackupRequest) (*SystemBackupRun, error)
- type SystemBackupStatus
- type SystemBackupTrigger
- type SystemVolumeBackupConfigOutput
- type SystemVolumeBackupOptionsOutput
- type SystemVolumeBackupRunOutput
- type UpdateSystemBackupPoliciesInput
- type UpdateSystemVolumeBackupConfigInput
- type UploadSystemBackupInput
Constants ¶
This section is empty.
Variables ¶
var ErrSystemBackupAlreadyRunning = errors.New("an Arcane system backup is already running")
Functions ¶
func RegisterSystemBackups ¶
func RegisterSystemBackups(api huma.API, service *SystemBackupService, activityService *activity.ActivityService, appCtx handlerutil.ActivityAppContext)
Types ¶
type BrowseSystemBackupFilesInput ¶ added in v2.10.0
type BrowseSystemBackupFilesInput struct {
ID string `path:"id"`
Path string `query:"path" doc:"Folder path relative to the backup root"`
Search string `query:"search" doc:"Case-insensitive full-path search"`
Start int `query:"start" default:"0" doc:"Start index for the page"`
Limit int `query:"limit" default:"20" doc:"Requested page size"`
Body backuptypes.SystemBackupRecoveryKey
}
BrowseSystemBackupFilesInput selects one page of a system backup tree.
type CreateSystemBackupInput ¶
type CreateSystemBackupInput struct {
Body backuptypes.CreateSystemBackupRequest
}
type DeleteSystemBackupInput ¶
type DeleteSystemBackupInput struct {
ID string `path:"id"`
Body backuptypes.DeleteSystemBackupRequest
}
type DiscoverSystemBackupsInput ¶
type DiscoverSystemBackupsInput struct {
Body backuptypes.DiscoverSystemBackupsRequest
}
type GenerateSystemBackupRecoveryKeyOutput ¶
type GenerateSystemBackupRecoveryKeyOutput struct {
Body backuptypes.SystemBackupRecoveryKey
}
type ListBackupHistoryInput ¶ added in v2.10.0
type ListSystemBackupsInput ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func New ¶
func New(service *SystemBackupService, activityService *activity.ActivityService) *Module
func (*Module) RegisterRoutes ¶
func (m *Module) RegisterRoutes(api huma.API, appCtx handlerutil.ActivityAppContext)
func (*Module) Service ¶
func (m *Module) Service() *SystemBackupService
type RestoreSystemBackupFilesInput ¶ added in v2.10.0
type RestoreSystemBackupFilesInput struct {
ID string `path:"id"`
Body backuptypes.RestoreSystemBackupFilesRequest
}
RestoreSystemBackupFilesInput selects project files to restore from a system backup.
type RestoreSystemBackupInput ¶
type RestoreSystemBackupInput struct {
ID string `path:"id"`
Body backuptypes.RestoreSystemBackupRequest
}
type RunSystemVolumeBackupsInput ¶ added in v2.10.0
type RunSystemVolumeBackupsInput struct {
Body *backuptypes.RunSystemVolumeBackupsRequest `json:"body,omitempty"`
}
type SetSystemBackupRecoveryKeyInput ¶
type SetSystemBackupRecoveryKeyInput struct {
Body backuptypes.SystemBackupRecoveryKey
}
type SystemBackupHandler ¶
type SystemBackupHandler struct {
// contains filtered or unexported fields
}
func (*SystemBackupHandler) BrowseFiles ¶ added in v2.10.0
func (h *SystemBackupHandler) BrowseFiles(ctx context.Context, input *BrowseSystemBackupFilesInput) (*handlerutil.Page[backuptypes.BackupFileEntry], error)
BrowseFiles returns one lazy-loaded project tree page.
func (*SystemBackupHandler) Create ¶
func (h *SystemBackupHandler) Create(ctx context.Context, input *CreateSystemBackupInput) (*SystemBackupOutput, error)
func (*SystemBackupHandler) Delete ¶
func (h *SystemBackupHandler) Delete(ctx context.Context, input *DeleteSystemBackupInput) (*handlerutil.Out[base.MessageResponse], error)
func (*SystemBackupHandler) Discover ¶
func (h *SystemBackupHandler) Discover(ctx context.Context, input *DiscoverSystemBackupsInput) (*handlerutil.Out[int], error)
func (*SystemBackupHandler) GenerateRecoveryKey ¶
func (h *SystemBackupHandler) GenerateRecoveryKey(_ context.Context, _ *struct{}) (*GenerateSystemBackupRecoveryKeyOutput, error)
func (*SystemBackupHandler) GetPolicies ¶
func (h *SystemBackupHandler) GetPolicies(ctx context.Context, _ *struct{}) (*SystemBackupPoliciesOutput, error)
func (*SystemBackupHandler) GetSystemVolumeConfig ¶ added in v2.10.0
func (h *SystemBackupHandler) GetSystemVolumeConfig(ctx context.Context, _ *struct{}) (*SystemVolumeBackupConfigOutput, error)
func (*SystemBackupHandler) List ¶
func (h *SystemBackupHandler) List(ctx context.Context, input *ListSystemBackupsInput) (*handlerutil.Page[backuptypes.SystemBackupRun], error)
func (*SystemBackupHandler) ListHistory ¶ added in v2.10.0
func (h *SystemBackupHandler) ListHistory(ctx context.Context, input *ListBackupHistoryInput) (*handlerutil.Page[backuptypes.HistoryEntry], error)
func (*SystemBackupHandler) ListSystemVolumeOptions ¶ added in v2.10.0
func (h *SystemBackupHandler) ListSystemVolumeOptions(ctx context.Context, _ *struct{}) (*SystemVolumeBackupOptionsOutput, error)
func (*SystemBackupHandler) Restore ¶
func (h *SystemBackupHandler) Restore(ctx context.Context, input *RestoreSystemBackupInput) (*handlerutil.Out[base.MessageResponse], error)
func (*SystemBackupHandler) RestoreFiles ¶ added in v2.10.0
func (h *SystemBackupHandler) RestoreFiles(ctx context.Context, input *RestoreSystemBackupFilesInput) (*handlerutil.Out[base.MessageResponse], error)
RestoreFiles restores selected project files from a system backup.
func (*SystemBackupHandler) RunSystemVolumeBackups ¶ added in v2.10.0
func (h *SystemBackupHandler) RunSystemVolumeBackups(ctx context.Context, input *RunSystemVolumeBackupsInput) (*SystemVolumeBackupRunOutput, error)
func (*SystemBackupHandler) SetRecoveryKey ¶
func (h *SystemBackupHandler) SetRecoveryKey(ctx context.Context, input *SetSystemBackupRecoveryKeyInput) (*SystemBackupRecoveryKeyOutput, error)
func (*SystemBackupHandler) UpdatePolicies ¶
func (h *SystemBackupHandler) UpdatePolicies(ctx context.Context, input *UpdateSystemBackupPoliciesInput) (*SystemBackupPoliciesOutput, error)
func (*SystemBackupHandler) UpdateSystemVolumeConfig ¶ added in v2.10.0
func (h *SystemBackupHandler) UpdateSystemVolumeConfig(ctx context.Context, input *UpdateSystemVolumeBackupConfigInput) (*SystemVolumeBackupConfigOutput, error)
func (*SystemBackupHandler) Upload ¶
func (h *SystemBackupHandler) Upload(ctx context.Context, input *UploadSystemBackupInput) (*SystemBackupOutput, error)
type SystemBackupOutput ¶
type SystemBackupOutput struct{ Body backuptypes.SystemBackupRun }
type SystemBackupPoliciesOutput ¶
type SystemBackupPoliciesOutput struct {
Body backuptypes.SystemBackupPolicyCollection
}
type SystemBackupPolicy ¶
type SystemBackupPolicy struct {
database.BaseModel
Enabled bool `gorm:"column:enabled;not null;default:false"`
Schedule string `gorm:"column:schedule;type:text;not null"`
RetentionCount int `gorm:"column:retention_count;not null;default:7"`
LocalEnabled bool `gorm:"column:local_enabled;not null;default:true"`
S3Enabled bool `gorm:"column:s3_enabled;not null;default:false"`
S3DestinationID string `gorm:"column:s3_destination_id;type:text;index"`
}
func (SystemBackupPolicy) TableName ¶
func (SystemBackupPolicy) TableName() string
func (SystemBackupPolicy) ToDTO ¶
func (p SystemBackupPolicy) ToDTO(lastRun *SystemBackupRun) backuptypes.SystemBackupPolicy
type SystemBackupRecoveryConfig ¶
type SystemBackupRecoveryConfig struct {
database.BaseModel
EncryptedRecoveryKey string `gorm:"column:encrypted_recovery_key;type:text;not null"`
}
func (SystemBackupRecoveryConfig) TableName ¶
func (SystemBackupRecoveryConfig) TableName() string
type SystemBackupRecoveryKeyOutput ¶
type SystemBackupRecoveryKeyOutput struct {
Body backuptypes.SystemBackupRecoveryKeyStatus
}
type SystemBackupRun ¶
type SystemBackupRun struct {
database.BaseModel
Size int64 `json:"size" gorm:"column:size" sortable:"true"`
CreatedAt time.Time `json:"createdAt" gorm:"column:created_at" sortable:"true"`
Status SystemBackupStatus `json:"status" gorm:"column:status;type:text;not null" sortable:"true"`
Trigger SystemBackupTrigger `json:"trigger" gorm:"column:trigger;type:text;not null" sortable:"true"`
Destination backuptypes.SystemBackupDestination `json:"destination" gorm:"column:destination;type:text;not null" sortable:"true"`
LocalSnapshotID string `json:"localSnapshotId,omitempty" gorm:"column:local_snapshot_id;type:text"`
RemoteSnapshotID string `json:"remoteSnapshotId,omitempty" gorm:"column:remote_snapshot_id;type:text"`
S3DestinationID string `json:"s3DestinationId,omitempty" gorm:"column:s3_destination_id;type:text;index"`
S3DestinationName string `json:"s3DestinationName,omitempty" gorm:"-"`
PolicyID string `json:"policyId,omitempty" gorm:"column:policy_id;type:text;index"`
Error string `json:"error,omitempty" gorm:"column:error;type:text"`
}
func (SystemBackupRun) TableName ¶
func (SystemBackupRun) TableName() string
func (SystemBackupRun) ToDTO ¶
func (b SystemBackupRun) ToDTO() backuptypes.SystemBackupRun
type SystemBackupService ¶
type SystemBackupService struct {
// contains filtered or unexported fields
}
func NewSystemBackupService ¶
func NewSystemBackupService(db *database.DB, dockerService *docker.DockerClientService, volumeService *volume.VolumeService, engine *backup.Engine, s3Destinations *s3domain.S3DestinationService, activityService *activity.ActivityService, settingsService *settings.SettingsService, cfg *config.Config) *SystemBackupService
func (*SystemBackupService) BrowseBackupFiles ¶ added in v2.10.0
func (s *SystemBackupService) BrowseBackupFiles(ctx context.Context, id, recoveryKey, requestedPath string, params pagination.QueryParams) ([]backuptypes.BackupFileEntry, pagination.Response, error)
BrowseBackupFiles returns one page from the backup's logical project tree.
func (*SystemBackupService) CreateBackup ¶
func (s *SystemBackupService) CreateBackup(ctx context.Context, user common.User, trigger SystemBackupTrigger, request backuptypes.CreateSystemBackupRequest) (*SystemBackupRun, error)
func (*SystemBackupService) DeleteBackup ¶
func (s *SystemBackupService) DeleteBackup(ctx context.Context, id, recoveryKey string) error
func (*SystemBackupService) DiscoverRemoteBackups ¶
func (s *SystemBackupService) DiscoverRemoteBackups(ctx context.Context, request backuptypes.DiscoverSystemBackupsRequest) (int, error)
func (*SystemBackupService) GenerateRecoveryKey ¶
func (s *SystemBackupService) GenerateRecoveryKey() (*backuptypes.SystemBackupRecoveryKey, error)
func (*SystemBackupService) GetPolicies ¶
func (s *SystemBackupService) GetPolicies(ctx context.Context) (*backuptypes.SystemBackupPolicyCollection, error)
func (*SystemBackupService) GetSystemVolumeBackupConfig ¶ added in v2.10.0
func (s *SystemBackupService) GetSystemVolumeBackupConfig(ctx context.Context) (*backuptypes.SystemVolumeBackupPolicyCollection, error)
func (*SystemBackupService) ListBackupHistory ¶ added in v2.10.0
func (s *SystemBackupService) ListBackupHistory(ctx context.Context, params pagination.QueryParams) ([]backuptypes.HistoryEntry, pagination.Response, error)
ListBackupHistory returns a unified, server-paginated view of local backup records.
func (*SystemBackupService) ListBackups ¶
func (s *SystemBackupService) ListBackups(ctx context.Context, params pagination.QueryParams) ([]backuptypes.SystemBackupRun, pagination.Response, error)
func (*SystemBackupService) ListSystemVolumeBackupOptions ¶ added in v2.10.0
func (s *SystemBackupService) ListSystemVolumeBackupOptions(ctx context.Context) ([]backuptypes.SystemVolumeBackupOption, error)
ListSystemVolumeBackupOptions returns live choices plus configured names that are currently unavailable.
func (*SystemBackupService) ReconcileInterruptedBackups ¶ added in v2.10.2
func (s *SystemBackupService) ReconcileInterruptedBackups(ctx context.Context) error
ReconcileInterruptedBackups marks work interrupted by the previous process.
func (*SystemBackupService) RegisterBackupJobOnStartup ¶
func (s *SystemBackupService) RegisterBackupJobOnStartup(ctx context.Context)
func (*SystemBackupService) RestoreBackup ¶
func (*SystemBackupService) RestoreBackupFiles ¶ added in v2.10.0
func (s *SystemBackupService) RestoreBackupFiles(ctx context.Context, id string, request backuptypes.RestoreSystemBackupFilesRequest, user common.User) error
RestoreBackupFiles restores selected project files after creating a safety snapshot.
func (*SystemBackupService) SetRecoveryKey ¶
func (s *SystemBackupService) SetRecoveryKey(ctx context.Context, recoveryKey string) (*backuptypes.SystemBackupRecoveryKeyStatus, error)
func (*SystemBackupService) SetScheduler ¶
func (s *SystemBackupService) SetScheduler(ctx context.Context, scheduler schedulertypes.DynamicScheduler, admissionGate *actors.Gate[actors.AdmissionKey]) error
SetScheduler injects the dynamic scheduler and admission gate for per-policy system backup jobs. Agent mode leaves them unset.
func (*SystemBackupService) StartBackup ¶ added in v2.10.2
func (s *SystemBackupService) StartBackup(ctx context.Context, user common.User, request backuptypes.CreateSystemBackupRequest) (*backuptypes.SystemBackupRun, error)
StartBackup prepares a manual backup before submitting its snapshot work.
func (*SystemBackupService) StartSystemVolumeBackups ¶ added in v2.10.2
func (s *SystemBackupService) StartSystemVolumeBackups(ctx context.Context, user common.User, request backuptypes.RunSystemVolumeBackupsRequest) (*backuptypes.BackupRunAccepted, error)
StartSystemVolumeBackups freezes the selected policy and volumes before returning.
func (*SystemBackupService) SupportedDatabaseProvider ¶
func (s *SystemBackupService) SupportedDatabaseProvider() bool
SupportedDatabaseProvider reports whether system recovery works on the configured database. Recovery is currently SQLite-only.
func (*SystemBackupService) UpdatePolicies ¶
func (s *SystemBackupService) UpdatePolicies(ctx context.Context, updates []backuptypes.UpdateSystemBackupPolicy) (*backuptypes.SystemBackupPolicyCollection, error)
func (*SystemBackupService) UpdateSystemVolumeBackupConfig ¶ added in v2.10.0
func (s *SystemBackupService) UpdateSystemVolumeBackupConfig(ctx context.Context, updates []backuptypes.UpdateSystemVolumeBackupPolicy) (*backuptypes.SystemVolumeBackupPolicyCollection, error)
func (*SystemBackupService) UploadBackup ¶
func (s *SystemBackupService) UploadBackup(ctx context.Context, id string, request backuptypes.UploadSystemBackupRequest) (*SystemBackupRun, error)
type SystemBackupStatus ¶
type SystemBackupStatus string
const ( SystemBackupStatusRunning SystemBackupStatus = "running" SystemBackupStatusSucceeded SystemBackupStatus = "succeeded" SystemBackupStatusFailed SystemBackupStatus = "failed" )
type SystemBackupTrigger ¶
type SystemBackupTrigger string
const ( SystemBackupTriggerManual SystemBackupTrigger = "manual" SystemBackupTriggerScheduled SystemBackupTrigger = "scheduled" SystemBackupTriggerSafety SystemBackupTrigger = "safety" )
type SystemVolumeBackupConfigOutput ¶ added in v2.10.0
type SystemVolumeBackupConfigOutput struct {
Body backuptypes.SystemVolumeBackupPolicyCollection
}
type SystemVolumeBackupOptionsOutput ¶ added in v2.10.0
type SystemVolumeBackupOptionsOutput struct {
Body []backuptypes.SystemVolumeBackupOption
}
type SystemVolumeBackupRunOutput ¶ added in v2.10.0
type SystemVolumeBackupRunOutput struct {
Body backuptypes.BackupRunAccepted
}
type UpdateSystemBackupPoliciesInput ¶
type UpdateSystemBackupPoliciesInput struct {
Body backuptypes.UpdateSystemBackupPolicies
}
type UpdateSystemVolumeBackupConfigInput ¶ added in v2.10.0
type UpdateSystemVolumeBackupConfigInput struct {
Body backuptypes.UpdateSystemVolumeBackupPolicies
}
type UploadSystemBackupInput ¶
type UploadSystemBackupInput struct {
ID string `path:"id"`
Body backuptypes.UploadSystemBackupRequest
}