recommendation

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package recommendation provides infrastructure and resource recommendation algorithms for CM-Beetle.

Package recommendation contains the core logic for recommending K8s infra configurations.

Package recommendation provides logic to recommend optimal target cloud resources

Index

Constants

View Source
const (
	SizingPolicyRightSizeUp = "rightSizeUp"
	SizingPolicyDividing    = "dividing"
)

Sizing policy constants for composite infrastructure recommendation.

View Source
const (
	// MinMultiInfraTargets is the minimum number of CSP/region pairs a multi-target
	// recommendation request must include (a single pair is just /recommendation/infra).
	MinMultiInfraTargets = 2

	// MaxMultiInfraTargets caps the number of CSP/region pairs a multi-target recommendation
	// request may include.
	MaxMultiInfraTargets = 10
)
View Source
const (
	DefaultRDBMSAdminUser    string = "dbadmin"
	DefaultRDBMSVcpu         uint32 = 2
	DefaultRDBMSMemoryGiB    uint64 = 4
	DefaultRDBMSStorageGB    uint64 = 100
	DefaultRDBMSStorageType  string = "SSD"
	DefaultMySQLVersion      string = "8.0"
	DefaultMariaDBVersion    string = "10.6"
	DefaultPostgreSQLVersion string = "15"
)

Default baseline specifications for RDBMS recommendation

View Source
const (
	GpuVendorNVIDIA = "NVIDIA"
	GpuVendorAMD    = "AMD"
	GpuVendorIntel  = "Intel"
	GpuVendorGoogle = "Google"
	GpuVendorOther  = "Other"
)

Canonical GPU Vendor identities

View Source
const (
	MetricAcceleratorCount    = "acceleratorCount"
	MetricAcceleratorMemoryGB = "acceleratorMemoryGB"
	MetricAcceleratorType     = "acceleratorType"
	MetricAcceleratorModel    = "acceleratorModel"
	AcceleratorTypeGPU        = "gpu"
)

Metric names for Tumblebug deployment plans

View Source
const (
	// DefaultTargetVNetCidr is the default target VNet CIDR block recommended when source network info is absent
	DefaultTargetVNetCidr = "10.0.0.0/16"
	// DefaultTargetSubnetCidr is the default target Subnet CIDR block recommended when source network info is absent
	DefaultTargetSubnetCidr = "10.0.1.0/24"
)

Variables

This section is empty.

Functions

func AdjustSubnetCidrForCsp added in v0.6.2

func AdjustSubnetCidrForCsp(cspName string, vnetCidr string, rawSubnetCidr string) (string, error)

AdjustSubnetCidrForCsp validates and adjusts a subnet CIDR to conform to CSP subnet constraints.

func AdjustVNetCidrForCsp added in v0.6.2

func AdjustVNetCidrForCsp(cspName string, rawSupernet string, estimateNetworks int) (string, string, error)

AdjustVNetCidrForCsp validates and clamps a calculated supernet CIDR to satisfy CSP VNet constraints. It returns the adjusted CIDR, an informational note if clamped, and any validation error.

func AutoFillSourceRDBMSDefaults added in v0.6.1

func AutoFillSourceRDBMSDefaults(sources []rdbmsmodel.SourceRDBMSProperty) ([]rdbmsmodel.SourceRDBMSProperty, []string, error)

AutoFillSourceRDBMSDefaults inspects source RDBMS instances, applies sensible minimum baseline defaults for zero/unspecified compute, storage, and version values, logs warnings, and returns the defaulted copies along with collected user-facing warnings.

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 DecomposeOnpremNodes added in v0.6.2

func DecomposeOnpremNodes(nodes []onpremmodel.NodeProperty) []onpremmodel.NodeProperty

DecomposeOnpremNodes decomposes heterogeneous on-premise physical servers into homogeneous logical nodes. For nodes without GPUs or with homogeneous cards (only 1 cluster), the node is preserved 1:1. For nodes with mixed/heterogeneous GPU cards (e.g. 2x A100 + 1x T4 + 1x MI350), the node is decomposed into K distinct logical nodes (1:K), each containing one homogeneous GPU cluster.

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, node ...onpremmodel.NodeProperty) []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, node ...onpremmodel.NodeProperty) 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, node ...onpremmodel.NodeProperty) 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 GetRDBMSCapability added in v0.6.1

func GetRDBMSCapability(connectionName string, optionalEngine ...string) (rdbmsmodel.RDBMSCapabilityResponse, error)

