Documentation ¶
Index ¶
- func DoBackupDelete(s *state.State, projectName, backupName, containerName string) error
- func UpdateInstanceConfigStoragePool(c *db.Cluster, b Info, mountPath string) error
- type Backup
- func (b *Backup) CompressionAlgorithm() string
- func (b *Backup) Delete() error
- func (b *Backup) InstanceOnly() bool
- func (b *Backup) Name() string
- func (b *Backup) OptimizedStorage() bool
- func (b *Backup) Rename(newName string) error
- func (b *Backup) Render() *api.InstanceBackup
- func (b *Backup) SetCompressionAlgorithm(compression string)
- type Info
- type Instance
- type InstanceConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoBackupDelete ¶
DoBackupDelete deletes a backup.
Types ¶
type Backup ¶
type Backup struct {
// contains filtered or unexported fields
}
Backup represents a container backup
func New ¶
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 ¶
CompressionAlgorithm returns the compression used for the tarball.
func (*Backup) InstanceOnly ¶
InstanceOnly returns whether only the instance itself is to be backed up.
func (*Backup) OptimizedStorage ¶
OptimizedStorage returns whether the backup is to be performed using optimization supported by the storage driver.
func (*Backup) Render ¶
func (b *Backup) Render() *api.InstanceBackup
Render returns an InstanceBackup struct of the backup.
func (*Backup) SetCompressionAlgorithm ¶
SetCompressionAlgorithm sets the tarball compression.
type Info ¶
type Info struct { Project string `json:"project" yaml:"project"` Name string `json:"name" yaml:"name"` Backend string `json:"backend" yaml:"backend"` Privileged bool `json:"privileged" yaml:"privileged"` Pool string `json:"pool" yaml:"pool"` Snapshots []string `json:"snapshots,omitempty" yaml:"snapshots,omitempty"` OptimizedStorage bool `json:"-" yaml:"-"` }
Info represents exported backup information.
type Instance ¶
Instance represents the backup relevant subset of a LXD instance. This is used rather than instance.Instance to avoid import loops.
type InstanceConfig ¶
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 ¶
func ParseInstanceConfigYamlFile(path string) (*InstanceConfig, error)
ParseInstanceConfigYamlFile decodes the YAML file at path specified into an InstanceConfig.