Documentation
¶
Index ¶
- Constants
- type Bucket
- type Config
- func (c *Config) CustomVolume() (*Volume, error)
- func (c *Config) CustomVolumePool() (*api.StoragePool, error)
- func (c *Config) LastModified() time.Time
- func (c *Config) RootVolume() (*Volume, error)
- func (c *Config) RootVolumePool() (*api.StoragePool, error)
- func (c *Config) UpdateRootVolumePool(pool *api.StoragePool) error
- type Type
- type Volume
Constants ¶
const DefaultMetadataVersion = api.BackupMetadataVersion2
DefaultMetadataVersion represents the current default version of the format used when writing a backup's metadata. The metadata is used both for exporting backups and for migration. Starting from LXD 6.x onwards version 2 of the format is used.
const MaxMetadataVersion = api.BackupMetadataVersion2
MaxMetadataVersion represents the latest supported metadata version.
const TypeContainer = Type("container")
TypeContainer defines the backup type value for a container.
const TypeCustom = Type("custom")
TypeCustom defines the backup type value for a custom volume.
const TypeUnknown = Type("")
TypeUnknown defines the backup type value for unknown backups.
const TypeVM = Type("virtual-machine")
TypeVM defines the backup type value for a virtual-machine.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket struct {
// Make sure to have the embedded structs fields inline to avoid nesting.
*api.StorageBucket `yaml:",inline"` //nolint:musttag
}
Bucket represents the config of a bucket including its snapshots.
type Config ¶
type Config struct {
// The JSON representation of the fields does not use lowercase (and omitempty) to stay backwards compatible
// across all versions of LXD as the Config struct is also used throughout the migration.
Version uint32 `json:"Version" yaml:"version,omitempty"`
Instance *api.Instance `json:"Instance" yaml:"instance,omitempty"`
Snapshots []*api.InstanceSnapshot `json:"Snapshots" yaml:"snapshots,omitempty"`
Pools []*api.StoragePool `json:"Pools" yaml:"pools,omitempty"`
Profiles []*api.Profile `json:"Profiles" yaml:"profiles,omitempty"`
Volumes []*Volume `json:"Volumes" yaml:"volumes,omitempty"`
Bucket *Bucket `json:"Bucket" yaml:"bucket,omitempty"`
// Deprecated: Use Instance instead.
Container *api.Instance `json:"Container" yaml:"container,omitempty"`
// Deprecated: Use Pools instead.
Pool *api.StoragePool `json:"Pool" yaml:"pool,omitempty"`
// Deprecated: Use Volumes instead.
Volume *api.StorageVolume `json:"Volume" yaml:"volume,omitempty"`
// Deprecated: Use the list of Snapshots under Volumes.
VolumeSnapshots []*api.StorageVolumeSnapshot `json:"VolumeSnapshots" yaml:"volume_snapshots,omitempty"`
// contains filtered or unexported fields
}
Config represents the config of a backup that can be stored in a backup.yaml file (or embedded in index.yaml).
func NewConfig ¶
NewConfig returns a new Config instance initialized with an immutable last modified time.
func (*Config) CustomVolume ¶
CustomVolume returns the single custom volume. Unlike RootVolume, CustomVolume always returns the first and only volume in the list.
func (*Config) CustomVolumePool ¶
func (c *Config) CustomVolumePool() (*api.StoragePool, error)
CustomVolumePool returns the pool of the custom volume.
func (*Config) LastModified ¶
LastModified returns the backup config's immutable last modification time.
func (*Config) RootVolume ¶
RootVolume returns an instance's root volume from the list of volumes. The volume's name matches the one of the instance.
func (*Config) RootVolumePool ¶
func (c *Config) RootVolumePool() (*api.StoragePool, error)
RootVolumePool returns the pool of the root volume. The pool is derived from the volume whose name matches the one of the instance.
func (*Config) UpdateRootVolumePool ¶
func (c *Config) UpdateRootVolumePool(pool *api.StoragePool) error
UpdateRootVolumePool updates the root volume's storage pool.
type Volume ¶
type Volume struct {
// Make sure to have the embedded structs fields inline to avoid nesting.
api.StorageVolume `yaml:",inline"` //nolint:musttag
// Use the uppercase representation of the field to follow the same format as the root Config struct.
Snapshots []*api.StorageVolumeSnapshot `json:"Snapshots" yaml:"snapshots,omitempty"`
}
Volume represents the config of a volume including its snapshots.