lxd: github.com/lxc/lxd/lxd/backup Index | Files

package backup

import "github.com/lxc/lxd/lxd/backup"


Package Files

backup.go backup_instance_config.go

func DoBackupDelete Uses

func DoBackupDelete(s *state.State, projectName, backupName, containerName string) error

DoBackupDelete deletes a backup.

func UpdateInstanceConfigStoragePool Uses

func UpdateInstanceConfigStoragePool(c *db.Cluster, b Info, mountPath string) error

UpdateInstanceConfigStoragePool changes the pool information in the backup.yaml to the pool specified in b.Pool.

type Backup Uses

type Backup struct {
    // contains filtered or unexported fields

Backup represents a container backup

func New Uses

func New(state *state.State, inst Instance, ID int, name string, creationDate, expiryDate time.Time, instanceOnly, optimizedStorage bool) *Backup

New instantiates a new Backup struct.

func (*Backup) CompressionAlgorithm Uses

func (b *Backup) CompressionAlgorithm() string

CompressionAlgorithm returns the compression used for the tarball.

func (*Backup) Delete Uses

func (b *Backup) Delete() error

Delete removes an instance backup

func (*Backup) InstanceOnly Uses

func (b *Backup) InstanceOnly() bool

InstanceOnly returns whether only the instance itself is to be backed up.

func (*Backup) Name Uses

func (b *Backup) Name() string

Name returns the name of the backup.

func (*Backup) OptimizedStorage Uses

func (b *Backup) OptimizedStorage() bool

OptimizedStorage returns whether the backup is to be performed using optimization supported by the storage driver.

func (*Backup) Rename Uses

func (b *Backup) Rename(newName string) error

Rename renames a container backup

func (*Backup) Render Uses

func (b *Backup) Render() *api.InstanceBackup

Render returns an InstanceBackup struct of the backup.

func (*Backup) SetCompressionAlgorithm Uses

func (b *Backup) SetCompressionAlgorithm(compression string)

SetCompressionAlgorithm sets the tarball compression.

type Info Uses

type Info struct {
    Project          string           `json:"-" yaml:"-"` // Project is set during import based on current project.
    Name             string           `json:"name" yaml:"name"`
    Backend          string           `json:"backend" yaml:"backend"`
    Pool             string           `json:"pool" yaml:"pool"`
    Snapshots        []string         `json:"snapshots,omitempty" yaml:"snapshots,omitempty"`
    OptimizedStorage *bool            `json:"optimized,omitempty" yaml:"optimized,omitempty"`               // Optional field to handle older optimized backups that don't have this field.
    OptimizedHeader  *bool            `json:"optimized_header,omitempty" yaml:"optimized_header,omitempty"` // Optional field to handle older optimized backups that don't have this field.
    Type             api.InstanceType `json:"type" yaml:"type"`

Info represents exported backup information.

func GetInfo Uses

func GetInfo(r io.ReadSeeker) (*Info, error)

GetInfo extracts backup information from a given ReadSeeker.

type Instance Uses

type Instance interface {
    Name() string
    Project() string

Instance represents the backup relevant subset of a LXD instance. This is used rather than instance.Instance to avoid import loops.

type InstanceConfig Uses

type InstanceConfig struct {
    Container *api.Instance           `yaml:"container"`
    Snapshots []*api.InstanceSnapshot `yaml:"snapshots"`
    Pool      *api.StoragePool        `yaml:"pool"`
    Volume    *api.StorageVolume      `yaml:"volume"`

InstanceConfig represents the config of an instance that can be stored in a backup.yaml file.

func ParseInstanceConfigYamlFile Uses

func ParseInstanceConfigYamlFile(path string) (*InstanceConfig, error)

ParseInstanceConfigYamlFile decodes the YAML file at path specified into an InstanceConfig.

Package backup imports 15 packages (graph) and is imported by 13 packages. Updated 2020-05-29. Refresh now. Tools for package owners.