Documentation
¶
Index ¶
- func CheckSpecImageCompatibility(csp string, spec cloudmodel.SpecInfo, image cloudmodel.ImageInfo) bool
- func DeduplicateFirewallRules(rules []cloudmodel.FirewallRuleReq) []cloudmodel.FirewallRuleReq
- func FindAndSortVmOsImageInfoListBySimilarity(csp string, keywords string, kwDelimiters []string, ...) []cloudmodel.ImageInfo
- func FindBestVmOsImage(csp string, keywords string, kwDelimiters []string, ...) cloudmodel.ImageInfo
- func FindBestVmOsImageNameUsedInCsp(csp string, keywords string, kwDelimiters []string, ...) string
- func FindCompatibleSpecAndImage(specs []cloudmodel.SpecInfo, images []cloudmodel.ImageInfo, csp string) (cloudmodel.SpecInfo, cloudmodel.ImageInfo, error)
- func GetDefaultImagesLimit() int
- func GetDefaultSpecsLimit() int
- func IsValidCspAndRegion(csp string, region string) (bool, error)
- func MBtoGiB(mb float64) uint32
- func RecommendInfraWithNlbCandidates(desiredCsp, desiredRegion string, srcInfra onpremmodel.OnpremInfra, limit int, ...) ([]cloudmodel.RecommendedInfra, error)
- func RecommendK8sControlPlane(provider, region string, k8sInfoList KubernetesInfoList) (tbmodel.K8sClusterDynamicReq, error)
- func RecommendK8sNodeGroup(provider, region string, k8sInfoList KubernetesInfoList) (tbmodel.K8sNodeGroupReq, error)
- func RecommendSecurityGroup(csp string, region string, node onpremmodel.NodeProperty) (cloudmodel.SecurityGroupReq, error)
- func RecommendSecurityGroups(csp string, region string, servers []onpremmodel.NodeProperty) (cloudmodel.RecommendedSecurityGroupList, error)
- func RecommendVNet(csp string, region string, srcInfra onpremmodel.OnpremInfra) ([]cloudmodel.VNetReq, error)
- func RecommendVmInfra(desiredCsp string, desiredRegion string, srcInfra onpremmodel.OnpremInfra) (cloudmodel.RecommendedInfra, error)
- func RecommendVmInfraCandidates(desiredCsp string, desiredRegion string, srcInfra onpremmodel.OnpremInfra, ...) ([]cloudmodel.RecommendedInfra, error)
- func RecommendVmInfraWithDefaults(desiredCsp string, desiredRegion string, srcInfra onpremmodel.OnpremInfra) (cloudmodel.RecommendedInfraDynamicList, error)
- func RecommendVmOsImage(csp string, region string, node onpremmodel.NodeProperty) (cloudmodel.ImageInfo, error)
- func RecommendVmOsImageId(csp string, region string, node onpremmodel.NodeProperty) (string, error)
- func RecommendVmOsImages(csp string, region string, node onpremmodel.NodeProperty, limit int) ([]cloudmodel.ImageInfo, error)
- func RecommendVmOsImagesForSpec(csp string, region string, node onpremmodel.NodeProperty, limit int, ...) ([]cloudmodel.ImageInfo, error)
- func RecommendVmSpecs(csp string, region string, node onpremmodel.NodeProperty, limit int) (vmSpecList []cloudmodel.SpecInfo, length int, err error)
- func RecommendVmSpecsForImage(csp string, region string, node onpremmodel.NodeProperty, limit int, ...) (vmSpecList []cloudmodel.SpecInfo, length int, err error)
- func SetKeywordsAndDelimeters(node onpremmodel.NodeProperty) (string, []string, []string)
- type CompatibleSpecImagePair
- type CspProvisioningPrecheck
- type Helm
- type InfraMatchRateSummary
- type Kubernetes
- type KubernetesInfoList
- type MatchRateVector
- type Node
- type NodeCount
- type NodeGroupInfo
- type NodeSpec
- type NodeType
- type RecommendationStatus
- type RecommendedInfraInfo
- type Release
- type Repo
- type VmOsImageInfoWithScore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSpecImageCompatibility ¶ added in v0.3.11
func CheckSpecImageCompatibility(csp string, spec cloudmodel.SpecInfo, image cloudmodel.ImageInfo) bool
CheckSpecImageCompatibility validates compatibility between a single VM spec and VM image
func DeduplicateFirewallRules ¶ added in v0.5.6
func DeduplicateFirewallRules(rules []cloudmodel.FirewallRuleReq) []cloudmodel.FirewallRuleReq
DeduplicateFirewallRules removes duplicate firewall rules from the given slice Two rules are considered duplicate if they have the same Direction, Protocol, CIDR, and Ports Protocol and Direction are compared case-insensitively Note: This function expects rules to be already split by comma (same as Tumblebug's processing)
func FindAndSortVmOsImageInfoListBySimilarity ¶ added in v0.3.1
func FindAndSortVmOsImageInfoListBySimilarity(csp string, keywords string, kwDelimiters []string, vmImages []cloudmodel.ImageInfo, imgDelimiters []string) []cloudmodel.ImageInfo
FindAndSortVmOsImageInfoListBySimilarity finds VM OS images that match the keywords and sorts them by similarity score
func FindBestVmOsImage ¶ added in v0.1.1
func FindBestVmOsImage(csp string, keywords string, kwDelimiters []string, vmImages []cloudmodel.ImageInfo, imgDelimiters []string) cloudmodel.ImageInfo
FindBestVmOsImage finds the best matching image based on the similarity scores
func FindBestVmOsImageNameUsedInCsp ¶ added in v0.3.3
func FindBestVmOsImageNameUsedInCsp(csp string, keywords string, kwDelimiters []string, vmImages []cloudmodel.ImageInfo, imgDelimiters []string) string
FindBestVmOsImageNameUsedInCsp finds the best matching image based on the similarity scores
func FindCompatibleSpecAndImage ¶ added in v0.3.4
func FindCompatibleSpecAndImage(specs []cloudmodel.SpecInfo, images []cloudmodel.ImageInfo, csp string) (cloudmodel.SpecInfo, cloudmodel.ImageInfo, error)
FindCompatibleSpecAndImage finds a compatible VM spec and image pair by performing CSP-specific compatibility checks
func GetDefaultImagesLimit ¶ added in v0.3.6
func GetDefaultImagesLimit() int
GetDefaultImagesLimit returns the default VM images recommendation limit
func GetDefaultSpecsLimit ¶ added in v0.3.6
func GetDefaultSpecsLimit() int
GetDefaultSpecsLimit returns the default VM specs recommendation limit
func IsValidCspAndRegion ¶ added in v0.3.1
func RecommendInfraWithNlbCandidates ¶ added in v0.5.3
func RecommendInfraWithNlbCandidates(desiredCsp, desiredRegion string, srcInfra onpremmodel.OnpremInfra, limit int, minMatchRate float64) ([]cloudmodel.RecommendedInfra, error)
RecommendInfraWithNlbCandidates recommends multiple NLB-aware infrastructure candidates following the same Pareto-frontier pattern as RecommendVmInfraCandidates.
Processing phases:
- Build lookup indexes (IP → Node, MachineId → Node)
- Correlate NLB backend server IPs with source Nodes; normalize backend ports
- Build shared skeleton (vNet, SSH key)
- Group source nodes into NodeGroups: NLB-related (N:1) and unrelated (1:1)
- Find ranked spec-image pairs per NodeGroup (sizingPolicy = upsizing)
- Build target NLB list — identical for all candidates
- Assemble candidates: candidate i assigns the i-th ranked pair to each NodeGroup
func RecommendK8sControlPlane ¶ added in v0.4.2
func RecommendK8sControlPlane(provider, region string, k8sInfoList KubernetesInfoList) (tbmodel.K8sClusterDynamicReq, error)
RecommendK8sControlPlane recommends K8s control plane configuration based on honeybee source cluster data
func RecommendK8sNodeGroup ¶ added in v0.4.2
func RecommendK8sNodeGroup(provider, region string, k8sInfoList KubernetesInfoList) (tbmodel.K8sNodeGroupReq, error)
RecommendK8sNodeGroup recommends K8s worker node group configuration based on honeybee source cluster data
func RecommendSecurityGroup ¶ added in v0.3.1
func RecommendSecurityGroup(csp string, region string, node onpremmodel.NodeProperty) (cloudmodel.SecurityGroupReq, error)
func RecommendSecurityGroups ¶ added in v0.3.1
func RecommendSecurityGroups(csp string, region string, servers []onpremmodel.NodeProperty) (cloudmodel.RecommendedSecurityGroupList, error)
func RecommendVNet ¶ added in v0.3.1
func RecommendVNet(csp string, region string, srcInfra onpremmodel.OnpremInfra) ([]cloudmodel.VNetReq, error)
RecommendVNet recommends virtual network configurations based on source infrastructure
func RecommendVmInfra ¶ added in v0.3.1
func RecommendVmInfra(desiredCsp string, desiredRegion string, srcInfra onpremmodel.OnpremInfra) (cloudmodel.RecommendedInfra, error)
RecommendVmInfra an appropriate multi-cloud infrastructure (MCI) for cloud migration
func RecommendVmInfraCandidates ¶ added in v0.4.6
func RecommendVmInfraCandidates(desiredCsp string, desiredRegion string, srcInfra onpremmodel.OnpremInfra, limit int, minMatchRate float64) ([]cloudmodel.RecommendedInfra, error)
RecommendVmInfraCandidates an appropriate multi-cloud infrastructure (MCI) for cloud migration
func RecommendVmInfraWithDefaults ¶ added in v0.3.1
func RecommendVmInfraWithDefaults(desiredCsp string, desiredRegion string, srcInfra onpremmodel.OnpremInfra) (cloudmodel.RecommendedInfraDynamicList, error)
RecommendVmInfraWithDefaults an appropriate multi-cloud infrastructure (MCI) for cloud migration
func RecommendVmOsImage ¶ added in v0.3.1
func RecommendVmOsImage(csp string, region string, node onpremmodel.NodeProperty) (cloudmodel.ImageInfo, error)
RecommendVmOsImage recommends an appropriate VM OS image (e.g., Ubuntu 22.04) for the given VM spec
func RecommendVmOsImageId ¶ added in v0.3.1
func RecommendVmOsImageId(csp string, region string, node onpremmodel.NodeProperty) (string, error)
RecommendVmOsImageId recommends an appropriate VM OS image (e.g., Ubuntu 22.04) for the given VM spec
func RecommendVmOsImages ¶ added in v0.3.1
func RecommendVmOsImages(csp string, region string, node onpremmodel.NodeProperty, limit int) ([]cloudmodel.ImageInfo, error)
RecommendVmOsImages recommends an appropriate VM OS image (e.g., Ubuntu 22.04) for the given VM spec
func RecommendVmOsImagesForSpec ¶ added in v0.3.10
func RecommendVmOsImagesForSpec(csp string, region string, node onpremmodel.NodeProperty, limit int, spec cloudmodel.SpecInfo) ([]cloudmodel.ImageInfo, error)
RecommendVmOsImagesForSpec recommends appropriate VM OS images for the given VM spec.
func RecommendVmSpecs ¶ added in v0.3.1
func RecommendVmSpecs(csp string, region string, node onpremmodel.NodeProperty, limit int) (vmSpecList []cloudmodel.SpecInfo, length int, err error)
RecommendVmSpecs recommends appropriate VM specs for the given node
func RecommendVmSpecsForImage ¶ added in v0.3.3
func RecommendVmSpecsForImage(csp string, region string, node onpremmodel.NodeProperty, limit int, image cloudmodel.ImageInfo) (vmSpecList []cloudmodel.SpecInfo, length int, err error)
RecommendVmSpecsForImage recommends appropriate VM specs for the node and image
func SetKeywordsAndDelimeters ¶ added in v0.4.6
func SetKeywordsAndDelimeters(node onpremmodel.NodeProperty) (string, []string, []string)
Types ¶
type CompatibleSpecImagePair ¶ added in v0.3.9
type CompatibleSpecImagePair struct {
Spec cloudmodel.SpecInfo `json:"spec"`
Image cloudmodel.ImageInfo `json:"image"`
}
func FindCompatibleVmSpecAndImagePairs ¶ added in v0.4.6
func FindCompatibleVmSpecAndImagePairs(specs []cloudmodel.SpecInfo, images []cloudmodel.ImageInfo, csp string) ([]CompatibleSpecImagePair, error)
FindCompatibleVmSpecAndImagePairs finds all compatible VM spec and image pairs by performing CSP-specific compatibility checks
type CspProvisioningPrecheck ¶ added in v0.5.1
type CspProvisioningPrecheck struct {
// ResolvedCspImageName is the latest CSP image name. Set on CreateNodeGroupReq.CspImageName
// so TumbleBug bypasses its DB cache and passes the fresh name directly to Spider.
ResolvedCspImageName string
// IsAvailable reports whether the image is currently available on the CSP.
IsAvailable bool
// SuggestedSystemDisk is the disk category confirmed available for the spec+zone.
// Empty = no suggestion; use CSP default. Set on CreateNodeGroupReq.RootDiskType.
SuggestedSystemDisk string
}
CspProvisioningPrecheck is the result of a POST /specImagePairReview call.
func PreflightCheckCspProvisioning ¶ added in v0.5.1
func PreflightCheckCspProvisioning(specId, imageId, currentCspImageName, rootDiskType string) (CspProvisioningPrecheck, error)
PreflightCheckCspProvisioning calls POST /specImagePairReview and returns image availability, the resolved latest CSP image name, and the suggested system disk for the spec+zone.
type InfraMatchRateSummary ¶ added in v0.4.6
type InfraMatchRateSummary struct {
MinMatchRate float64 // Minimum match rate across all VMs (weakest link)
MaxMatchRate float64 // Maximum match rate across all VMs (best match)
AvgMatchRate float64 // Average match rate across all VMs
BestEffortRate float64 // Percentage of VMs meeting best-effort threshold
TotalVMs int // Total number of VMs evaluated
}
InfraMatchRateSummary represents overall infrastructure match rate metrics
type Kubernetes ¶ added in v0.4.2
type KubernetesInfoList ¶ added in v0.4.2
type KubernetesInfoList struct {
Servers []Kubernetes `json:"servers" validate:"required"`
}
Honeybee v0.4.0 Kubernetes models
type MatchRateVector ¶ added in v0.4.6
type MatchRateVector struct {
CPU float64 // CPU resource match rate (0-100%)
Memory float64 // Memory resource match rate (0-100%)
Image float64 // OS image similarity match rate (0-100%)
}
MatchRateVector represents multi-dimensional match rate scores for infrastructure recommendation Each dimension is independently evaluated (0-100%), making the system extensible without weight tuning
func (MatchRateVector) AverageMatchRate ¶ added in v0.4.6
func (q MatchRateVector) AverageMatchRate() float64
AverageMatchRate returns the average match rate across all dimensions
func (MatchRateVector) IsMatched ¶ added in v0.4.6
func (q MatchRateVector) IsMatched(threshold float64) bool
IsMatched checks if all dimensions meet the match rate threshold Rationale: "Best effort" requires ALL resources to be sufficiently matched
func (MatchRateVector) MaxMatchRate ¶ added in v0.4.6
func (q MatchRateVector) MaxMatchRate() float64
MaxMatchRate returns the maximum match rate score across all dimensions Rationale: Represents the strongest dimension match
func (MatchRateVector) MinMatchRate ¶ added in v0.4.6
func (q MatchRateVector) MinMatchRate() float64
MinMatchRate returns the minimum match rate score across all dimensions Rationale: Overall match rate is limited by the weakest dimension
type NodeGroupInfo ¶ added in v0.4.2
NodeGroupInfo holds aggregated information for a node group
type RecommendationStatus ¶ added in v0.2.1
type RecommendationStatus string
RecommendationStatus represents the status of a recommendation.
const ( NothingRecommended RecommendationStatus = "none" PartiallyRecommended RecommendationStatus = "partial" FullyRecommended RecommendationStatus = "ok" )
type RecommendedInfraInfo ¶ added in v0.2.1
type RecommendedInfraInfo struct {
Status string `json:"status"`
Description string `json:"description"`
TargetInfra tbmodel.InfraDynamicReq `json:"targetInfra"`
}
* Models for Container Infrastructure (i.e., an infrastructure for Kubernetes)
type VmOsImageInfoWithScore ¶ added in v0.3.1
type VmOsImageInfoWithScore struct {
VmOsImageInfo cloudmodel.ImageInfo
SimilarityScore float64
}