Documentation ¶
Index ¶
- func AutomaticSnapshot(st *state.State, snapName string) (ts *state.TaskSet, err error)
- func AutomaticSnapshotExpiration(st *state.State) (time.Duration, error)
- func Check(st *state.State, setID uint64, snapNames []string, users []string) (snapsFound []string, ts *state.TaskSet, err error)
- func EstimateSnapshotSize(st *state.State, instanceName string, users []string) (uint64, error)
- func Export(ctx context.Context, st *state.State, setID uint64) (se *backend.SnapshotExport, err error)
- func Forget(st *state.State, setID uint64, snapNames []string) (snapsFound []string, ts *state.TaskSet, err error)
- func Import(ctx context.Context, st *state.State, r io.Reader) (setID uint64, snapNames []string, err error)
- func List(ctx context.Context, st *state.State, setID uint64, snapNames []string) ([]client.SnapshotSet, error)
- func MockBackendSave(...) (restore func())
- func Restore(st *state.State, setID uint64, snapNames []string, users []string) (snapsFound []string, ts *state.TaskSet, err error)
- func Save(st *state.State, instanceNames []string, users []string) (setID uint64, snapsSaved []string, ts *state.TaskSet, err error)
- func UnsetSnapshotOpInProgress(st *state.State, setID uint64) string
- type SnapshotExport
- type SnapshotManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AutomaticSnapshot ¶
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 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 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 ¶
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