GetRDBMSCapability retrieves real-time capability information for a connection and optional dbEngine via CB-Tumblebug.

func GetRDBMSSupport added in v0.6.1

func GetRDBMSSupport(providerName string) (rdbmsmodel.RDBMSSupportResponse, error)

GetRDBMSSupport retrieves CSP support matrix for managed RDBMS via CB-Tumblebug.

func HasAnyGpu added in v0.6.2

func HasAnyGpu(srcInfra onpremmodel.OnpremInfra) bool

HasAnyGpu returns true if at least one node in the infrastructure contains physical GPU accelerator cards.

func IsValidCspAndRegion added in v0.3.1

func IsValidCspAndRegion(cspName string, region string) (bool, error)

func MBtoGiB added in v0.1.1

func MBtoGiB(mb float64) uint32

MBtoGiB converts megabytes to gibibytes

func RecommendCompositeInfraCandidates added in v0.6.2

func RecommendCompositeInfraCandidates(
	desiredCsp, desiredRegion string,
	srcInfra onpremmodel.OnpremInfra,
	sizingPolicy string,
	limit int,
	minMatchRate float64,
) ([]cloudmodel.RecommendedInfra, error)

RecommendCompositeInfraCandidates recommends high-level multi-cloud infrastructure candidates. It handles all 5 hardware cases and strict 1:1 Managed NLB to NodeGroup invariants.

func RecommendGpuInfraCandidates added in v0.6.2

func RecommendGpuInfraCandidates(
	desiredCsp string,
	desiredRegion string,
	srcInfra onpremmodel.OnpremInfra,
	limit int,
	minMatchRate float64,
) ([]cloudmodel.RecommendedInfra, error)

RecommendGpuInfraCandidates recommends multiple target infrastructure candidates for source infrastructure containing GPU accelerators. It adheres to the Go Single Responsibility Principle by encapsulating heterogeneous GPU decomposition, shared intra-node networking, and GPU-aware infrastructure assembly.

func RecommendInfra added in v0.6.2

func RecommendInfra(desiredCsp string, desiredRegion string, srcInfra onpremmodel.OnpremInfra) (cloudmodel.RecommendedInfra, error)

RecommendInfra recommends an appropriate target infrastructure for cloud migration

func RecommendInfraCandidates added in v0.6.2

func RecommendInfraCandidates(desiredCsp string, desiredRegion string, srcInfra onpremmodel.OnpremInfra, limit int, minMatchRate float64) ([]cloudmodel.RecommendedInfra, error)

RecommendInfraCandidates recommends appropriate target infrastructure candidates for cloud migration

func RecommendInfraWithDefaults added in v0.6.2

func RecommendInfraWithDefaults(desiredCsp string, desiredRegion string, srcInfra onpremmodel.OnpremInfra) (cloudmodel.RecommendedInfraDynamicList, error)

RecommendInfraWithDefaults recommends an appropriate target infrastructure for cloud migration using defaults

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:

  1. Build lookup indexes (IP → Node, MachineId → Node)
  2. Correlate NLB backend server IPs with source Nodes; normalize backend ports
  3. Build shared skeleton (vNet, SSH key)
  4. Group source nodes into NodeGroups: NLB-related (N:1) and unrelated (1:1)
  5. Find ranked spec-image pairs per NodeGroup (sizingPolicy = upsizing)
  6. Build target NLB list — identical for all candidates
  7. Assemble candidates: candidate i assigns the i-th ranked pair to each NodeGroup

func RecommendK8sInfra added in v0.6.0

func RecommendK8sInfra(provider, region string, onpremInfra onpremmodel.OnpremInfra) (cloudmodel.RecommendedInfra, error)

RecommendK8sInfra builds a complete K8s infra recommendation from on-premise infra data.

func RecommendK8sNodeGroupImages added in v0.5.10

func RecommendK8sNodeGroupImages(provider, region string, srcInfra onpremmodel.OnpremInfra) (cloudmodel.RecommendedOsImageList, error)

RecommendK8sNodeGroupImages recommends a node image for every architecture present among the source workers, and assembles the L0 response.

Grouping is by normalized architecture, which is the only input to node image selection. This intentionally differs from the node group breakdown in RecommendK8sInfra: several node groups can share one architecture and therefore one node image, and grouping by spec here would cost a Tumblebug spec search per group for a result that does not depend on the spec.

