Documentation
¶
Overview ¶
Package mci is to manage multi-cloud infra
Package mci is to manage multi-cloud infra ¶
Package mci is to manage multi-cloud infra ¶
Package mci is to manage multi-cloud infra ¶
Package mci is to manage multi-cloud infra ¶
Package mci is to manage multi-cloud infra ¶
Package mci is to manage multi-cloud infra ¶
Package mci is to manage multi-cloud infra ¶
Package mci is to manage multi-cloud infra ¶
Package mci is to manage multi-cloud infra ¶
Package mci is to manage multi-cloud infra
Index ¶
- func AddCommandStatusInfo(nsId, mciId, vmId, xRequestId, commandRequested, commandExecuted string) (int, error)
- func AddNLBVMs(nsId string, mciId string, resourceId string, u *model.NLBAddRemoveVMReq) (model.NLBInfo, error)
- func AnalyzeProvisioningRisk(specId string, cspImageName string) (riskLevel string, riskMessage string, err error)
- func AnalyzeProvisioningRiskDetailed(specId string, cspImageName string) (*model.RiskAnalysis, error)
- func AttachDetachDataDisk(nsId string, mciId string, vmId string, command string, dataDiskId string, ...) (model.VmInfo, error)
- func BenchmarkAction(nsId string, mciId string, action string, option string) (model.BenchmarkInfoArray, error)
- func BuildAgnosticImage(nsId string, req model.BuildAgnosticImageReq) (model.BuildAgnosticImageResult, error)
- func BuildLatencyOrderByClause(param *[]model.ParameterKeyVal) (string, error)
- func BuildLocationOrderByClause(param *[]model.ParameterKeyVal) (string, error)
- func CallGetMonitoringAsync(wg *sync.WaitGroup, nsID string, mciID string, vmID string, vmIP string, ...)
- func CallMilkyway(wg *sync.WaitGroup, vmList []string, nsId string, mciId string, vmId string, ...)
- func CallMonitoringAsync(wg *sync.WaitGroup, nsID string, mciID string, mciServiceType string, ...)
- func CheckAllowedTransition(nsId string, mciId string, vmId model.OptionalParameter, action string) error
- func CheckConnectivity(host string, port string) error
- func CheckDragonflyEndpoint() error
- func CheckK8sClusterDynamicReq(req *model.K8sClusterConnectionConfigCandidatesReq) (*model.CheckK8sClusterDynamicReqInfo, error)
- func CheckMci(nsId string, mciId string) (bool, error)
- func CheckMciDynamicReq(req *model.MciConnectionConfigCandidatesReq) (*model.CheckMciDynamicReqInfo, error)
- func CheckMciPolicy(nsId string, mciId string) (bool, error)
- func CheckNLB(nsId string, mciId string, resourceId string) (bool, error)
- func CheckSubGroup(nsId string, mciId string, subGroupId string) (bool, error)
- func CheckVm(nsId string, mciId string, vmId string) (bool, error)
- func CleanupCorruptedProvisioningLogs() error
- func ClearAllCommandStatusInfo(nsId, mciId, vmId string) (int, error)
- func ControlMciAsync(nsId string, mciId string, action string, force bool) error
- func ControlVmAsync(wg *sync.WaitGroup, nsId string, mciId string, vmId string, action string, ...)
- func ControlVmsInParallel(nsId, mciId string, vmList []string, action string, force bool) error
- func ConvertMciInfoToMciStatusInfo(mciInfo model.MciInfo) model.MciStatusInfo
- func ConvertVmInfoFieldsToVmStatusInfo(vmStatus *model.VmStatusInfo, vmInfo model.VmInfo)
- func ConvertVmInfoFieldsToVmStatusInfoList(vmStatusList []model.VmStatusInfo, vmInfoList []model.VmInfo)
- func ConvertVmInfoListToVmStatusInfoList(vmInfoList []model.VmInfo) []model.VmStatusInfo
- func ConvertVmInfoToVmStatusInfo(vmInfo model.VmInfo) model.VmStatusInfo
- func CoreGetBenchmark(nsId string, mciId string, action string, host string) (*model.BenchmarkInfoArray, error)
- func CreateK8sClusterDynamic(reqID string, nsId string, dReq *model.K8sClusterDynamicReq, ...) (*model.K8sClusterInfo, error)
- func CreateK8sNodeGroupDynamic(reqID string, nsId string, k8sClusterId string, ...) (*model.K8sClusterInfo, error)
- func CreateMcSwNlb(nsId string, mciId string, req *model.NLBReq, option string) (model.McNlbInfo, error)
- func CreateMci(nsId string, req *model.MciReq, option string, isReqFromDynamic bool) (*model.MciInfo, error)
- func CreateMciDynamic(reqID string, nsId string, req *model.MciDynamicReq, deployOption string) (*model.MciInfo, error)
- func CreateMciGroupVm(nsId string, mciId string, vmRequest *model.CreateSubGroupReq, ...) (*model.MciInfo, error)
- func CreateMciPolicy(nsId string, mciId string, u *model.MciPolicyReq) (model.MciPolicyInfo, error)
- func CreateMciSnapshot(nsId string, mciId string, snapshotReq model.SnapshotReq) (model.MciSnapshotResult, error)
- func CreateMciSubGroupDynamic(nsId string, mciId string, req *model.CreateSubGroupDynamicReq) (*model.MciInfo, error)
- func CreateNLB(nsId string, mciId string, u *model.NLBReq, option string) (model.NLBInfo, error)
- func CreateSubGroupReqStructLevelValidation(sl validator.StructLevel)
- func CreateSystemMciDynamic(option string) (*model.MciInfo, error)
- func CreateVm(wg *sync.WaitGroup, nsId string, mciId string, vmInfoData *model.VmInfo, ...) error
- func CreateVmObject(wg *sync.WaitGroup, nsId string, mciId string, vmInfoData *model.VmInfo) error
- func CreateVmSnapshot(nsId string, mciId string, vmId string, snapshotReq model.SnapshotReq) (model.ImageInfo, error)
- func CreateVmsInParallel(nsId, mciId string, vmInfoList []*model.VmInfo, option string) error
- func DFMonAgentInstallReqStructLevelValidation(sl validator.StructLevel)
- func DelAllMci(nsId string, option string) (string, error)
- func DelAllMciPolicy(nsId string) (string, error)
- func DelAllNLB(nsId string, mciId string, subString string, forceFlag string) (model.IdList, error)
- func DelMci(nsId string, mciId string, option string) (model.IdList, error)
- func DelMciPolicy(nsId string, mciId string) error
- func DelMciVm(nsId string, mciId string, vmId string, option string) error
- func DelNLB(nsId string, mciId string, resourceId string, forceFlag string) error
- func DeleteCommandStatusInfo(nsId, mciId, vmId string, index int) error
- func DeleteCommandStatusInfoByCriteria(nsId, mciId, vmId string, filter *model.CommandStatusFilter) (int, error)
- func DeleteProvisioningLog(specId string) error
- func Difference_dataDisks(a, b []model.ResourceOnTumblebugInfo) []model.ResourceOnTumblebugInfo
- func FetchVmStatus(nsId string, mciId string, vmId string) (model.VmStatusInfo, error)
- func FindTbVmByCspId(nsId string, mciId string, vmCspResourceId string) (model.VmInfo, error)
- func GenNLBKey(nsId string, mciId string, resourceId string) string
- func GetAllMciPolicyObject(nsId string) ([]model.MciPolicyInfo, error)
- func GetAvailableDataDisks(nsId string, mciId string, vmId string, option string) (interface{}, error)
- func GetBastionNodes(nsId string, mciId string, targetVmId string) ([]model.BastionNode, error)
- func GetCommandStatusInfo(nsId, mciId, vmId string, index int) (*model.CommandStatusInfo, error)
- func GetHandlingCommandCount(nsId, mciId, vmId string) (int, error)
- func GetLatency(src string, dest string) (float64, error)
- func GetMcNlbAccess(nsId string, mciId string) (*model.MciAccessInfo, error)
- func GetMciAccessInfo(nsId string, mciId string, option string) (*model.MciAccessInfo, error)
- func GetMciAssociatedResources(nsId string, mciId string) (model.MciAssociatedResourceList, error)
- func GetMciHandlingCommandCount(nsId, mciId string) (map[string]int, int, error)
- func GetMciInfo(nsId string, mciId string) (*model.MciInfo, error)
- func GetMciObject(nsId string, mciId string) (model.MciInfo, bool, error)
- func GetMciPolicyObject(nsId string, mciId string) (model.MciPolicyInfo, error)
- func GetMciStatus(nsId string, mciId string) (*model.MciStatusInfo, error)
- func GetMciVmAccessInfo(nsId string, mciId string, vmId string, option string) (*model.MciVmAccessInfo, error)
- func GetMciVmCurrentStatus(nsId string, mciId string, vmId string) (*model.VmStatusInfo, error)
- func GetMciVmStatus(nsId string, mciId string, vmId string, fetchFromCSP bool) (*model.VmStatusInfo, error)
- func GetMonitoringData(nsId string, mciId string, metric string) (model.MonResultSimpleResponse, error)
- func GetNLB(nsId string, mciId string, resourceId string) (model.NLBInfo, error)
- func GetNLBHealth(nsId string, mciId string, nlbId string) (model.NLBHealthInfo, error)
- func GetProvisioningLog(specId string) (*model.ProvisioningLog, error)
- func GetSubGroup(nsId string, mciId string, subGroupId string) (model.SubGroupInfo, error)
- func GetVmCurrentPublicIp(nsId string, mciId string, vmId string) (model.VmStatusInfo, error)
- func GetVmIdNameInDetail(nsId string, mciId string, vmId string) (*model.IdNameInDetailInfo, error)
- func GetVmIp(nsId string, mciId string, vmId string) (string, string, string, error)
- func GetVmObject(nsId string, mciId string, vmId string) (model.VmInfo, error)
- func GetVmSpecId(nsId string, mciId string, vmId string) string
- func GetVmSshKey(nsId string, mciId string, vmId string) (string, string, string, error)
- func GetVmTemplate(nsId string, mciId string, algo string) (model.VmInfo, error)
- func HandleMciAction(nsId string, mciId string, action string, force bool) (string, error)
- func HandleMciVmAction(nsId string, mciId string, vmId string, action string, force bool) (string, error)
- func InspectResources(connConfig string, resourceType string) (model.InspectResource, error)
- func InspectResourcesOverview() (model.InspectResourceAllResult, error)
- func InstallBenchmarkAgentToMci(nsId string, mciId string, req *model.MciCmdReq, option string) ([]model.SshCmdResult, error)
- func InstallMonitorAgentToMci(nsId string, mciId string, mciServiceType string, req *model.MciCmdReq) (model.AgentInstallContentWrapper, error)
- func ListCommandStatusInfo(nsId, mciId, vmId string, filter *model.CommandStatusFilter) (*model.CommandStatusListResponse, error)
- func ListMciId(nsId string) ([]string, error)
- func ListMciInfo(nsId string, option string) ([]model.MciInfo, error)
- func ListMciPolicyId(nsId string) []string
- func ListMciStatus(nsId string) ([]model.MciStatusInfo, error)
- func ListMciVmInfo(nsId string, mciId string) ([]model.VmInfo, error)
- func ListNLB(nsId string, mciId string, filterKey string, filterVal string) (interface{}, error)
- func ListNLBId(nsId string, mciId string) ([]string, error)
- func ListSubGroupId(nsId string, mciId string) ([]string, error)
- func ListVmByFilter(nsId string, mciId string, filterKey string, filterVal string) ([]string, error)
- func ListVmByLabel(nsId string, mciId string, labelKey string) ([]string, error)
- func ListVmBySubGroup(nsId string, mciId string, groupId string) ([]string, error)
- func ListVmId(nsId string, mciId string) ([]string, error)
- func MciReqStructLevelValidation(sl validator.StructLevel)
- func NLBReqStructLevelValidation(sl validator.StructLevel)
- func OrchestrationController()
- func ProvisionDataDisk(nsId string, mciId string, vmId string, u *model.DataDiskVmReq) (model.VmInfo, error)
- func RecommendK8sNode(nsId string, plan model.RecommendSpecReq) ([]model.SpecInfo, error)
- func RecommendSpec(nsId string, plan model.RecommendSpecReq) ([]model.SpecInfo, error)
- func RecommendSpecOptions(nsId string) (*model.RecommendSpecRequestOptions, error)
- func RecommendVmCost(nsId string, specList *[]model.SpecInfo) ([]model.SpecInfo, error)
- func RecommendVmLatency(nsId string, specList *[]model.SpecInfo, param *[]model.ParameterKeyVal) ([]model.SpecInfo, error)
- func RecommendVmLocation(nsId string, specList *[]model.SpecInfo, param *[]model.ParameterKeyVal) ([]model.SpecInfo, error)
- func RecommendVmPerformance(nsId string, specList *[]model.SpecInfo) ([]model.SpecInfo, error)
- func RecommendVmRandom(nsId string, specList *[]model.SpecInfo) ([]model.SpecInfo, error)
- func RecordProvisioningEvent(event *model.ProvisioningEvent) error
- func RecordProvisioningEventsFromMci(nsId string, mciInfo *model.MciInfo) error
- func RegisterCspNativeResources(nsId string, connConfig string, mciId string, option string, mciFlag string) (model.RegisterResourceResult, error)
- func RegisterCspNativeResourcesAll(nsId string, mciId string, option string, mciFlag string) (model.RegisterResourceAllResult, error)
- func RemoteCommandToMci(nsId string, mciId string, subGroupId string, vmId string, ...) ([]model.SshCmdResult, error)
- func RemoveBastionNodes(nsId string, mciId string, bastionVmId string) (string, error)
- func RemoveNLBVMs(nsId string, mciId string, resourceId string, u *model.NLBAddRemoveVMReq) error
- func ReviewMciDynamicReq(reqID string, nsId string, req *model.MciDynamicReq, deployOption string) (*model.ReviewMciDynamicReqInfo, error)
- func ReviewSingleSubGroupDynamicReq(reqID string, nsId string, req *model.CreateSubGroupDynamicReq) (*model.ReviewSubGroupDynamicReqInfo, error)
- func RunAllBenchmarks(nsId string, mciId string, host string) (*model.BenchmarkInfoArray, error)
- func RunLatencyBenchmark(nsId string, mciId string, host string) (*model.BenchmarkInfoArray, error)
- func RunRemoteCommand(nsId string, mciId string, vmId string, givenUserName string, cmds []string) (map[int]string, map[int]string, error)
- func RunRemoteCommandAsync(wg *sync.WaitGroup, nsId string, mciId string, vmId string, ...)
- func RunRemoteCommandAsyncWithStatus(wg *sync.WaitGroup, nsId string, mciId string, vmId string, ...)
- func SaveProvisioningLog(provisioningLog *model.ProvisioningLog) error
- func ScaleOutMciSubGroup(nsId string, mciId string, subGroupId string, numVMsToAdd string) (*model.MciInfo, error)
- func SetBastionNodes(nsId string, mciId string, targetVmId string, bastionVmId string) (string, error)
- func SetMonitoringAgentStatusInstalled(nsId string, mciId string, vmId string) error
- func TbMciCmdReqStructLevelValidation(sl validator.StructLevel)
- func TransferFileToMci(nsId string, mciId string, subGroupId string, vmId string, fileData []byte, ...) ([]model.SshCmdResult, error)
- func TrimIP(sshAccessPoint string) (string, error)
- func UpdateCommandStatusInfo(nsId, mciId, vmId string, index int, status model.CommandExecutionStatus, ...) error
- func UpdateMciInfo(nsId string, mciInfoData model.MciInfo)
- func UpdateMciPolicyInfo(nsId string, mciPolicyInfoData model.MciPolicyInfo)
- func UpdateMonitoringAgentStatusManually(nsId string, mciId string, vmId string, targetStatus string) error
- func UpdateVmInfo(nsId string, mciId string, vmInfoData model.VmInfo)
- func UpdateVmPublicIp(nsId string, mciId string, vmInfoData model.VmInfo) error
- func UpdateVmSshKey(nsId string, mciId string, vmId string, verifiedUserName string) error
- func ValidateMciDynamicReq(reqID string, nsId string, req *model.MciDynamicReq, deployOption string) (*model.ReviewMciDynamicReqInfo, error)
- func ValidateProvisioningLogIntegrity(specId string) error
- func VerifySshUserName(nsId string, mciId string, vmId string, vmIp string, sshPort string, ...) (string, string, error)
- type CreatedResource
- type VmControlInfo
- type VmCreateInfo
- type VmGroupInfo
- type VmReqWithCreatedResources
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCommandStatusInfo ¶ added in v0.11.10
func AddCommandStatusInfo(nsId, mciId, vmId, xRequestId, commandRequested, commandExecuted string) (int, error)
AddCommandStatusInfo adds a new command status record to VM's command history
func AddNLBVMs ¶
func AddNLBVMs(nsId string, mciId string, resourceId string, u *model.NLBAddRemoveVMReq) (model.NLBInfo, error)
AddNLBVMs accepts VM addition request, adds VM to NLB, and returns an updated TB NLB object
func AnalyzeProvisioningRisk ¶ added in v0.11.3
func AnalyzeProvisioningRisk(specId string, cspImageName string) (riskLevel string, riskMessage string, err error)
AnalyzeProvisioningRisk analyzes the risk of provisioning failure based on historical data
func AnalyzeProvisioningRiskDetailed ¶ added in v0.11.3
func AnalyzeProvisioningRiskDetailed(specId string, cspImageName string) (*model.RiskAnalysis, error)
AnalyzeProvisioningRiskDetailed provides comprehensive risk analysis with separate spec and image risk assessment
func AttachDetachDataDisk ¶
func AttachDetachDataDisk(nsId string, mciId string, vmId string, command string, dataDiskId string, force bool) (model.VmInfo, error)
AttachDetachDataDisk is func to attach/detach DataDisk to/from VM
func BenchmarkAction ¶
func BenchmarkAction(nsId string, mciId string, action string, option string) (model.BenchmarkInfoArray, error)
BenchmarkAction is func to action Benchmark
func BuildAgnosticImage ¶ added in v0.11.14
func BuildAgnosticImage(nsId string, req model.BuildAgnosticImageReq) (model.BuildAgnosticImageResult, error)
BuildAgnosticImage creates an MCI, executes post commands, creates snapshots, and optionally cleans up This is a complete workflow for building agnostic (CSP-independent) custom images
func BuildLatencyOrderByClause ¶ added in v0.11.9
func BuildLatencyOrderByClause(param *[]model.ParameterKeyVal) (string, error)
BuildLatencyOrderByClause generates ORDER BY clause for latency-based sorting
func BuildLocationOrderByClause ¶ added in v0.11.9
func BuildLocationOrderByClause(param *[]model.ParameterKeyVal) (string, error)
BuildLocationOrderByClause generates ORDER BY clause for location-based sorting
func CallGetMonitoringAsync ¶
func CallGetMonitoringAsync(wg *sync.WaitGroup, nsID string, mciID string, vmID string, vmIP string, method string, metric string, cmd string, returnResult *[]model.MonResultSimple)
CallGetMonitoringAsync makes asynchronous HTTP call to CB-Dragonfly for monitoring data and appends the result to the provided result array
func CallMilkyway ¶
func CallMilkyway(wg *sync.WaitGroup, vmList []string, nsId string, mciId string, vmId string, vmIp string, action string, option string, results *model.BenchmarkInfoArray)
CallMilkyway is func to call milkyway agents
func CallMonitoringAsync ¶
func CallMonitoringAsync(wg *sync.WaitGroup, nsID string, mciID string, mciServiceType string, vmID string, givenUserName string, method string, cmd string, returnResult *[]model.SshCmdResult)
CallMonitoringAsync is func to call CB-Dragonfly monitoring framework
func CheckAllowedTransition ¶
func CheckAllowedTransition(nsId string, mciId string, vmId model.OptionalParameter, action string) error
CheckAllowedTransition is func to check status transition is acceptable
func CheckConnectivity ¶
CheckConnectivity func checks if given port is open and ready
func CheckDragonflyEndpoint ¶
func CheckDragonflyEndpoint() error
Module for checking CB-Dragonfly endpoint (call get config)
func CheckK8sClusterDynamicReq ¶ added in v0.10.0
func CheckK8sClusterDynamicReq(req *model.K8sClusterConnectionConfigCandidatesReq) (*model.CheckK8sClusterDynamicReqInfo, error)
CheckK8sClusterDynamicReq is func to check request info to create K8sCluster obeject and deploy requested Nodes in a dynamic way
func CheckMciDynamicReq ¶
func CheckMciDynamicReq(req *model.MciConnectionConfigCandidatesReq) (*model.CheckMciDynamicReqInfo, error)
CheckMciDynamicReq is func to check request info to create MCI obeject and deploy requested VMs in a dynamic way
func CheckSubGroup ¶
CheckSubGroup func is to check given subGroupId is duplicated with existing
func CleanupCorruptedProvisioningLogs ¶ added in v0.11.3
func CleanupCorruptedProvisioningLogs() error
func ClearAllCommandStatusInfo ¶ added in v0.11.10
ClearAllCommandStatusInfo deletes all command status records for a VM
func ControlMciAsync ¶
ControlMciAsync is func to control MCI async
func ControlVmAsync ¶
func ControlVmAsync(wg *sync.WaitGroup, nsId string, mciId string, vmId string, action string, results chan<- model.ControlVmResult)
ControlVmAsync is func to control VM async
func ControlVmsInParallel ¶ added in v0.11.10
ControlVmsInParallel controls VMs with hierarchical rate limiting Level 1: CSPs are processed in parallel Level 2: Within each CSP, regions are processed with semaphore (maxConcurrentRegionsPerCSP) Level 3: Within each region, VMs are processed with semaphore (maxConcurrentVMsPerRegion)
func ConvertMciInfoToMciStatusInfo ¶ added in v0.11.10
func ConvertMciInfoToMciStatusInfo(mciInfo model.MciInfo) model.MciStatusInfo
ensureVmStatusInfoComplete ensures all VMs from VmInfo are represented in MciStatus.Vm This handles cases where VM status fetch might have failed or VM is newly created ConvertMciInfoToMciStatusInfo converts MciInfo to MciStatusInfo (partial conversion for basic fields)
func ConvertVmInfoFieldsToVmStatusInfo ¶ added in v0.11.10
func ConvertVmInfoFieldsToVmStatusInfo(vmStatus *model.VmStatusInfo, vmInfo model.VmInfo)
ConvertVmInfoFieldsToVmStatusInfo converts VmInfo fields into existing VmStatusInfo VmInfo is considered the trusted source, so all relevant fields are converted
func ConvertVmInfoFieldsToVmStatusInfoList ¶ added in v0.11.10
func ConvertVmInfoFieldsToVmStatusInfoList(vmStatusList []model.VmStatusInfo, vmInfoList []model.VmInfo)
ConvertVmInfoFieldsToVmStatusInfoList converts VmInfo fields into corresponding VmStatusInfo list
func ConvertVmInfoListToVmStatusInfoList ¶ added in v0.11.10
func ConvertVmInfoListToVmStatusInfoList(vmInfoList []model.VmInfo) []model.VmStatusInfo
ConvertVmInfoListToVmStatusInfoList converts a slice of VmInfo to VmStatusInfo for MCI status operations
func ConvertVmInfoToVmStatusInfo ¶ added in v0.11.10
func ConvertVmInfoToVmStatusInfo(vmInfo model.VmInfo) model.VmStatusInfo
ConvertVmInfoToVmStatusInfo converts VmInfo to VmStatusInfo for MCI status operations
func CoreGetBenchmark ¶
func CoreGetBenchmark(nsId string, mciId string, action string, host string) (*model.BenchmarkInfoArray, error)
CoreGetBenchmark is func to get Benchmark
func CreateK8sClusterDynamic ¶ added in v0.10.0
func CreateK8sClusterDynamic(reqID string, nsId string, dReq *model.K8sClusterDynamicReq, deployOption string) (*model.K8sClusterInfo, error)
CreateK8sClusterDynamic is func to create K8sCluster obeject and deploy requested K8sCluster and NodeGroup in a dynamic way
func CreateK8sNodeGroupDynamic ¶ added in v0.10.2
func CreateK8sNodeGroupDynamic(reqID string, nsId string, k8sClusterId string, dReq *model.K8sNodeGroupDynamicReq) (*model.K8sClusterInfo, error)
CreateK8sNodeGroupDynamic is func to create K8sNodeGroup obeject and deploy requested K8sNodeGroup in a dynamic way
func CreateMcSwNlb ¶
func CreateMcSwNlb(nsId string, mciId string, req *model.NLBReq, option string) (model.McNlbInfo, error)
CreateMcSwNlb func create a special purpose MCI for NLB and depoly and setting SW NLB
func CreateMci ¶
func CreateMci(nsId string, req *model.MciReq, option string, isReqFromDynamic bool) (*model.MciInfo, error)
CreateMci is func to create MCI object and deploy requested VMs (register CSP native VM with option=register)
func CreateMciDynamic ¶
func CreateMciDynamic(reqID string, nsId string, req *model.MciDynamicReq, deployOption string) (*model.MciInfo, error)
CreateMciDynamic is func to create MCI obeject and deploy requested VMs in a dynamic way
func CreateMciGroupVm ¶
func CreateMciGroupVm(nsId string, mciId string, vmRequest *model.CreateSubGroupReq, newSubGroup bool) (*model.MciInfo, error)
CreateMciGroupVm is func to create MCI groupVM
func CreateMciPolicy ¶
func CreateMciPolicy(nsId string, mciId string, u *model.MciPolicyReq) (model.MciPolicyInfo, error)
CreateMciPolicy create model.MciPolicyInfo object in DB according to user's requirements.
func CreateMciSnapshot ¶ added in v0.11.14
func CreateMciSnapshot(nsId string, mciId string, snapshotReq model.SnapshotReq) (model.MciSnapshotResult, error)
CreateMciSnapshot creates snapshots for the first running VM in each subgroup of an MCI in parallel Snapshots are created with provider-specific semaphores to safely limit concurrent requests per CSP
func CreateMciSubGroupDynamic ¶ added in v0.11.9
func CreateMciSubGroupDynamic(nsId string, mciId string, req *model.CreateSubGroupDynamicReq) (*model.MciInfo, error)
CreateMciSubGroupDynamic is func to create requested VM in a dynamic way and add it to MCI
func CreateSubGroupReqStructLevelValidation ¶ added in v0.11.9
func CreateSubGroupReqStructLevelValidation(sl validator.StructLevel)
CreateSubGroupReqStructLevelValidation is func to validate fields in model.CreateSubGroupReqStruct
func CreateSystemMciDynamic ¶
CreateSystemMciDynamic is func to create MCI obeject and deploy requested VMs in a dynamic way
func CreateVm ¶
func CreateVm(wg *sync.WaitGroup, nsId string, mciId string, vmInfoData *model.VmInfo, option string) error
CreateVm is func to create VM (option = "register" for register existing VM)
func CreateVmObject ¶ added in v0.9.19
CreateVmObject is func to add VM to MCI
func CreateVmSnapshot ¶
func CreateVmSnapshot(nsId string, mciId string, vmId string, snapshotReq model.SnapshotReq) (model.ImageInfo, error)
CreateVmSnapshot is func to create VM snapshot
func CreateVmsInParallel ¶ added in v0.11.10
CreateVmsInParallel creates VMs with hierarchical rate limiting Level 1: CSPs are processed in parallel Level 2: Within each CSP, regions are processed with semaphore (maxConcurrentRegionsPerCSP) Level 3: Within each region, VMs are processed with semaphore (maxConcurrentVMsPerRegion)
func DFMonAgentInstallReqStructLevelValidation ¶
func DFMonAgentInstallReqStructLevelValidation(sl validator.StructLevel)
func DelAllMciPolicy ¶
DelAllMciPolicy deletes all model.MciPolicyInfo objects.
func DelMciPolicy ¶
DelMciPolicy deletes model.MciPolicyInfo object by mciId.
func DeleteCommandStatusInfo ¶ added in v0.11.10
DeleteCommandStatusInfo deletes a specific command status record
func DeleteCommandStatusInfoByCriteria ¶ added in v0.11.10
func DeleteCommandStatusInfoByCriteria(nsId, mciId, vmId string, filter *model.CommandStatusFilter) (int, error)
DeleteCommandStatusInfoByCriteria deletes multiple command status records by criteria
func DeleteProvisioningLog ¶ added in v0.11.3
DeleteProvisioningLog deletes provisioning log for a specific spec ID
func Difference_dataDisks ¶
func Difference_dataDisks(a, b []model.ResourceOnTumblebugInfo) []model.ResourceOnTumblebugInfo
func FetchVmStatus ¶
FetchVmStatus is func to fetch VM status (call to CSPs)
func FindTbVmByCspId ¶
func GetAllMciPolicyObject ¶
func GetAllMciPolicyObject(nsId string) ([]model.MciPolicyInfo, error)
GetAllMciPolicyObject returns all model.MciPolicyInfo objects.
func GetAvailableDataDisks ¶
func GetBastionNodes ¶
GetBastionNodes func retrieves bastion nodes for a given VM
func GetCommandStatusInfo ¶ added in v0.11.10
func GetCommandStatusInfo(nsId, mciId, vmId string, index int) (*model.CommandStatusInfo, error)
GetCommandStatusInfo retrieves a specific command status record
func GetHandlingCommandCount ¶ added in v0.11.10
GetHandlingCommandCount returns the count of currently handling commands for a VM This function is optimized for frequent polling and avoids unnecessary processing
func GetLatency ¶
GetLatency func get latency between given two regions
func GetMcNlbAccess ¶
func GetMcNlbAccess(nsId string, mciId string) (*model.MciAccessInfo, error)
GetMcNlbAccess returns the requested TB G-NLB access info (currenly MCI)
func GetMciAccessInfo ¶
GetMciAccessInfo is func to retrieve MCI Access information
func GetMciAssociatedResources ¶ added in v0.11.2
func GetMciAssociatedResources(nsId string, mciId string) (model.MciAssociatedResourceList, error)
GetMciAssociatedResources returns a list of associated resource IDs for given MCI info
func GetMciHandlingCommandCount ¶ added in v0.11.10
GetMciHandlingCommandCount returns the count of currently handling commands across all VMs in an MCI This function is optimized for MCI-level monitoring
func GetMciInfo ¶
GetMciInfo is func to return MCI information with the current status update
func GetMciObject ¶
GetMciObject is func to retrieve MCI object from database (no current status update)
func GetMciPolicyObject ¶
func GetMciPolicyObject(nsId string, mciId string) (model.MciPolicyInfo, error)
GetMciPolicyObject returns model.MciPolicyInfo object.
func GetMciStatus ¶
func GetMciStatus(nsId string, mciId string) (*model.MciStatusInfo, error)
GetMciStatus is func to Get Mci Status
func GetMciVmAccessInfo ¶ added in v0.10.4
func GetMciVmAccessInfo(nsId string, mciId string, vmId string, option string) (*model.MciVmAccessInfo, error)
GetMciVmAccessInfo is func to retrieve MCI Access information
func GetMciVmCurrentStatus ¶ added in v0.11.10
GetMciVmCurrentStatus is func to Get MciVm Current Status from CSP API (real-time)
func GetMciVmStatus ¶
func GetMciVmStatus(nsId string, mciId string, vmId string, fetchFromCSP bool) (*model.VmStatusInfo, error)
GetMciVmStatus is func to Get MciVm Status with option to control CSP API fetch
func GetMonitoringData ¶
func GetMonitoringData(nsId string, mciId string, metric string) (model.MonResultSimpleResponse, error)
GetMonitoringData retrieves monitoring data from CB-Dragonfly for all VMs in an MCI Returns a consolidated response with metrics for each VM
func GetNLBHealth ¶
GetNLBHealth queries the health status of NLB to CB-Spider, and returns it to user
func GetProvisioningLog ¶ added in v0.11.3
func GetProvisioningLog(specId string) (*model.ProvisioningLog, error)
GetProvisioningLog retrieves provisioning log for a specific spec ID
func GetSubGroup ¶ added in v0.9.10
GetSubGroup is func to return list of SubGroups in a given MCI
func GetVmCurrentPublicIp ¶
GetVmCurrentPublicIp is func to get VM public IP
func GetVmIdNameInDetail ¶
GetVmIdNameInDetail is func to get ID and Name details
func GetVmObject ¶
GetVmObject is func to get VM object
func GetVmSpecId ¶
GetVmSpecId is func to get VM SpecId
func GetVmSshKey ¶
GetVmSshKey is func to get VM SShKey. Returns username, verifiedUsername, privateKey
func GetVmTemplate ¶
GetVmTemplate is func to get VM template
func HandleMciAction ¶
HandleMciAction is func to handle actions to MCI
func HandleMciVmAction ¶
func HandleMciVmAction(nsId string, mciId string, vmId string, action string, force bool) (string, error)
HandleMciVmAction is func to Get MciVm Action
func InspectResources ¶
func InspectResources(connConfig string, resourceType string) (model.InspectResource, error)
InspectResources returns the state list of TB Resource objects of given connConfig and resourceType
func InspectResourcesOverview ¶
func InspectResourcesOverview() (model.InspectResourceAllResult, error)
InspectResourcesOverview func is to check all resources in CB-TB and CSPs
func InstallBenchmarkAgentToMci ¶
func InstallBenchmarkAgentToMci(nsId string, mciId string, req *model.MciCmdReq, option string) ([]model.SshCmdResult, error)
InstallBenchmarkAgentToMci is func to install milkyway agents in MCI
func ListCommandStatusInfo ¶ added in v0.11.10
func ListCommandStatusInfo(nsId, mciId, vmId string, filter *model.CommandStatusFilter) (*model.CommandStatusListResponse, error)
ListCommandStatusInfo retrieves command status records with filtering
func ListMciInfo ¶
ListMciInfo is func to get all MCI objects
func ListMciPolicyId ¶
ListMciPolicyId returns a list of Ids for all model.MciPolicyInfo objects .
func ListMciStatus ¶
func ListMciStatus(nsId string) ([]model.MciStatusInfo, error)
ListMciStatus is func to get MCI status all
func ListMciVmInfo ¶ added in v0.11.10
ListMciVmInfo is func to Get all VM Info objects in MCI
func ListSubGroupId ¶
ListSubGroupId is func to return list of SubGroups in a given MCI
func ListVmByFilter ¶
func ListVmByFilter(nsId string, mciId string, filterKey string, filterVal string) ([]string, error)
ListVmByFilter is func to get list VMs in a MCI by a filter consist of Key and Value
func ListVmByLabel ¶
ListVmByLabel is a function to list VM IDs by label
func ListVmBySubGroup ¶
ListVmBySubGroup is func to get VM list with a SubGroup label in a specified MCI
func MciReqStructLevelValidation ¶ added in v0.11.9
func MciReqStructLevelValidation(sl validator.StructLevel)
MciReqStructLevelValidation is func to validate fields in MciReqStruct
func NLBReqStructLevelValidation ¶ added in v0.11.9
func NLBReqStructLevelValidation(sl validator.StructLevel)
NLBReqStructLevelValidation is a function to validate 'model.NLBReq' object.
func OrchestrationController ¶
func OrchestrationController()
OrchestrationController is responsible for executing MCI automation policy. OrchestrationController will be periodically involked by a time.NewTicker in main.go.
func ProvisionDataDisk ¶
func ProvisionDataDisk(nsId string, mciId string, vmId string, u *model.DataDiskVmReq) (model.VmInfo, error)
ProvisionDataDisk is func to provision DataDisk to VM (create and attach to VM)
func RecommendK8sNode ¶ added in v0.10.0
RecommendK8sNode is func to recommend a node for K8sCluster
func RecommendSpec ¶ added in v0.11.4
RecommendSpec is func to recommend a VM
func RecommendSpecOptions ¶ added in v0.11.9
func RecommendSpecOptions(nsId string) (*model.RecommendSpecRequestOptions, error)
RecommendSpecOptions returns available options for RecommendSpec API
func RecommendVmCost ¶
RecommendVmCost func prioritize specs based on given Cost
func RecommendVmLatency ¶
func RecommendVmLatency(nsId string, specList *[]model.SpecInfo, param *[]model.ParameterKeyVal) ([]model.SpecInfo, error)
RecommendVmLatency func prioritize specs by latency based on given MCI (fair)
func RecommendVmLocation ¶
func RecommendVmLocation(nsId string, specList *[]model.SpecInfo, param *[]model.ParameterKeyVal) ([]model.SpecInfo, error)
RecommendVmLocation func prioritize specs based on given location
func RecommendVmPerformance ¶
RecommendVmPerformance func prioritize specs based on given Performance condition
func RecommendVmRandom ¶
RecommendVmRandom func prioritize specs randomly
func RecordProvisioningEvent ¶ added in v0.11.3
func RecordProvisioningEvent(event *model.ProvisioningEvent) error
RecordProvisioningEvent records a provisioning event (success or failure) to the log
func RecordProvisioningEventsFromMci ¶ added in v0.11.3
RecordProvisioningEventsFromMci analyzes MCI creation result and records provisioning events
func RegisterCspNativeResources ¶
func RegisterCspNativeResources(nsId string, connConfig string, mciId string, option string, mciFlag string) (model.RegisterResourceResult, error)
RegisterCspNativeResources func registers all CSP-native resources into CB-TB
func RegisterCspNativeResourcesAll ¶
func RegisterCspNativeResourcesAll(nsId string, mciId string, option string, mciFlag string) (model.RegisterResourceAllResult, error)
RegisterCspNativeResourcesAll func registers all CSP-native resources into CB-TB
func RemoteCommandToMci ¶
func RemoteCommandToMci(nsId string, mciId string, subGroupId string, vmId string, labelSelector string, req *model.MciCmdReq, xRequestId string) ([]model.SshCmdResult, error)
RemoteCommandToMci is func to command to all VMs in MCI by SSH
func RemoveBastionNodes ¶
RemoveBastionNodes func removes existing bastion nodes info
func RemoveNLBVMs ¶
RemoveNLBVMs accepts VM removal request, removes VMs from NLB, and returns an error if occurs.
func ReviewMciDynamicReq ¶ added in v0.11.3
func ReviewMciDynamicReq(reqID string, nsId string, req *model.MciDynamicReq, deployOption string) (*model.ReviewMciDynamicReqInfo, error)
ReviewMciDynamicReq is func to review and validate MCI dynamic request comprehensively
func ReviewSingleSubGroupDynamicReq ¶ added in v0.11.9
func ReviewSingleSubGroupDynamicReq(reqID string, nsId string, req *model.CreateSubGroupDynamicReq) (*model.ReviewSubGroupDynamicReqInfo, error)
ReviewSingleSubGroupDynamicReq reviews and validates a single VM dynamic request and returns comprehensive review information
func RunAllBenchmarks ¶
RunAllBenchmarks is func to get all Benchmarks
func RunLatencyBenchmark ¶
RunLatencyBenchmark is func to get MCI benchmark for network latency
func RunRemoteCommand ¶
func RunRemoteCommand(nsId string, mciId string, vmId string, givenUserName string, cmds []string) (map[int]string, map[int]string, error)
RunRemoteCommand is func to execute a SSH command to a VM (sync call)
func RunRemoteCommandAsync ¶
func RunRemoteCommandAsync(wg *sync.WaitGroup, nsId string, mciId string, vmId string, givenUserName string, cmd []string, returnResult *[]model.SshCmdResult)
RunRemoteCommandAsync is func to execute a SSH command to a VM (async call)
func RunRemoteCommandAsyncWithStatus ¶ added in v0.11.10
func RunRemoteCommandAsyncWithStatus(wg *sync.WaitGroup, nsId string, mciId string, vmId string, givenUserName string, cmd []string, cmdIndex int, returnResult *[]model.SshCmdResult)
RunRemoteCommandAsyncWithStatus is func to execute a SSH command to a VM (async call) with command status tracking
func SaveProvisioningLog ¶ added in v0.11.3
func SaveProvisioningLog(provisioningLog *model.ProvisioningLog) error
SaveProvisioningLog saves or updates provisioning log for a specific spec ID
func ScaleOutMciSubGroup ¶
func ScaleOutMciSubGroup(nsId string, mciId string, subGroupId string, numVMsToAdd string) (*model.MciInfo, error)
ScaleOutMciSubGroup is func to create MCI groupVM
func SetBastionNodes ¶
func SetBastionNodes(nsId string, mciId string, targetVmId string, bastionVmId string) (string, error)
SetBastionNodes func sets bastion nodes
func SetMonitoringAgentStatusInstalled ¶
SetMonitoringAgentStatusInstalled is func to Set Monitoring Agent Status Installed
func TbMciCmdReqStructLevelValidation ¶
func TbMciCmdReqStructLevelValidation(sl validator.StructLevel)
TbMciCmdReqStructLevelValidation is func to validate fields in model.MciCmdReq
func TransferFileToMci ¶ added in v0.9.12
func TransferFileToMci(nsId string, mciId string, subGroupId string, vmId string, fileData []byte, fileName string, targetPath string) ([]model.SshCmdResult, error)
TransferFileToMci is a function to transfer a file to all VMs in MCI by SSH through bastion hosts
func UpdateCommandStatusInfo ¶ added in v0.11.10
func UpdateCommandStatusInfo(nsId, mciId, vmId string, index int, status model.CommandExecutionStatus, resultSummary, errorMessage, stdout, stderr string) error
UpdateCommandStatusInfo updates an existing command status record
func UpdateMciInfo ¶
UpdateMciInfo is func to update MCI Info (without VM info in MCI)
func UpdateMciPolicyInfo ¶
func UpdateMciPolicyInfo(nsId string, mciPolicyInfoData model.MciPolicyInfo)
UpdateMciPolicyInfo updates model.MciPolicyInfo object in DB.
func UpdateMonitoringAgentStatusManually ¶
func UpdateMonitoringAgentStatusManually(nsId string, mciId string, vmId string, targetStatus string) error
UpdateMonitoringAgentStatusManually is func to Update Monitoring Agent Installation Status Manually
func UpdateVmInfo ¶
UpdateVmInfo is func to update VM Info
func UpdateVmPublicIp ¶
UpdateVmPublicIp is func to update VM public IP
func UpdateVmSshKey ¶
UpdateVmSshKey is func to update VM SShKey
func ValidateMciDynamicReq ¶ added in v0.11.3
func ValidateMciDynamicReq(reqID string, nsId string, req *model.MciDynamicReq, deployOption string) (*model.ReviewMciDynamicReqInfo, error)
ValidateMciDynamicReq is func to validate MCI dynamic request before actual provisioning
func ValidateProvisioningLogIntegrity ¶ added in v0.11.3
ValidateProvisioningLogIntegrity checks and repairs provisioning log data integrity
Types ¶
type CreatedResource ¶ added in v0.11.2
type CreatedResource struct {
Type string `json:"type"` // "vnet", "sshkey", "securitygroup"
Id string `json:"id"` // Resource ID
}
CreatedResource represents a resource created during dynamic MCI provisioning
type VmControlInfo ¶ added in v0.11.10
VmControlInfo represents VM control information with grouping details
type VmCreateInfo ¶ added in v0.11.10
VmCreateInfo represents VM creation information with grouping details
type VmGroupInfo ¶ added in v0.11.10
VmGroupInfo represents VM grouping information for rate limiting
type VmReqWithCreatedResources ¶ added in v0.11.2
type VmReqWithCreatedResources struct {
VmReq *model.CreateSubGroupReq `json:"vmReq"`
CreatedResources []CreatedResource `json:"createdResources"`
}
VmReqWithCreatedResources contains VM request and list of created resources for rollback