Documentation
¶
Index ¶
- Constants
- func BuildServiceAvoidLists(services []BatchedService) [][]string
- func CalculateEffectiveCPU(physicalCores, threads int) float64
- func CheckAgentVersionWarning(imageInfra *model.ImageInfra) *string
- type AccountsService
- func (s *AccountsService) CreateGroup(ctx context.Context, group model.Group) (model.Group, error)
- func (s *AccountsService) CreateMember(ctx context.Context, member model.Member) (model.Member, error)
- func (s *AccountsService) DeleteGroup(ctx context.Context, id uuid.UUID) error
- func (s *AccountsService) GetGroup(ctx context.Context, id uuid.UUID) (model.Group, error)
- func (s *AccountsService) GetIdentity(ctx context.Context, authUser auth.User) (Identity, error)
- func (s *AccountsService) GetMember(ctx context.Context, username string) (model.Member, error)
- func (s *AccountsService) ListGroupMembers(ctx context.Context, groupID uuid.UUID) (model.MemberList, error)
- func (s *AccountsService) ListGroups(ctx context.Context, filter *store.GroupQueryFilter) (model.GroupList, error)
- func (s *AccountsService) RemoveGroupMember(ctx context.Context, groupID uuid.UUID, username string) error
- func (s *AccountsService) UpdateGroup(ctx context.Context, group model.Group) (model.Group, error)
- func (s *AccountsService) UpdateGroupMember(ctx context.Context, groupID uuid.UUID, username string, member model.Member) (model.Member, error)
- type AgentService
- type AssessmentFilter
- func (f *AssessmentFilter) WithLimit(limit int) *AssessmentFilter
- func (f *AssessmentFilter) WithNameLike(pattern string) *AssessmentFilter
- func (f *AssessmentFilter) WithOffset(offset int) *AssessmentFilter
- func (f *AssessmentFilter) WithSource(source string) *AssessmentFilter
- func (f *AssessmentFilter) WithSourceID(sourceID string) *AssessmentFilter
- type AssessmentService
- func (as *AssessmentService) CreateAssessment(ctx context.Context, createForm mappers.AssessmentCreateForm) (*model.Assessment, error)
- func (as *AssessmentService) DeleteAssessment(ctx context.Context, id uuid.UUID) error
- func (as *AssessmentService) GetAssessment(ctx context.Context, id uuid.UUID) (*model.Assessment, error)
- func (as *AssessmentService) ListAssessments(ctx context.Context, filter *AssessmentFilter) ([]model.Assessment, error)
- func (as *AssessmentService) UpdateAssessment(ctx context.Context, id uuid.UUID, name *string) (*model.Assessment, error)
- type AssessmentServicer
- type AuthzAssessmentService
- func (a *AuthzAssessmentService) CreateAssessment(ctx context.Context, createForm mappers.AssessmentCreateForm) (*model.Assessment, error)
- func (a *AuthzAssessmentService) DeleteAssessment(ctx context.Context, id uuid.UUID) error
- func (a *AuthzAssessmentService) GetAssessment(ctx context.Context, id uuid.UUID) (*model.Assessment, error)
- func (a *AuthzAssessmentService) ListAssessments(ctx context.Context, filter *AssessmentFilter) ([]model.Assessment, error)
- func (a *AuthzAssessmentService) UpdateAssessment(ctx context.Context, id uuid.UUID, name *string) (*model.Assessment, error)
- type BatchedService
- type ErrAgentUpdateForbidden
- type ErrAssessmentCreationForbidden
- type ErrDuplicateKey
- type ErrFileCorrupted
- type ErrForbidden
- type ErrInvalidClusterInventory
- type ErrInvalidEstimationParam
- type ErrInvalidRequest
- type ErrInvalidSchema
- type ErrInvalidVCenterID
- type ErrInventoryHasNoVMs
- type ErrJobForbidden
- type ErrJobNotFound
- type ErrMembershipMismatch
- type ErrResourceNotFound
- func NewErrAgentNotFound(id uuid.UUID) *ErrResourceNotFound
- func NewErrAssessmentNotFound(id uuid.UUID) *ErrResourceNotFound
- func NewErrClusterNotFound(clusterID string, assessmentID uuid.UUID) *ErrResourceNotFound
- func NewErrMemberNotFound(username string) *ErrResourceNotFound
- func NewErrResourceNotFound(id uuid.UUID, resourceType string) *ErrResourceNotFound
- func NewErrSourceNotFound(id uuid.UUID) *ErrResourceNotFound
- type ErrSourceHasNoInventory
- type EstimationContext
- type EstimationService
- func (es *EstimationService) BuildBaseParams(userParams []estimation.Param) []estimation.Param
- func (es *EstimationService) BuildBucketParams(baseParams []estimation.Param, vmCount int, diskGB float64) []estimation.Param
- func (es *EstimationService) CalculateMigrationComplexity(ctx context.Context, assessmentID uuid.UUID, clusterID string) (*MigrationComplexityResult, error)
- func (es *EstimationService) CalculateMigrationEstimation(ctx context.Context, assessmentID uuid.UUID, clusterID string, ...) (map[engines.Schema]*MigrationAssessmentResult, error)
- func (es *EstimationService) CalculateOsDiskComplexity(ctx context.Context, assessmentID uuid.UUID, clusterID string) (*OsDiskComplexityResult, error)
- func (es *EstimationService) RunEstimation(schemas []engines.Schema, params []estimation.Param) (map[engines.Schema]*MigrationAssessmentResult, error)
- func (es *EstimationService) ValidateParams(userParams []estimation.Param) error
- type Identity
- type JobService
- func (s *JobService) CancelJob(ctx context.Context, jobID int64, orgID, username string) (*v1alpha1.Job, error)
- func (s *JobService) CreateRVToolsJob(ctx context.Context, args jobs.RVToolsJobArgs) (*v1alpha1.Job, error)
- func (s *JobService) GetJob(ctx context.Context, jobID int64, orgID, username string) (*v1alpha1.Job, error)
- type MigrationAssessmentResult
- type MigrationComplexityResult
- type OsDiskComplexityResult
- type ParamDefinition
- type SizerService
- type SourceFilter
- type SourceFilterFunc
- type SourceService
- func (s *SourceService) CreateSource(ctx context.Context, sourceForm mappers.SourceCreateForm) (model.Source, error)
- func (s *SourceService) DeleteSource(ctx context.Context, id uuid.UUID) error
- func (s *SourceService) DeleteSources(ctx context.Context) error
- func (s *SourceService) GetSource(ctx context.Context, id uuid.UUID) (*model.Source, error)
- func (s *SourceService) GetSourceDownloadURL(ctx context.Context, id uuid.UUID) (string, time.Time, error)
- func (s *SourceService) ListSources(ctx context.Context, filter *SourceFilter) ([]model.Source, error)
- func (s *SourceService) UpdateInventory(ctx context.Context, form mappers.InventoryUpdateForm) (model.Source, error)
- func (s *SourceService) UpdateSource(ctx context.Context, id uuid.UUID, form mappers.SourceUpdateForm) (*model.Source, error)
- type TransformedSizerResponse
Constants ¶
const ( SourceTypeAgent string = "agent" SourceTypeInventory string = "inventory" SourceTypeRvtools string = "rvtools" )
const ( // TargetCapacityPercent leaves 20% headroom for over-commitment TargetCapacityPercent = 80.0 // CapacityMultiplier is the decimal representation of TargetCapacityPercent CapacityMultiplier = TargetCapacityPercent / 100.0 DefaultPlatform = "BAREMETAL" // MaxBatches - if exceeded, recommend larger nodes MaxBatches = 200 // MinBatchCPU prevents tiny batches MinBatchCPU = 1.0 // MinBatchMemory prevents tiny batches MinBatchMemory = 2.0 // MaxNodeCount - if exceeded, recommend larger nodes MaxNodeCount = 100 // MaxVMsPerWorkerNode - maximum VMs allowed per worker node MaxVMsPerWorkerNode = 200 // MachineSetNumberOfDisks is the number of disks for both worker and control plane machine sets MachineSetNumberOfDisks = 24 // ControlPlaneReservedCPU is the CPU reserved for control plane services ControlPlaneReservedCPU = 3.5 // ControlPlaneReservedMemory is the memory (GB) reserved for control plane services ControlPlaneReservedMemory = 13.39 // MinFallbackNodeCPU is the minimum fallback CPU when inputs are invalid MinFallbackNodeCPU = 2 // MinFallbackNodeMemory is the minimum fallback memory (GB) when inputs are invalid MinFallbackNodeMemory = 4 // MaxRecommendedNodeCPU is the maximum recommended CPU for nodes MaxRecommendedNodeCPU = 200 // MaxRecommendedNodeMemory is the maximum recommended memory (GB) for nodes MaxRecommendedNodeMemory = 512 // MinFailoverNodes is the minimum number of failover nodes MinFailoverNodes = 2 // FailoverCapacityPercent is the percentage of worker nodes for failover FailoverCapacityPercent = 10.0 )
Variables ¶
This section is empty.
Functions ¶
func BuildServiceAvoidLists ¶ added in v0.9.0
func BuildServiceAvoidLists(services []BatchedService) [][]string
BuildServiceAvoidLists enforces MaxVMsPerWorkerNode via avoid lists.
Assumption: when limiting how many batches may share a node, we use maxVMsPerBatch = max(VMCount per batch)—i.e. we assume each batch on that node could be as large as the worst batch. Then maxServicesPerNode = MaxVMsPerWorkerNode/maxVMsPerBatch is a safe cap on batch count per node. That stays correct when VMCount differs across batches.
func CalculateEffectiveCPU ¶ added in v0.5.0
CalculateEffectiveCPU calculates SMT-adjusted effective CPU cores Formula: effectiveCPU = physicalCores + ((threads - physicalCores) * 0.5) If threads == 0 or threads == cores, returns cores (no SMT)
func CheckAgentVersionWarning ¶ added in v0.8.0
func CheckAgentVersionWarning(imageInfra *model.ImageInfra) *string
CheckAgentVersionWarning compares stored agent version with current and returns warning if they differ.
Types ¶
type AccountsService ¶ added in v0.11.0
type AccountsService struct {
// contains filtered or unexported fields
}
func NewAccountsService ¶ added in v0.11.0
func NewAccountsService(store store.Store) *AccountsService
func (*AccountsService) CreateGroup ¶ added in v0.11.0
func (*AccountsService) CreateMember ¶ added in v0.11.0
func (s *AccountsService) CreateMember(ctx context.Context, member model.Member) (model.Member, error)
CreateMember creates a new member. Verifies the group exists.
func (*AccountsService) DeleteGroup ¶ added in v0.11.0
func (*AccountsService) GetIdentity ¶ added in v0.11.0
FIX: This needs to be updated once partner/customers logic has been implemented
func (*AccountsService) ListGroupMembers ¶ added in v0.11.0
func (s *AccountsService) ListGroupMembers(ctx context.Context, groupID uuid.UUID) (model.MemberList, error)
ListGroupMembers lists all members belonging to the specified group.
func (*AccountsService) ListGroups ¶ added in v0.11.0
func (s *AccountsService) ListGroups(ctx context.Context, filter *store.GroupQueryFilter) (model.GroupList, error)
func (*AccountsService) RemoveGroupMember ¶ added in v0.11.0
func (s *AccountsService) RemoveGroupMember(ctx context.Context, groupID uuid.UUID, username string) error
RemoveGroupMember removes a member from the specified group. Since a backend member must always belong to a group, this deletes the member.
func (*AccountsService) UpdateGroup ¶ added in v0.11.0
func (*AccountsService) UpdateGroupMember ¶ added in v0.11.0
func (s *AccountsService) UpdateGroupMember(ctx context.Context, groupID uuid.UUID, username string, member model.Member) (model.Member, error)
UpdateGroupMember updates a member within the specified group. The username is immutable; only other fields (e.g. email) are updated.
type AgentService ¶
type AgentService struct {
// contains filtered or unexported fields
}
func NewAgentService ¶
func NewAgentService(store store.Store) *AgentService
func (*AgentService) UpdateAgentStatus ¶
func (as *AgentService) UpdateAgentStatus(ctx context.Context, updateForm mappers.AgentUpdateForm) (*model.Agent, bool, error)
UpdateAgentStatus updates or creates a new agent resource If the source has not agent than the agent is created.
func (*AgentService) UpdateSourceInventory ¶
func (as *AgentService) UpdateSourceInventory(ctx context.Context, updateForm mappers.InventoryUpdateForm) (*model.Source, error)
UpdateSourceInventory updates source inventory
This implements the SingleModel logic: - Only updates for a single vCenterID are allowed - allow two agents trying to update the source with same vCenterID - don't allow updates from agents not belonging to the source - don't allow updates if source is missing. (i.g the source is created as per MultiSource logic). It fails anyway because an agent always has a source. - if the source has no inventory yet, set the vCenterID and AssociatedAgentID to this source.
type AssessmentFilter ¶
type AssessmentFilter struct {
OrgID string
Username string
Source string
SourceID string
NameLike string
IDs []uuid.UUID
Limit int
Offset int
}
AssessmentFilter represents filtering options for listing assessments
func NewAssessmentFilter ¶
func NewAssessmentFilter(username, orgID string) *AssessmentFilter
func (*AssessmentFilter) WithLimit ¶
func (f *AssessmentFilter) WithLimit(limit int) *AssessmentFilter
func (*AssessmentFilter) WithNameLike ¶
func (f *AssessmentFilter) WithNameLike(pattern string) *AssessmentFilter
func (*AssessmentFilter) WithOffset ¶
func (f *AssessmentFilter) WithOffset(offset int) *AssessmentFilter
func (*AssessmentFilter) WithSource ¶
func (f *AssessmentFilter) WithSource(source string) *AssessmentFilter
func (*AssessmentFilter) WithSourceID ¶
func (f *AssessmentFilter) WithSourceID(sourceID string) *AssessmentFilter
type AssessmentService ¶
type AssessmentService struct {
// contains filtered or unexported fields
}
func NewAssessmentService ¶
func NewAssessmentService(store store.Store, opaValidator *opa.Validator) *AssessmentService
func (*AssessmentService) CreateAssessment ¶
func (as *AssessmentService) CreateAssessment(ctx context.Context, createForm mappers.AssessmentCreateForm) (*model.Assessment, error)
func (*AssessmentService) DeleteAssessment ¶
func (*AssessmentService) GetAssessment ¶
func (as *AssessmentService) GetAssessment(ctx context.Context, id uuid.UUID) (*model.Assessment, error)
func (*AssessmentService) ListAssessments ¶
func (as *AssessmentService) ListAssessments(ctx context.Context, filter *AssessmentFilter) ([]model.Assessment, error)
func (*AssessmentService) UpdateAssessment ¶
func (as *AssessmentService) UpdateAssessment(ctx context.Context, id uuid.UUID, name *string) (*model.Assessment, error)
type AssessmentServicer ¶ added in v0.10.0
type AssessmentServicer interface {
ListAssessments(ctx context.Context, filter *AssessmentFilter) ([]model.Assessment, error)
GetAssessment(ctx context.Context, id uuid.UUID) (*model.Assessment, error)
CreateAssessment(ctx context.Context, createForm mappers.AssessmentCreateForm) (*model.Assessment, error)
UpdateAssessment(ctx context.Context, id uuid.UUID, name *string) (*model.Assessment, error)
DeleteAssessment(ctx context.Context, id uuid.UUID) error
}
func NewAuthzAssessmentService ¶ added in v0.10.0
func NewAuthzAssessmentService(inner AssessmentServicer, s store.Store) AssessmentServicer
type AuthzAssessmentService ¶ added in v0.10.0
type AuthzAssessmentService struct {
// contains filtered or unexported fields
}
func (*AuthzAssessmentService) CreateAssessment ¶ added in v0.10.0
func (a *AuthzAssessmentService) CreateAssessment(ctx context.Context, createForm mappers.AssessmentCreateForm) (*model.Assessment, error)
func (*AuthzAssessmentService) DeleteAssessment ¶ added in v0.10.0
func (*AuthzAssessmentService) GetAssessment ¶ added in v0.10.0
func (a *AuthzAssessmentService) GetAssessment(ctx context.Context, id uuid.UUID) (*model.Assessment, error)
func (*AuthzAssessmentService) ListAssessments ¶ added in v0.10.0
func (a *AuthzAssessmentService) ListAssessments(ctx context.Context, filter *AssessmentFilter) ([]model.Assessment, error)
func (*AuthzAssessmentService) UpdateAssessment ¶ added in v0.10.0
func (a *AuthzAssessmentService) UpdateAssessment(ctx context.Context, id uuid.UUID, name *string) (*model.Assessment, error)
type BatchedService ¶ added in v0.4.0
type BatchedService struct {
Name string
RequiredCPU float64
RequiredMemory float64
LimitCPU float64
LimitMemory float64
VMCount int // Number of VMs in this batch
}
BatchedService represents an aggregated service workload for the sizer API. It contains the resource requirements for a single batch of VMs that will be scheduled as a service on the cluster.
Fields:
- Name: Unique identifier for the batch (e.g., "vms-batch-1-services")
- RequiredCPU: CPU cores requested for this batch (after applying over-commit ratio)
- RequiredMemory: Memory (GB) requested for this batch (after applying over-commit ratio)
- LimitCPU: Maximum CPU cores allowed for this batch (before over-commit)
- LimitMemory: Maximum memory (GB) allowed for this batch (before over-commit)
The Required values represent Kubernetes resource requests, while Limit values represent Kubernetes resource limits. The over-commit ratio determines the relationship between them.
type ErrAgentUpdateForbidden ¶
type ErrAgentUpdateForbidden struct {
// contains filtered or unexported fields
}
func NewErrAgentUpdateForbidden ¶
func NewErrAgentUpdateForbidden(sourceID, agentID uuid.UUID) *ErrAgentUpdateForbidden
type ErrAssessmentCreationForbidden ¶
type ErrAssessmentCreationForbidden struct {
// contains filtered or unexported fields
}
func NewErrAssessmentCreationForbidden ¶
func NewErrAssessmentCreationForbidden(sourceID uuid.UUID) *ErrAssessmentCreationForbidden
type ErrDuplicateKey ¶ added in v0.3.0
type ErrDuplicateKey struct {
// contains filtered or unexported fields
}
func NewErrAssessmentDuplicateName ¶ added in v0.3.0
func NewErrAssessmentDuplicateName(name string) *ErrDuplicateKey
func NewErrDuplicateKey ¶ added in v0.3.0
func NewErrDuplicateKey(resourceType, name string) *ErrDuplicateKey
func NewErrSourceDuplicateName ¶ added in v0.6.0
func NewErrSourceDuplicateName(name string) *ErrDuplicateKey
type ErrFileCorrupted ¶ added in v0.3.0
type ErrFileCorrupted struct {
// contains filtered or unexported fields
}
func NewErrFileCorrupted ¶ added in v0.3.0
func NewErrFileCorrupted(message string) *ErrFileCorrupted
func NewErrRVToolsFileCorrupted ¶ added in v0.3.0
func NewErrRVToolsFileCorrupted(message string) *ErrFileCorrupted
type ErrForbidden ¶ added in v0.10.0
type ErrForbidden struct {
// contains filtered or unexported fields
}
func NewErrForbidden ¶ added in v0.10.0
func NewErrForbidden(resource string, id string) *ErrForbidden
type ErrInvalidClusterInventory ¶ added in v0.4.0
type ErrInvalidClusterInventory struct {
// contains filtered or unexported fields
}
func NewErrInvalidClusterInventory ¶ added in v0.4.0
func NewErrInvalidClusterInventory(clusterID string, reason string) *ErrInvalidClusterInventory
type ErrInvalidEstimationParam ¶ added in v0.11.0
type ErrInvalidEstimationParam struct{ Msg string }
func (*ErrInvalidEstimationParam) Error ¶ added in v0.11.0
func (e *ErrInvalidEstimationParam) Error() string
type ErrInvalidRequest ¶ added in v0.4.0
type ErrInvalidRequest struct {
// contains filtered or unexported fields
}
func NewErrInvalidRequest ¶ added in v0.4.0
func NewErrInvalidRequest(message string) *ErrInvalidRequest
type ErrInvalidSchema ¶ added in v0.9.0
type ErrInvalidSchema struct{ Msg string }
func (*ErrInvalidSchema) Error ¶ added in v0.9.0
func (e *ErrInvalidSchema) Error() string
type ErrInvalidVCenterID ¶
type ErrInvalidVCenterID struct {
// contains filtered or unexported fields
}
func NewErrInvalidVCenterID ¶
func NewErrInvalidVCenterID(sourceID uuid.UUID, vCenterID string) *ErrInvalidVCenterID
type ErrInventoryHasNoVMs ¶ added in v0.4.0
type ErrInventoryHasNoVMs struct {
// contains filtered or unexported fields
}
func NewErrInventoryHasNoVMs ¶ added in v0.4.0
func NewErrInventoryHasNoVMs() *ErrInventoryHasNoVMs
type ErrJobForbidden ¶ added in v0.3.0
type ErrJobForbidden struct {
JobID int64
}
func NewErrJobForbidden ¶ added in v0.3.0
func NewErrJobForbidden(jobID int64) *ErrJobForbidden
func (*ErrJobForbidden) Error ¶ added in v0.3.0
func (e *ErrJobForbidden) Error() string
type ErrJobNotFound ¶ added in v0.3.0
type ErrJobNotFound struct {
JobID int64
}
func NewErrJobNotFound ¶ added in v0.3.0
func NewErrJobNotFound(jobID int64) *ErrJobNotFound
func (*ErrJobNotFound) Error ¶ added in v0.3.0
func (e *ErrJobNotFound) Error() string
type ErrMembershipMismatch ¶ added in v0.11.0
type ErrMembershipMismatch struct {
// contains filtered or unexported fields
}
func NewErrMembershipMismatch ¶ added in v0.11.0
func NewErrMembershipMismatch(username string, groupID uuid.UUID) *ErrMembershipMismatch
type ErrResourceNotFound ¶
type ErrResourceNotFound struct {
// contains filtered or unexported fields
}
func NewErrAgentNotFound ¶
func NewErrAgentNotFound(id uuid.UUID) *ErrResourceNotFound
func NewErrAssessmentNotFound ¶
func NewErrAssessmentNotFound(id uuid.UUID) *ErrResourceNotFound
func NewErrClusterNotFound ¶ added in v0.5.1
func NewErrClusterNotFound(clusterID string, assessmentID uuid.UUID) *ErrResourceNotFound
func NewErrMemberNotFound ¶ added in v0.11.0
func NewErrMemberNotFound(username string) *ErrResourceNotFound
func NewErrResourceNotFound ¶
func NewErrResourceNotFound(id uuid.UUID, resourceType string) *ErrResourceNotFound
func NewErrSourceNotFound ¶
func NewErrSourceNotFound(id uuid.UUID) *ErrResourceNotFound
type ErrSourceHasNoInventory ¶
type ErrSourceHasNoInventory struct {
// contains filtered or unexported fields
}
func NewErrSourceHasNoInventory ¶
func NewErrSourceHasNoInventory(sourceID uuid.UUID) *ErrSourceHasNoInventory
type EstimationContext ¶ added in v0.10.0
type EstimationContext struct {
Schemas []engines.Schema
BaseParams []estimation.Param // scalar params only; excludes per-bucket vmCount/diskGB
}
EstimationContext carries the parameters used to compute per-bucket estimates.
type EstimationService ¶ added in v0.5.1
type EstimationService struct {
// contains filtered or unexported fields
}
EstimationService orchestrates the migration time estimation workflow. It retrieves assessment and inventory data from the store and runs them through the estimation Engine to produce a MigrationAssessmentResult.
func NewEstimationService ¶ added in v0.5.1
func NewEstimationService(store store.Store) *EstimationService
NewEstimationService creates an EstimationService.
func (*EstimationService) BuildBaseParams ¶ added in v0.10.0
func (es *EstimationService) BuildBaseParams(userParams []estimation.Param) []estimation.Param
BuildBaseParams returns the merged base params (defaults + user overrides), without any per-bucket inventory values.
func (*EstimationService) BuildBucketParams ¶ added in v0.10.0
func (es *EstimationService) BuildBucketParams(baseParams []estimation.Param, vmCount int, diskGB float64) []estimation.Param
BuildBucketParams returns params for a single complexity bucket. diskGB = bucket.TotalSizeTB * 1000 (decimal TB as reported by VMware).
func (*EstimationService) CalculateMigrationComplexity ¶ added in v0.7.0
func (es *EstimationService) CalculateMigrationComplexity( ctx context.Context, assessmentID uuid.UUID, clusterID string, ) (*MigrationComplexityResult, error)
CalculateMigrationComplexity calculates OS and disk complexity breakdowns for the given cluster within the assessment's inventory.
func (*EstimationService) CalculateMigrationEstimation ¶ added in v0.5.1
func (es *EstimationService) CalculateMigrationEstimation( ctx context.Context, assessmentID uuid.UUID, clusterID string, schemas []engines.Schema, userParams []estimation.Param, ) (map[engines.Schema]*MigrationAssessmentResult, error)
CalculateMigrationEstimation calculates migration time estimation for a given assessment and cluster
func (*EstimationService) CalculateOsDiskComplexity ¶ added in v0.10.0
func (es *EstimationService) CalculateOsDiskComplexity( ctx context.Context, assessmentID uuid.UUID, clusterID string, ) (*OsDiskComplexityResult, error)
CalculateOsDiskComplexity fetches the cluster inventory and returns the combined OS+Disk complexity distribution. Used by the by-complexity handler.
func (*EstimationService) RunEstimation ¶ added in v0.10.0
func (es *EstimationService) RunEstimation(schemas []engines.Schema, params []estimation.Param) (map[engines.Schema]*MigrationAssessmentResult, error)
RunEstimation builds engines from schemas and runs them with the provided fully-merged params. Performs no store access. When schemas is empty, engines.BuildEngines uses all known schemas.
func (*EstimationService) ValidateParams ¶ added in v0.11.0
func (es *EstimationService) ValidateParams(userParams []estimation.Param) error
ValidateParams checks each user-supplied param against estimationParamDefs. It returns ErrInvalidEstimationParam for unknown keys, non-numeric values, fractional values on integer params, and values outside the Min/Max bounds.
type JobService ¶ added in v0.3.0
type JobService struct {
// contains filtered or unexported fields
}
JobService handles job-related operations.
func NewJobService ¶ added in v0.3.0
NewJobService creates a new job service.
func (*JobService) CancelJob ¶ added in v0.3.0
func (s *JobService) CancelJob(ctx context.Context, jobID int64, orgID, username string) (*v1alpha1.Job, error)
CancelJob cancels a job by ID.
func (*JobService) CreateRVToolsJob ¶ added in v0.3.0
func (s *JobService) CreateRVToolsJob(ctx context.Context, args jobs.RVToolsJobArgs) (*v1alpha1.Job, error)
CreateRVToolsJob creates a new RVTools processing job.
type MigrationAssessmentResult ¶ added in v0.5.1
type MigrationAssessmentResult struct {
MinTotalDuration time.Duration
MaxTotalDuration time.Duration
Breakdown map[string]estimation.Estimation
}
MigrationAssessmentResult represents the result of a migration assessment calculation
type MigrationComplexityResult ¶ added in v0.7.0
type MigrationComplexityResult struct {
ComplexityByDisk []complexity.DiskComplexityEntry // scores 1–4, always 4 entries
ComplexityByOS []complexity.OSDifficultyEntry // scores 0–4, always 5 entries
ComplexityByOSName []complexity.OSNameEntry // one entry per distinct OS name
DiskSizeRatings map[string]complexity.Score // static tier label → score lookup
OSRatings map[string]complexity.Score // per-inventory OS name → score
}
MigrationComplexityResult holds the output of a complexity estimation run.
type OsDiskComplexityResult ¶ added in v0.10.0
type OsDiskComplexityResult struct {
Buckets []complexity.OSDiskEntry
}
OsDiskComplexityResult holds the OsDisk complexity buckets for one cluster.
type ParamDefinition ¶ added in v0.9.0
type ParamDefinition struct {
Key string // matches estimation.Param.Key and the calculator constant
DisplayName string // human-readable label for UI forms
Type string // "number" or "integer"
Unit string // e.g. "Mbps", "hours", "minutes", "" if unitless
Min *float64 // inclusive lower bound, nil if unbounded
Max *float64 // inclusive upper bound, nil if unbounded
Default any // value used when neither inventory nor user supplies this key
Schemas []engines.Schema // schemas that use this parameter; nil means all schemas
}
ParamDefinition describes a single calculator parameter that can be supplied by the user to override the default or inventory-derived value.
This slice is the single source of truth for two things:
- defaultParams() — derives the baseline []estimation.Param from it, so adding a new parameter here automatically makes it part of the merge.
- A future metadata endpoint (e.g. GET /api/v1/estimation/params) that lets the UI render dynamic input forms with correct display names, types, units, and valid ranges without hard-coding any of that in the frontend.
When adding a new calculator parameter, add its definition here first.
type SizerService ¶ added in v0.4.0
type SizerService struct {
// contains filtered or unexported fields
}
SizerService handles cluster sizing calculations
func NewSizerService ¶ added in v0.4.0
func NewSizerService(sizerClient *client.SizerClient, store store.Store) *SizerService
func (*SizerService) CalculateClusterRequirements ¶ added in v0.4.0
func (s *SizerService) CalculateClusterRequirements( ctx context.Context, assessmentID uuid.UUID, req *mappers.ClusterRequirementsRequestForm, ) (*mappers.ClusterRequirementsResponseForm, error)
CalculateClusterRequirements calculates cluster requirements for an assessment
type SourceFilter ¶
func NewSourceFilter ¶
func NewSourceFilter(filters ...SourceFilterFunc) *SourceFilter
func (*SourceFilter) WithOption ¶
func (s *SourceFilter) WithOption(o SourceFilterFunc) *SourceFilter
type SourceFilterFunc ¶
type SourceFilterFunc func(s *SourceFilter)
func WithOrgID ¶
func WithOrgID(orgID string) SourceFilterFunc
func WithSourceID ¶
func WithSourceID(id uuid.UUID) SourceFilterFunc
func WithUsername ¶ added in v0.3.0
func WithUsername(username string) SourceFilterFunc
type SourceService ¶
type SourceService struct {
// contains filtered or unexported fields
}
func NewSourceService ¶
func NewSourceService(store store.Store, opaValidator *opa.Validator) *SourceService
func (*SourceService) CreateSource ¶
func (s *SourceService) CreateSource(ctx context.Context, sourceForm mappers.SourceCreateForm) (model.Source, error)
func (*SourceService) DeleteSource ¶
func (*SourceService) DeleteSources ¶
func (s *SourceService) DeleteSources(ctx context.Context) error
func (*SourceService) GetSourceDownloadURL ¶
func (s *SourceService) GetSourceDownloadURL(ctx context.Context, id uuid.UUID) (string, time.Time, error)
TODO should be moved to ImageService (to be created)
func (*SourceService) ListSources ¶
func (s *SourceService) ListSources(ctx context.Context, filter *SourceFilter) ([]model.Source, error)
func (*SourceService) UpdateInventory ¶
func (s *SourceService) UpdateInventory(ctx context.Context, form mappers.InventoryUpdateForm) (model.Source, error)
func (*SourceService) UpdateSource ¶
func (s *SourceService) UpdateSource(ctx context.Context, id uuid.UUID, form mappers.SourceUpdateForm) (*model.Source, error)
type TransformedSizerResponse ¶ added in v0.4.0
type TransformedSizerResponse struct {
ClusterSizing mappers.ClusterSizingForm
ResourceConsumption mappers.ResourceConsumptionForm
}
TransformedSizerResponse represents the transformed response from the sizer service after mapping it to the domain model format.