batch

package
v0.0.0-pre.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

type Batch interface {
	// Returns the name of this batch.
	GetName() string

	// Returns a unique ID for this batch that can be used when interacting with the database.
	//
	// Attempting to get an ID for a freshly-created batch that hasn't yet been added to the database
	// via AddBatch() or retrieved via GetBatch()/GetAllBatches() will return an error.
	GetDatabaseID() (int, error)

	// Returns the target ID for this batch, if any.
	GetTargetID() int

	// Returns the target project for this batch; if not specified returns "default".
	GetTargetProject() string

	// Returns true if the batch can be modified.
	CanBeModified() bool

	// Returns true if the instance matches inclusion/exclusion criteria for this batch.
	InstanceMatchesCriteria(i InstanceWithDetails) (bool, error)

	// Returns the status of this batch.
	GetStatus() api.BatchStatusType

	// Returns the storage pool for this batch
	GetStoragePool() string

	// Returns the migration window start time
	GetMigrationWindowStart() time.Time

	// Returns the migration window end time
	GetMigrationWindowEnd() time.Time
}

Interface definition for all migration manager batches.

type InstanceWithDetails

type InstanceWithDetails struct {
	Name              string
	InventoryPath     string
	Annotation        string
	GuestToolsVersion int
	Architecture      string
	HardwareVersion   string
	OS                string
	OSVersion         string
	Devices           []api.InstanceDeviceInfo
	Disks             []api.InstanceDiskInfo
	NICs              []api.InstanceNICInfo
	Snapshots         []api.InstanceSnapshotInfo
	CPU               api.InstanceCPUInfo
	Memory            api.InstanceMemoryInfo
	UseLegacyBios     bool
	SecureBootEnabled bool
	TPMPresent        bool

	Source    Source
	Overrides api.InstanceOverride
}

type InternalBatch

type InternalBatch struct {
	api.Batch `yaml:",inline"`

	TargetID int
}

func NewBatch

func NewBatch(name string, targetID int, targetProject string, storagePool string, includeExpression string, migrationWindowStart time.Time, migrationWindowEnd time.Time) *InternalBatch

Returns a new Batch ready for use.

func (*InternalBatch) CanBeModified

func (b *InternalBatch) CanBeModified() bool

func (*InternalBatch) CompileIncludeExpression

func (b *InternalBatch) CompileIncludeExpression(i InstanceWithDetails) (*vm.Program, error)

func (*InternalBatch) GetDatabaseID

func (b *InternalBatch) GetDatabaseID() (int, error)

func (*InternalBatch) GetMigrationWindowEnd

func (b *InternalBatch) GetMigrationWindowEnd() time.Time

func (*InternalBatch) GetMigrationWindowStart

func (b *InternalBatch) GetMigrationWindowStart() time.Time

func (*InternalBatch) GetName

func (b *InternalBatch) GetName() string

func (*InternalBatch) GetStatus

func (b *InternalBatch) GetStatus() api.BatchStatusType

func (*InternalBatch) GetStoragePool

func (b *InternalBatch) GetStoragePool() string

func (*InternalBatch) GetTargetID

func (b *InternalBatch) GetTargetID() int

func (*InternalBatch) GetTargetProject

func (b *InternalBatch) GetTargetProject() string

func (*InternalBatch) InstanceMatchesCriteria

func (b *InternalBatch) InstanceMatchesCriteria(i InstanceWithDetails) (bool, error)

type Overrides

type Overrides struct {
	Comment          string
	NumberCPUs       int
	MemoryInBytes    int64
	DisableMigration bool
}

type Source

type Source struct {
	Name       string
	SourceType string
}

Jump to

Keyboard shortcuts

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