backup

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupJob

type BackupJob struct {
	BackupJobID       string
	BackupVaultName   string
	BackupVaultArn    string
	ResourceArn       string
	ResourceType      string
	State             string
	StatusMessage     string
	CreationDate      time.Time
	CompletionDate    *time.Time
	BackupSizeInBytes int64
	RecoveryPointArn  string
	// contains filtered or unexported fields
}

BackupJob represents a backup job.

type BackupLifecycle

type BackupLifecycle struct {
	DeleteAfterDays            int64
	MoveToColdStorageAfterDays int64
}

BackupLifecycle defines retention for a backup rule.

type BackupPlan

type BackupPlan struct {
	BackupPlanID   string
	BackupPlanArn  string
	BackupPlanName string
	Rules          []BackupRule
	CreatedAt      time.Time
	VersionID      string
}

BackupPlan represents an AWS Backup plan.

type BackupRule

type BackupRule struct {
	RuleName                string
	TargetBackupVaultName   string
	ScheduleExpression      string
	StartWindowMinutes      int64
	CompletionWindowMinutes int64
	Lifecycle               *BackupLifecycle
}

BackupRule represents a rule in a backup plan.

type BackupSelection

type BackupSelection struct {
	SelectionID   string
	SelectionName string
	BackupPlanID  string
	IamRoleArn    string
	Resources     []string
	CreationDate  time.Time
}

BackupSelection represents a backup selection (resources to back up).

type BackupService

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

BackupService is the cloudmock implementation of the AWS Backup API.

func New

func New(accountID, region string) *BackupService

New returns a new BackupService for the given AWS account ID and region.

func (*BackupService) Actions

func (s *BackupService) Actions() []service.Action

Actions returns the list of Backup API actions supported by this service.

func (*BackupService) HandleRequest

func (s *BackupService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)

HandleRequest routes an incoming Backup request to the appropriate handler.

func (*BackupService) HealthCheck

func (s *BackupService) HealthCheck() error

HealthCheck always returns nil.

func (*BackupService) Name

func (s *BackupService) Name() string

Name returns the AWS service name used for routing.

type BackupVault

type BackupVault struct {
	BackupVaultName        string
	BackupVaultArn         string
	CreationDate           time.Time
	NumberOfRecoveryPoints int64
	EncryptionKeyArn       string
	Locked                 bool
	LockDate               *time.Time
	MinRetentionDays       int64
	MaxRetentionDays       int64
}

BackupVault represents a backup vault.

type RecoveryPoint

type RecoveryPoint struct {
	RecoveryPointArn  string
	BackupVaultName   string
	BackupVaultArn    string
	ResourceArn       string
	ResourceType      string
	CreationDate      time.Time
	Status            string
	BackupSizeInBytes int64
	IsEncrypted       bool
}

RecoveryPoint represents a recovery point.

type Store

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

Store manages Backup resources in memory.

func NewStore

func NewStore(accountID, region string) *Store

NewStore returns a new empty Backup Store.

func (*Store) CreateBackupPlan

func (s *Store) CreateBackupPlan(name string, rules []BackupRule) (*BackupPlan, error)

CreateBackupPlan creates a new backup plan.

func (*Store) CreateBackupSelection

func (s *Store) CreateBackupSelection(planID, selName, iamRoleArn string, resources []string) (*BackupSelection, error)

CreateBackupSelection creates a backup selection for a plan.

func (*Store) CreateBackupVault

func (s *Store) CreateBackupVault(name, encryptionKeyArn string) (*BackupVault, error)

CreateBackupVault creates a new backup vault.

func (*Store) DeleteBackupPlan

func (s *Store) DeleteBackupPlan(planID string) bool

DeleteBackupPlan deletes a backup plan.

func (*Store) DeleteBackupSelection

func (s *Store) DeleteBackupSelection(planID, selID string) bool

DeleteBackupSelection deletes a backup selection.

func (*Store) DeleteBackupVault

func (s *Store) DeleteBackupVault(name string) (bool, string)

DeleteBackupVault deletes a backup vault.

func (*Store) GetBackupJob

func (s *Store) GetBackupJob(jobID string) (*BackupJob, bool)

GetBackupJob retrieves a backup job.

func (*Store) GetBackupPlan

func (s *Store) GetBackupPlan(planID string) (*BackupPlan, bool)

GetBackupPlan retrieves a backup plan by ID.

func (*Store) GetBackupSelection

func (s *Store) GetBackupSelection(planID, selID string) (*BackupSelection, bool)

GetBackupSelection retrieves a backup selection.

func (*Store) GetBackupVault

func (s *Store) GetBackupVault(name string) (*BackupVault, bool)

GetBackupVault retrieves a backup vault by name.

func (*Store) GetRecoveryPoint

func (s *Store) GetRecoveryPoint(vaultName, rpArn string) (*RecoveryPoint, bool)

GetRecoveryPoint retrieves a recovery point.

func (*Store) ListBackupJobs

func (s *Store) ListBackupJobs() []*BackupJob

ListBackupJobs returns all backup jobs.

func (*Store) ListBackupPlans

func (s *Store) ListBackupPlans() []*BackupPlan

ListBackupPlans returns all backup plans.

func (*Store) ListBackupSelections

func (s *Store) ListBackupSelections(planID string) []*BackupSelection

ListBackupSelections returns all selections for a plan.

func (*Store) ListBackupVaults

func (s *Store) ListBackupVaults() []*BackupVault

ListBackupVaults returns all backup vaults.

func (*Store) ListRecoveryPoints

func (s *Store) ListRecoveryPoints(vaultName string) []*RecoveryPoint

ListRecoveryPoints returns recovery points for a vault.

func (*Store) LockBackupVault

func (s *Store) LockBackupVault(name string, minRetention, maxRetention int64) error

LockBackupVault locks a vault with retention policy.

func (*Store) StartBackupJob

func (s *Store) StartBackupJob(vaultName, resourceArn, resourceType, iamRoleArn string) (*BackupJob, error)

StartBackupJob starts a backup job.

Jump to

Keyboard shortcuts

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