Returns RecommendedOsImageList. For K8s node images, only TargetOsImage.Id is populated; other ImageInfo fields are empty because the curated list carries only an id string.

If NodeImageDesignation=false for the provider, "default" is returned for every group. If arm64 designation is required but no ARM image is available in the curated list, an error is returned so the limitation surfaces at recommendation time.

func RecommendK8sNodeGroupSpecs added in v0.5.10

func RecommendK8sNodeGroupSpecs(provider, region string, srcInfra onpremmodel.OnpremInfra, limit int) (cloudmodel.RecommendedSpecList, error)

RecommendK8sNodeGroupSpecs recommends a worker spec for every node group derived from the source workers, and assembles the L0 response.

Workers are recommended individually and then merged by the target spec they resolve to, because managed K8s node groups are homogeneous; one recommendation set is produced per merged group, with the group's members reported in SourceServers.

Unlike RecommendK8sInfra, this does NOT require srcInfra.K8sCluster — spec recommendation only needs worker nodes. Cluster info is a version-selection input, not a spec input.

func RecommendK8sNodeSpecs added in v0.5.10

func RecommendK8sNodeSpecs(provider, region string, req workerRequirement, limit int) ([]cloudmodel.SpecInfo, error)

RecommendK8sNodeSpecs recommends cost-ranked specs for a single K8s worker node.

The requirement it searches against is already normalized (see normalizeWorker): vCPU computed by one rule, architecture canonicalized, and sizing floored at the minimum viable worker spec. This function decides only what can be bought to satisfy it — which needs the target catalog and is therefore the one part that cannot be done without I/O.

It differs from RecommendVmSpecs in three ways, all driven by the same constraint — a worker smaller than its source leaves pods unschedulable:

  • the search range is clamped so it never dips below the requirement, whereas the VM path deliberately allows downsizing,
  • ranking ignores CPU vendor (see sortK8sSpecsByProximity): with every candidate already at or above the source, a vendor match can only buy a larger, costlier node,
  • specs a CSP cannot use for node groups (e.g. NCP XEN specs) never reach it: Tumblebug's K8s endpoint drops them by the nodeSpecNamingRule in its k8sclusterinfo.yaml.

The request goes to Tumblebug's K8s endpoint, whose validateK8sMinimumRequirements enforces the K8s node minimums; the requirement's floor keeps the lower bounds at or above those minimums so the request passes validation instead of being rejected.

func RecommendMultiInfraCandidates added in v0.5.9

func RecommendMultiInfraCandidates(pairs []cloudmodel.CloudProperty, srcInfra onpremmodel.OnpremInfra, minMatchRate float64) ([]cloudmodel.RecommendedInfra, error)

RecommendMultiInfraCandidates recommends the single best-match infrastructure candidate for each target CSP/region pair, for cross-CSP comparison. Composes RecommendInfraCandidates or RecommendGpuInfraCandidates based on GPU presence; no matching/ranking logic is duplicated here.

func RecommendMultiInfraWithNlbCandidates added in v0.5.9

func RecommendMultiInfraWithNlbCandidates(pairs []cloudmodel.CloudProperty, srcInfra onpremmodel.OnpremInfra, minMatchRate float64) ([]cloudmodel.RecommendedInfra, error)

RecommendMultiInfraWithNlbCandidates is the NLB-aware counterpart of RecommendMultiInfraCandidates, composing RecommendInfraWithNlbCandidates per target.

func RecommendNodeSpecs added in v0.6.0

func RecommendNodeSpecs(csp string, region string, node onpremmodel.NodeProperty, limit int) (vmSpecList []cloudmodel.SpecInfo, length int, err error)

RecommendNodeSpecs recommends appropriate node specs (VM specs) for the given node. It delegates to specialized recommendation pipelines based on GPU presence: - recommendGpuNodeSpec for nodes with GPU accelerators - recommendCpuNodeSpec for general-purpose CPU nodes

func RecommendRDBMS added in v0.6.1

func RecommendRDBMS(desiredCsp, desiredRegion string, sources []rdbmsmodel.SourceRDBMSProperty, autoFillSourceDefaults bool, prefs ...*TargetPreferences) (rdbmsmodel.RecommendedRDBMS, error)

RecommendRDBMS recommends optimal managed RDBMS instances for target cloud migration. If autoFillSourceDefaults is true (default), missing/zero compute and storage values in sources are automatically populated with operational baseline defaults and recorded in warnings. If autoFillSourceDefaults is false, strict validation is enforced via ValidateSourceRDBMS.

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 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 SanitizeSourceInfra added in v0.6.2

