backup

package module
v0.0.0-...-e5acfe3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupAPIServer

type BackupAPIServer struct {
	// contains filtered or unexported fields
}

BackupAPIServer provides REST endpoints for backup operations

func NewBackupAPIServer

func NewBackupAPIServer(
	backupManager *backup.BackupManager,
	retentionManager *backup.RetentionManager,
	restoreManager *backup.RestoreManager,
) *BackupAPIServer

NewBackupAPIServer creates a new backup API server

func (*BackupAPIServer) Router

func (s *BackupAPIServer) Router() *mux.Router

Router returns the API router

type BackupCreateRequest

type BackupCreateRequest struct {
	VMID       string            `json:"vm_id"`
	VMPath     string            `json:"vm_path"`
	BackupType string            `json:"backup_type"`
	PolicyID   string            `json:"policy_id,omitempty"`
	Metadata   map[string]string `json:"metadata,omitempty"`
}

BackupCreateRequest represents a backup creation request

type BackupCreateResponse

type BackupCreateResponse struct {
	BackupID  string            `json:"backup_id"`
	VMID      string            `json:"vm_id"`
	Type      string            `json:"type"`
	Status    string            `json:"status"`
	CreatedAt time.Time         `json:"created_at"`
	Metadata  map[string]string `json:"metadata,omitempty"`
}

BackupCreateResponse represents a backup creation response

type BackupInfo

type BackupInfo struct {
	ID               string            `json:"id"`
	VMID             string            `json:"vm_id"`
	Type             string            `json:"type"`
	Size             int64             `json:"size"`
	CompressedSize   int64             `json:"compressed_size"`
	CreatedAt        time.Time         `json:"created_at"`
	ParentID         string            `json:"parent_id,omitempty"`
	BlockCount       int64             `json:"block_count"`
	ChangedBlocks    int64             `json:"changed_blocks"`
	CompressionRatio float64           `json:"compression_ratio"`
	Metadata         map[string]string `json:"metadata,omitempty"`
}

BackupInfo represents backup information in API responses

type BackupListResponse

type BackupListResponse struct {
	Backups []BackupInfo `json:"backups"`
	Total   int          `json:"total"`
}

BackupListResponse represents a backup list response

type BackupVerificationResponse

type BackupVerificationResponse struct {
	BackupID         string                 `json:"backup_id"`
	Status           string                 `json:"status"`
	CheckedItems     int                    `json:"checked_items"`
	ErrorsFound      []string               `json:"errors_found"`
	VerificationTime time.Time              `json:"verification_time"`
	Details          map[string]interface{} `json:"details,omitempty"`
}

BackupVerificationResponse represents a backup verification response for the backup API

type RestoreCreateRequest

type RestoreCreateRequest struct {
	BackupID          string            `json:"backup_id"`
	TargetPath        string            `json:"target_path"`
	RestoreType       string            `json:"restore_type,omitempty"`
	PointInTime       *time.Time        `json:"point_in_time,omitempty"`
	SelectiveFiles    []string          `json:"selective_files,omitempty"`
	VerifyRestore     bool              `json:"verify_restore"`
	OverwriteExisting bool              `json:"overwrite_existing"`
	Metadata          map[string]string `json:"metadata,omitempty"`
}

RestoreCreateRequest represents a restore request

type RestoreStatusResponse

type RestoreStatusResponse struct {
	ID            string     `json:"id"`
	BackupID      string     `json:"backup_id"`
	VMID          string     `json:"vm_id"`
	Status        string     `json:"status"`
	Progress      int        `json:"progress"`
	StartedAt     time.Time  `json:"started_at"`
	CompletedAt   *time.Time `json:"completed_at,omitempty"`
	TotalBytes    int64      `json:"total_bytes"`
	RestoredBytes int64      `json:"restored_bytes"`
	Error         string     `json:"error,omitempty"`
}

RestoreStatusResponse represents a restore status response

type RetentionPolicyRequest

type RetentionPolicyRequest struct {
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Rules       *backup.RetentionRules `json:"rules"`
	GFSConfig   *backup.GFSConfig      `json:"gfs_config,omitempty"`
	Enabled     bool                   `json:"enabled"`
	Metadata    map[string]string      `json:"metadata,omitempty"`
}

RetentionPolicyRequest represents a retention policy request

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL