snapshotstate

package
v0.0.0-...-c7fba9c Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutomaticSnapshot

func AutomaticSnapshot(st *state.State, snapName string) (ts *state.TaskSet, err error)

func AutomaticSnapshotExpiration

func AutomaticSnapshotExpiration(st *state.State) (time.Duration, error)

func Check

func Check(st *state.State, setID uint64, snapNames []string, users []string) (snapsFound []string, ts *state.TaskSet, err error)

Check creates a taskset for checking a snapshot's data. Note that the state must be locked by the caller.

func EstimateSnapshotSize

func EstimateSnapshotSize(st *state.State, instanceName string, users []string) (uint64, error)

func Export

func Export(ctx context.Context, st *state.State, setID uint64) (se *backend.SnapshotExport, err error)

Export exports a given snapshot ID Note that the state must be locked by the caller.

func Forget

func Forget(st *state.State, setID uint64, snapNames []string) (snapsFound []string, ts *state.TaskSet, err error)

Forget creates a taskset for deletinig a snapshot. Note that the state must be locked by the caller.

func Import

func Import(ctx context.Context, st *state.State, r io.Reader) (setID uint64, snapNames []string, err error)

Import a given snapshot ID from an exported snapshot

func List

func List(ctx context.Context, st *state.State, setID uint64, snapNames []string) ([]client.SnapshotSet, error)

List valid snapshots. Note that the state must be locked by the caller.

func MockBackendSave

func MockBackendSave(f func(context.Context, uint64, *snap.Info, map[string]interface{}, []string) (*client.Snapshot, error)) (restore func())

func Restore

func Restore(st *state.State, setID uint64, snapNames []string, users []string) (snapsFound []string, ts *state.TaskSet, err error)

Restore creates a taskset for restoring a snapshot's data. Note that the state must be locked by the caller.

func Save

func Save(st *state.State, instanceNames []string, users []string) (setID uint64, snapsSaved []string, ts *state.TaskSet, err error)

Save creates a taskset for taking snapshots of snaps' data. Note that the state must be locked by the caller.

func UnsetSnapshotOpInProgress

func UnsetSnapshotOpInProgress(st *state.State, setID uint64) string

UnsetSnapshotOpInProgress un-sets the given set ID as being a subject of a snapshot op. It returns the last operation (or empty string if no op was marked active). The state must be locked by the caller.

Types

type SnapshotExport

type SnapshotExport = backend.SnapshotExport

SnapshotExport provides a snapshot export that can be streamed out

type SnapshotManager

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

SnapshotManager takes snapshots of active snaps

func Manager

func Manager(st *state.State, runner *state.TaskRunner) *SnapshotManager

Manager returns a new SnapshotManager

func (*SnapshotManager) Ensure

func (mgr *SnapshotManager) Ensure() error

Ensure is part of the overlord.StateManager interface.

func (*SnapshotManager) StartUp

func (mgr *SnapshotManager) StartUp() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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