Documentation
¶
Index ¶
- Variables
- func NewBatchService(repo BatchRepo, instance InstanceService) batchService
- func NewInstanceService(repo InstanceRepo, source SourceService, opts ...InstanceServiceOption) instanceService
- func NewNetworkService(repo NetworkRepo) networkService
- func NewQueueService(batch BatchService, instance InstanceService, source SourceService) queueService
- func NewSourceService(repo SourceRepo) sourceService
- func NewTargetService(repo TargetRepo) targetService
- func NewValidationErrf(format string, a ...any) error
- type Batch
- type BatchRepo
- type BatchService
- type Batches
- type ErrValidation
- type Instance
- type InstanceCPUInfo
- type InstanceDeviceInfo
- type InstanceDiskInfo
- type InstanceMemoryInfo
- type InstanceNICInfo
- type InstanceRepo
- type InstanceService
- type InstanceServiceOption
- type InstanceSnapshotInfo
- type InstanceWithDetails
- type Instances
- type Network
- type NetworkRepo
- type NetworkService
- type Networks
- type Overrides
- type QueueEntries
- type QueueEntry
- type QueueService
- type Source
- type SourceRepo
- type SourceService
- type Sources
- type Target
- type TargetRepo
- type TargetService
- type Targets
- type WorkerCommand
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func NewBatchService ¶
func NewBatchService(repo BatchRepo, instance InstanceService) batchService
func NewInstanceService ¶
func NewInstanceService(repo InstanceRepo, source SourceService, opts ...InstanceServiceOption) instanceService
func NewNetworkService ¶
func NewNetworkService(repo NetworkRepo) networkService
func NewQueueService ¶
func NewQueueService(batch BatchService, instance InstanceService, source SourceService) queueService
func NewSourceService ¶
func NewSourceService(repo SourceRepo) sourceService
func NewTargetService ¶
func NewTargetService(repo TargetRepo) targetService
func NewValidationErrf ¶
Types ¶
type Batch ¶
type Batch struct {
ID int
Name string
TargetID int
TargetProject string
Status api.BatchStatusType
StatusString string
StoragePool string
IncludeExpression string
MigrationWindowStart time.Time
MigrationWindowEnd time.Time
}
func (Batch) CanBeModified ¶
func (Batch) CompileIncludeExpression ¶
func (b Batch) CompileIncludeExpression(i InstanceWithDetails) (*vm.Program, error)
func (Batch) InstanceMatchesCriteria ¶
func (b Batch) InstanceMatchesCriteria(instanceWithDetails InstanceWithDetails) (bool, error)
type BatchRepo ¶
type BatchRepo interface {
Create(ctx context.Context, batch Batch) (Batch, error)
GetAll(ctx context.Context) (Batches, error)
GetAllByState(ctx context.Context, status api.BatchStatusType) (Batches, error)
GetAllNames(ctx context.Context) ([]string, error)
GetByID(ctx context.Context, id int) (Batch, error)
GetByName(ctx context.Context, name string) (Batch, error)
UpdateByID(ctx context.Context, batch Batch) (Batch, error)
UpdateStatusByID(ctx context.Context, id int, status api.BatchStatusType, statusString string) (Batch, error)
DeleteByName(ctx context.Context, name string) error
}
type BatchService ¶
type BatchService interface {
Create(ctx context.Context, batch Batch) (Batch, error)
GetAll(ctx context.Context) (Batches, error)
GetAllByState(ctx context.Context, status api.BatchStatusType) (Batches, error)
GetAllNames(ctx context.Context) ([]string, error)
GetByID(ctx context.Context, id int) (Batch, error)
GetByName(ctx context.Context, name string) (Batch, error)
UpdateByID(ctx context.Context, batch Batch) (Batch, error)
UpdateInstancesAssignedToBatch(ctx context.Context, batch Batch) error
UpdateStatusByID(ctx context.Context, id int, status api.BatchStatusType, statusString string) (Batch, error)
DeleteByName(ctx context.Context, name string) error
StartBatchByName(ctx context.Context, name string) error
StopBatchByName(ctx context.Context, name string) error
}
type ErrValidation ¶
type ErrValidation string
func (ErrValidation) Error ¶
func (e ErrValidation) Error() string
type Instance ¶
type Instance struct {
UUID uuid.UUID
InventoryPath string
Annotation string
MigrationStatus api.MigrationStatusType
MigrationStatusString string
LastUpdateFromSource time.Time
SourceID int
BatchID *int
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
Overrides *Overrides
NeedsDiskImport bool
SecretToken uuid.UUID
}
func (Instance) CanBeModified ¶
func (Instance) GetName ¶
Returns the name of the instance, which may not be unique among all instances for a given source. If a unique, human-readable identifier is needed, use the InventoryPath property.
func (*Instance) GetOSType ¶
The mapping of OS version strings to OS types is determined from https://dp-downloads.broadcom.com/api-content/apis/API_VWSA_001/8.0U3/html/ReferenceGuides/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html
func (Instance) IsMigrating ¶
type InstanceCPUInfo ¶
type InstanceDeviceInfo ¶
type InstanceDiskInfo ¶
type InstanceMemoryInfo ¶
type InstanceNICInfo ¶
type InstanceRepo ¶
type InstanceRepo interface {
Create(ctx context.Context, instance Instance) (Instance, error)
GetAll(ctx context.Context) (Instances, error)
GetAllByState(ctx context.Context, status api.MigrationStatusType) (Instances, error)
GetAllByBatchID(ctx context.Context, batchID int) (Instances, error)
GetAllUUIDs(ctx context.Context) ([]uuid.UUID, error)
GetAllUnassigned(ctx context.Context) (Instances, error)
GetByID(ctx context.Context, id uuid.UUID) (Instance, error)
UpdateByID(ctx context.Context, instance Instance) (Instance, error)
UpdateStatusByUUID(ctx context.Context, id uuid.UUID, status api.MigrationStatusType, statusString string, needsDiskImport bool) (Instance, error)
DeleteByID(ctx context.Context, id uuid.UUID) error
// Overrides
CreateOverrides(ctx context.Context, overrides Overrides) (Overrides, error)
GetOverridesByID(ctx context.Context, id uuid.UUID) (Overrides, error)
DeleteOverridesByID(ctx context.Context, id uuid.UUID) error
UpdateOverridesByID(ctx context.Context, overrides Overrides) (Overrides, error)
}
type InstanceService ¶
type InstanceService interface {
Create(ctx context.Context, instance Instance) (Instance, error)
GetAll(ctx context.Context) (Instances, error)
GetAllByState(ctx context.Context, status api.MigrationStatusType) (Instances, error)
GetAllByBatchID(ctx context.Context, batchID int) (Instances, error)
GetAllUUIDs(ctx context.Context) ([]uuid.UUID, error)
GetAllUnassigned(ctx context.Context) (Instances, error)
GetByID(ctx context.Context, id uuid.UUID) (Instance, error)
GetByIDWithDetails(ctx context.Context, id uuid.UUID) (InstanceWithDetails, error)
UnassignFromBatch(ctx context.Context, id uuid.UUID) error
UpdateByID(ctx context.Context, instance Instance) (Instance, error)
UpdateStatusByUUID(ctx context.Context, id uuid.UUID, status api.MigrationStatusType, statusString string, needsDiskImport bool) (Instance, error)
ProcessWorkerUpdate(ctx context.Context, id uuid.UUID, workerResponseTypeArg api.WorkerResponseType, statusString string) (Instance, error)
DeleteByID(ctx context.Context, id uuid.UUID) error
// Overrride
CreateOverrides(ctx context.Context, overrides Overrides) (Overrides, error)
GetOverridesByID(ctx context.Context, id uuid.UUID) (Overrides, error)
DeleteOverridesByID(ctx context.Context, id uuid.UUID) error
UpdateOverridesByID(ctx context.Context, overrides Overrides) (Overrides, error)
}
type InstanceServiceOption ¶
type InstanceServiceOption func(s *instanceService)
type InstanceSnapshotInfo ¶
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 Overrides
}
type NetworkRepo ¶
type NetworkRepo interface {
Create(ctx context.Context, network Network) (Network, error)
GetAll(ctx context.Context) (Networks, error)
GetAllNames(ctx context.Context) ([]string, error)
GetByID(ctx context.Context, id int) (Network, error)
GetByName(ctx context.Context, name string) (Network, error)
UpdateByID(ctx context.Context, network Network) (Network, error)
DeleteByName(ctx context.Context, name string) error
}
type NetworkService ¶
type NetworkService interface {
Create(ctx context.Context, network Network) (Network, error)
GetAll(ctx context.Context) (Networks, error)
GetAllNames(ctx context.Context) ([]string, error)
GetByID(ctx context.Context, id int) (Network, error)
GetByName(ctx context.Context, name string) (Network, error)
UpdateByID(ctx context.Context, network Network) (Network, error)
DeleteByName(ctx context.Context, name string) error
}
type Overrides ¶
type QueueEntries ¶
type QueueEntries []QueueEntry
type QueueEntry ¶
type QueueService ¶
type Source ¶
type Source struct {
ID int
Name string
SourceType api.SourceType
Properties json.RawMessage
}
type SourceRepo ¶
type SourceRepo interface {
Create(ctx context.Context, source Source) (Source, error)
GetAll(ctx context.Context) (Sources, error)
GetAllNames(ctx context.Context) ([]string, error)
GetByID(ctx context.Context, id int) (Source, error)
GetByName(ctx context.Context, name string) (Source, error)
UpdateByID(ctx context.Context, source Source) (Source, error)
DeleteByName(ctx context.Context, name string) error
}
type SourceService ¶
type SourceService interface {
Create(ctx context.Context, source Source) (Source, error)
GetAll(ctx context.Context) (Sources, error)
GetAllNames(ctx context.Context) ([]string, error)
GetByID(ctx context.Context, id int) (Source, error)
GetByName(ctx context.Context, name string) (Source, error)
UpdateByID(ctx context.Context, source Source) (Source, error)
DeleteByName(ctx context.Context, name string) error
}
type Target ¶
type Target struct {
ID int
Name string
TargetType api.TargetType
Properties json.RawMessage
}
type TargetRepo ¶
type TargetRepo interface {
Create(ctx context.Context, target Target) (Target, error)
GetAll(ctx context.Context) (Targets, error)
GetAllNames(ctx context.Context) ([]string, error)
GetByID(ctx context.Context, id int) (Target, error)
GetByName(ctx context.Context, name string) (Target, error)
UpdateByID(ctx context.Context, target Target) (Target, error)
DeleteByName(ctx context.Context, name string) error
}
type TargetService ¶
type TargetService interface {
Create(ctx context.Context, target Target) (Target, error)
GetAll(ctx context.Context) (Targets, error)
GetAllNames(ctx context.Context) ([]string, error)
GetByID(ctx context.Context, id int) (Target, error)
GetByName(ctx context.Context, name string) (Target, error)
UpdateByID(ctx context.Context, target Target) (Target, error)
DeleteByName(ctx context.Context, name string) error
}
type WorkerCommand ¶
type WorkerCommand struct {
Command api.WorkerCommandType
InventoryPath string
SourceType api.SourceType
Source Source
OS string
OSVersion string
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.