func SanitizeSourceInfra(srcInfra onpremmodel.OnpremInfra) onpremmodel.OnpremInfra

SanitizeSourceInfra creates a sanitized copy of srcInfra with valid node specifications.

func SanitizeSourceNode added in v0.6.2

func SanitizeSourceNode(node onpremmodel.NodeProperty) onpremmodel.NodeProperty

SanitizeSourceNode mitigates missing or zero-valued hardware fields in a source node.

func SetKeywordsAndDelimeters added in v0.4.6

func SetKeywordsAndDelimeters(node onpremmodel.NodeProperty) (string, []string, []string)

SetKeywordsAndDelimeters builds OS and CPU architecture search keywords for OS image matching.

func ValidateRDBMS added in v0.6.1

ValidateRDBMS performs dry-run validation and default autofill for an RDBMS create request. It executes a two-stage validation pipeline:

  1. Beetle Deep Validation: Referential & cross-connection integrity checks (e.g. verifying VNet/SG connection matches target RDBMS connection)
  2. Tumblebug Infra Validation: Dry-run check against CSP capability & API constraints via CB-Tumblebug.

func ValidateSourceRDBMS added in v0.6.1

func ValidateSourceRDBMS(sources []rdbmsmodel.SourceRDBMSProperty) error

ValidateSourceRDBMS strictly validates the source RDBMS model properties before recommendation.

Types

type CidrBlockConfig added in v0.6.2

type CidrBlockConfig struct {
	CidrBlock   string `yaml:"cidr-block"`
	Description string `yaml:"description"`
}

CidrBlockConfig holds an IP range and its description.

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 CspNetworkConfig added in v0.6.2

type CspNetworkConfig struct {
	Description         string            `yaml:"description"`
	Links               []string          `yaml:"link"`
	AvailableCidrBlocks []CidrBlockConfig `yaml:"available-cidr-blocks"`
	ReservedCidrBlocks  []CidrBlockConfig `yaml:"reserved-cidr-blocks"`
	VNet                *VNetConfig       `yaml:"vnet"`
	Subnet              *SubnetConfig     `yaml:"subnet"`
	VPN                 *VpnConfig        `yaml:"vpn"`
}

CspNetworkConfig describes network characteristics and constraints for a single CSP.

func GetCspNetworkConfig added in v0.6.2

func GetCspNetworkConfig(cspName string) (CspNetworkConfig, bool)

GetCspNetworkConfig retrieves network constraints for a given CSP name.

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 GatewaySubnetConfig added in v0.6.2

type GatewaySubnetConfig struct {
	Required     bool               `yaml:"required"`
	Name         string             `yaml:"name"`
	PrefixLength PrefixLengthConfig `yaml:"prefix-length"`
}

GatewaySubnetConfig describes requirements for gateway subnets.

type GpuCardCluster added in v0.6.2

type GpuCardCluster struct {
	Vendor        string
	Model         string
	MemoryTotalGB float32
	Count         uint32
}

GpuCardCluster represents a homogeneous cluster of identical GPU cards installed on the node.

type HardwareCase added in v0.6.2

type HardwareCase int

HardwareCase represents the hardware categorization of an NLB backend pool.

const (
	// CasePureCpu indicates all backend servers are CPU-only without accelerators.
	CasePureCpu HardwareCase = 0
	// CaseMixedCpuGpu indicates both CPU-only servers and GPU servers are present.
	CaseMixedCpuGpu HardwareCase = 1
	// CaseCrossVendorGpu indicates GPUs from multiple vendors are present.
	CaseCrossVendorGpu HardwareCase = 2
	// CaseHeteroGpuModel indicates same-vendor GPUs with differing models or VRAM.
	CaseHeteroGpuModel HardwareCase = 3
	// CaseHomoGpuModel indicates all servers share identical GPU model and VRAM.
	CaseHomoGpuModel HardwareCase = 4
)

func ClassifyBackendHardware added in v0.6.2

func ClassifyBackendHardware(members []onpremmodel.NodeProperty) HardwareCase

ClassifyBackendHardware evaluates the hardware accelerator profile of backend servers.

func (HardwareCase) String added in v0.6.2

func (c HardwareCase) String() string

String returns a human-readable name for the HardwareCase.

type InfraMatchRateSummary added in v0.4.6

type InfraMatchRateSummary struct {
	MinMatchRate   float64
	MaxMatchRate   float64
	AvgMatchRate   float64
	BestEffortRate float64
	TotalVMs       int
}

InfraMatchRateSummary represents overall candidate infrastructure match rate metrics.

type MatchRateVector added in v0.4.6

type MatchRateVector struct {
	CPU      float64
	Memory   float64
	Image    float64
	HasGPU   bool
	GPUCount float64
	GPUVRAM  float64
	GPUModel float64
}

MatchRateVector represents multi-dimensional match rate scores (0-100%) for a node. CPU-only nodes evaluate 3 dimensions; GPU nodes evaluate 6 dimensions.

func (MatchRateVector) ActiveDimensions added in v0.6.3

func (q MatchRateVector) ActiveDimensions() []float64

ActiveDimensions returns the 3 active dimensions for CPU nodes or 6 for GPU nodes.

func (MatchRateVector) AverageMatchRate added in v0.4.6

func (q MatchRateVector) AverageMatchRate() float64

AverageMatchRate returns the arithmetic mean across all active dimensions.

func (MatchRateVector) FormatMatchRateSummary added in v0.6.3

func (q MatchRateVector) FormatMatchRateSummary() string

FormatMatchRateSummary formats the active dimensions into a human-readable summary string.

func (MatchRateVector) IsMatched added in v0.4.6

func (q MatchRateVector) IsMatched(threshold float64) bool

IsMatched checks if all active dimensions meet or exceed the match rate threshold.

func (MatchRateVector) MaxMatchRate added in v0.4.6

func (q MatchRateVector) MaxMatchRate() float64

MaxMatchRate returns the maximum match rate score across all active dimensions.

func (MatchRateVector) MinMatchRate added in v0.4.6

func (q MatchRateVector) MinMatchRate() float64

MinMatchRate returns the minimum match rate score across all active dimensions.

type NetworkInfoConfig added in v0.6.2

type NetworkInfoConfig struct {
	Network map[string]CspNetworkConfig `yaml:"network"`
}

NetworkInfoConfig holds the top-level network configuration across CSPs.

type PrefixLengthConfig added in v0.6.2

type PrefixLengthConfig struct {
	Min         int    `yaml:"min"`
	Max         int    `yaml:"max"`
	Description string `yaml:"description"`
}

PrefixLengthConfig defines min and max CIDR prefix lengths.

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 ReservedIPsConfig added in v0.6.2

type ReservedIPsConfig struct {
	Count       int    `yaml:"count"`
	Value       int    `yaml:"value"`
	Description string `yaml:"description"`
}

ReservedIPsConfig captures the count or value of reserved IP addresses.

type SubnetConfig added in v0.6.2

type SubnetConfig struct {
	PrefixLength PrefixLengthConfig `yaml:"prefix-length"`
	ReservedIPs  ReservedIPsConfig  `yaml:"reserved-ips"`
}

SubnetConfig describes Subnet CIDR prefix length limits and reserved IPs for a CSP.

type TargetPreferences added in v0.6.1

type TargetPreferences struct {
	AdminUserName             string `json:"adminUserName,omitempty" example:"dbadmin"`
	HighAvailability          *bool  `json:"highAvailability,omitempty" example:"false"`
	PublicAccess              *bool  `json:"publicAccess,omitempty" example:"true"`
	BackupRetentionDays       int    `json:"backupRetentionDays,omitempty" example:"0"`
	NHNDBSGToAllowAllInbound  bool   `json:"nhnDBSGToAllowAllInbound,omitempty" example:"false"`
	NCPDBACGToAllowAllInbound bool   `json:"ncpDBACGToAllowAllInbound,omitempty" example:"false"`
}

TargetPreferences represents user-desired deployment preferences and policies for target cloud databases.

type VNetConfig added in v0.6.2

type VNetConfig struct {
	PrefixLength PrefixLengthConfig `yaml:"prefix-length"`
}

VNetConfig describes VNet CIDR prefix length limits for a CSP.

type VmOsImageInfoWithScore added in v0.3.1

type VmOsImageInfoWithScore struct {
	VmOsImageInfo   cloudmodel.ImageInfo
	SimilarityScore float64
}

type VpnConfig added in v0.6.2

type VpnConfig struct {
	GatewaySubnet *GatewaySubnetConfig `yaml:"gateway-subnet"`
}

VpnConfig describes VPN characteristics such as gateway subnet requirements.

Jump to

Keyboard shortcuts

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