Documentation
¶
Index ¶
- Constants
- func AddVmToMcis(wg *sync.WaitGroup, nsId string, mcisId string, vmInfoData *TbVmInfo) error
- func CallGetMonitoringAsync(wg *sync.WaitGroup, nsID string, mcisID string, vmID string, vmIP string, ...)
- func CallMilkyway(wg *sync.WaitGroup, vmList []string, nsId string, mcisId string, vmId string, ...)
- func CallMonitoringAsync(wg *sync.WaitGroup, nsID string, mcisID string, vmID string, ...)
- func CheckAllowedTransition(nsId string, mcisId string, action string) error
- func CheckConnectivity(host string, port string) error
- func CheckDragonflyEndpoint() error
- func CheckMcis(nsId string, mcisId string) (bool, error)
- func CheckMcisPolicy(nsId string, mcisId string) (bool, error)
- func CheckVm(nsId string, mcisId string, vmId string) (bool, error)
- func Close(client scp.Client)
- func Connect(sshInfo SSHInfo) (scp.Client, error)
- func ConnectKeyPath(sshKeyPathInfo SSHKeyPathInfo) (scp.Client, error)
- func ControlMcis(nsId string, mcisId string, action string) error
- func ControlMcisAsync(nsId string, mcisId string, action string) error
- func ControlVm(nsId string, mcisId string, vmId string, action string) error
- func ControlVmAsync(wg *sync.WaitGroup, nsId string, mcisId string, vmId string, action string, ...) error
- func Copy(client scp.Client, sourcePath string, remotePath string) error
- func CoreDelAllMcis(nsId string, option string) (string, error)
- func CoreGetMcisVmAction(nsId string, mcisId string, vmId string, action string) (string, error)
- func CorePostCmdMcisVm(nsId string, mcisId string, vmId string, req *McisCmdReq) (string, error)
- func CreateVm(nsId string, mcisId string, vmInfoData *TbVmInfo) error
- func DelAllMcisPolicy(nsId string) (string, error)
- func DelMcis(nsId string, mcisId string, option string) error
- func DelMcisPolicy(nsId string, mcisId string) error
- func DelMcisVm(nsId string, mcisId string, vmId string, option string) error
- func GetVmIp(nsId string, mcisId string, vmId string) (string, string)
- func GetVmListByLabel(nsId string, mcisId string, label string) ([]string, error)
- func GetVmSpecId(nsId string, mcisId string, vmId string) string
- func GetVmSshKey(nsId string, mcisId string, vmId string) (string, string, string)
- func GetVmStatusAsync(wg *sync.WaitGroup, nsId string, mcisId string, vmId string, ...) error
- func HandleMcisAction(nsId string, mcisId string, action string) (string, error)
- func InspectVMs(connConfig string) (interface{}, error)
- func ListMcisId(nsId string) ([]string, error)
- func ListMcisPolicyId(nsId string) []string
- func ListVmGroupId(nsId string, mcisId string) ([]string, error)
- func ListVmId(nsId string, mcisId string) ([]string, error)
- func OrchestrationController()
- func RecommendVm(nsId string, plan DeploymentPlan) ([]mcir.TbSpecInfo, error)
- func RecommendVmLocation(nsId string, specList *[]mcir.TbSpecInfo, param *[]ParameterKeyVal) ([]mcir.TbSpecInfo, error)
- func RunCommand(client scp.Client, cmd string) (string, error)
- func RunSSH(vmIP string, sshPort string, userName string, privateKey string, cmd string) (*string, error)
- func RunSSHAsync(wg *sync.WaitGroup, vmID string, vmIP string, sshPort string, userName string, ...)
- func SSHCopy(sshInfo SSHInfo, sourcePath string, remotePath string) error
- func SSHCopyByKeyPath(sshInfo SSHKeyPathInfo, sourcePath string, remotePath string) error
- func SSHRun(sshInfo SSHInfo, cmd string) (string, error)
- func SSHRunByKeyPath(sshInfo SSHKeyPathInfo, cmd string) (string, error)
- func TrimIP(sshAccessPoint string) (string, error)
- func UpdateMcisInfo(nsId string, mcisInfoData TbMcisInfo)
- func UpdateMcisPolicyInfo(nsId string, mcisPolicyInfoData McisPolicyInfo)
- func UpdateVmInfo(nsId string, mcisId string, vmInfoData TbVmInfo)
- func UpdateVmPublicIp(nsId string, mcisId string, vmInfoData TbVmInfo) error
- func UpdateVmSshKey(nsId string, mcisId string, vmId string, verifiedUserName string) error
- func VerifySshUserName(nsId string, mcisId string, vmId string, vmIp string, sshPort string, ...) (string, string, error)
- type AgentInstallContent
- type AgentInstallContentWrapper
- type AutoAction
- type AutoCondition
- type BenchmarkInfo
- type BenchmarkInfoArray
- func BenchmarkAction(nsId string, mcisId string, action string, option string) (BenchmarkInfoArray, error)
- func CoreGetAllBenchmark(nsId string, mcisId string, host string) (*BenchmarkInfoArray, error)
- func CoreGetBenchmark(nsId string, mcisId string, action string, host string) (*BenchmarkInfoArray, error)
- type BenchmarkReq
- type ControlVmResult
- type ControlVmResultWrapper
- type DeploymentPlan
- type FilterCondition
- type FilterInfo
- type GeoLocation
- type McisCmdReq
- type McisPolicyInfo
- type McisRecommendReq
- type McisStatusInfo
- type MonAgentInstallReq
- type MonResultSimple
- type MonResultSimpleResponse
- type MultihostBenchmarkReq
- type Operation
- type ParameterKeyVal
- type Policy
- type PriorityCondition
- type PriorityInfo
- type RegionInfo
- type SSHInfo
- type SSHKeyPathInfo
- type SpecBenchmarkInfo
- type SpiderAllList
- type SpiderAllListWrapper
- type SpiderNameIdSystemId
- type SpiderVMInfo
- type SpiderVMReqInfoWrapper
- type SshCmdResult
- type TbInspectResourcesResponse
- type TbMcisInfo
- func CoreGetAllMcis(nsId string, option string) ([]TbMcisInfo, error)
- func CorePostMcisGroupVm(nsId string, mcisId string, vmReq *TbVmReq) (*TbMcisInfo, error)
- func CreateMcis(nsId string, req *TbMcisReq) (*TbMcisInfo, error)
- func CreateMcisGroupVm(nsId string, mcisId string, vmRequest *TbVmReq) (*TbMcisInfo, error)
- func GetMcisInfo(nsId string, mcisId string) (*TbMcisInfo, error)
- func GetMcisObject(nsId string, mcisId string) (TbMcisInfo, error)
- type TbMcisReq
- type TbVmGroupInfo
- type TbVmInfo
- func CoreGetMcisVmInfo(nsId string, mcisId string, vmId string) (*TbVmInfo, error)
- func CorePostMcisVm(nsId string, mcisId string, vmInfoData *TbVmInfo) (*TbVmInfo, error)
- func GetVmObject(nsId string, mcisId string, vmId string) (TbVmInfo, error)
- func GetVmTemplate(nsId string, mcisId string, algo string) (TbVmInfo, error)
- type TbVmPriority
- type TbVmRecommendInfo
- type TbVmRecommendReq
- type TbVmReq
- type TbVmStatusInfo
Constants ¶
const ( // AutoStatusReady is const for "Ready" status. AutoStatusReady string = "Ready" // AutoStatusChecking is const for "Checking" status. AutoStatusChecking string = "Checking" // AutoStatusDetected is const for "Detected" status. AutoStatusDetected string = "Detected" // AutoStatusOperating is const for "Operating" status. AutoStatusOperating string = "Operating" // AutoStatusStabilizing is const for "Stabilizing" status. AutoStatusStabilizing string = "Stabilizing" // AutoStatusTimeout is const for "Timeout" status. AutoStatusTimeout string = "Timeout" // AutoStatusError is const for "Failed" status. AutoStatusError string = "Failed" // AutoStatusSuspended is const for "Suspended" status. AutoStatusSuspended string = "Suspended" )
Status for mcis automation
const ( // AutoActionScaleOut is const for "ScaleOut" action. AutoActionScaleOut string = "ScaleOut" // AutoActionScaleIn is const for "ScaleIn" action. AutoActionScaleIn string = "ScaleIn" )
Action for mcis automation
const ActionComplete string = "None"
const ActionComplete
const ActionCreate string = "Create"
const ActionCreate
const ActionReboot string = "Reboot"
const ActionReboot
const ActionResume string = "Resume"
const ActionResume
const ActionSuspend string = "Suspend"
const ActionSuspend
const ActionTerminate string = "Terminate"
const ActionTerminate
const StatusComplete string = "None"
const StatusComplete
const StatusCreating string = "Creating"
const StatusCreating
const StatusFailed string = "Failed"
const StatusFailed
const StatusRebooting string = "Rebooting"
const StatusRebooting
const StatusResuming string = "Resuming"
const StatusResuming
const StatusRunning string = "Running"
const StatusRunning
const StatusSuspended string = "Suspended"
const StatusSuspended
const StatusSuspending string = "Suspending"
const StatusSuspending
const StatusTerminated string = "Terminated"
const StatusTerminated
const StatusTerminating string = "Terminating"
const StatusTerminating
const StatusUndefined string = "Undefined"
const StatusUndefined
Variables ¶
This section is empty.
Functions ¶
func AddVmToMcis ¶
func CallGetMonitoringAsync ¶
func CallMilkyway ¶
func CallMonitoringAsync ¶
func CheckAllowedTransition ¶
func CheckConnectivity ¶ added in v0.3.5
CheckConnectivity func checks if given port is open and ready. For instance, ready for ssh port can be checkek.
func CheckDragonflyEndpoint ¶
func CheckDragonflyEndpoint() error
Module for checking CB-Dragonfly endpoint (call get config)
func CheckMcisPolicy ¶ added in v0.3.1
func ConnectKeyPath ¶
func ConnectKeyPath(sshKeyPathInfo SSHKeyPathInfo) (scp.Client, error)
func ControlVmAsync ¶
func CoreGetMcisVmAction ¶
func CorePostCmdMcisVm ¶
func DelAllMcisPolicy ¶ added in v0.2.8
DelAllMcisPolicy deletes all McisPolicyInfo objects.
func DelMcisPolicy ¶ added in v0.2.8
DelMcisPolicy deletes McisPolicyInfo object by mcisId.
func GetVmListByLabel ¶ added in v0.2.8
func GetVmSshKey ¶
func GetVmStatusAsync ¶ added in v0.3.5
func HandleMcisAction ¶ added in v0.3.8
func InspectVMs ¶ added in v0.3.6
InspectVMs returns the state list of TB VM objects of given connConfig
func ListMcisId ¶
func ListMcisPolicyId ¶ added in v0.2.8
ListMcisPolicyId returns a list of Ids for all McisPolicyInfo objects .
func ListVmGroupId ¶ added in v0.3.3
func ListVmGroupId returns list of VmGroups in a given MCIS.
func OrchestrationController ¶ added in v0.2.8
func OrchestrationController()
OrchestrationController is responsible for executing MCIS automation policy. OrchestrationController will be periodically involked by a time.NewTicker in main.go.
func RecommendVm ¶ added in v0.3.7
func RecommendVm(nsId string, plan DeploymentPlan) ([]mcir.TbSpecInfo, error)
// Info manage for MCIS recommendation
func RecommendVmLocation ¶ added in v0.3.7
func RecommendVmLocation(nsId string, specList *[]mcir.TbSpecInfo, param *[]ParameterKeyVal) ([]mcir.TbSpecInfo, error)
RecommendVmLocation func prioritize specs based on given location
func RunCommand ¶
func RunSSHAsync ¶
func SSHCopyByKeyPath ¶
func SSHCopyByKeyPath(sshInfo SSHKeyPathInfo, sourcePath string, remotePath string) error
func SSHRunByKeyPath ¶
func SSHRunByKeyPath(sshInfo SSHKeyPathInfo, cmd string) (string, error)
func UpdateMcisInfo ¶
func UpdateMcisInfo(nsId string, mcisInfoData TbMcisInfo)
UpdateMcisInfo func Update MCIS Info (without VM info in MCIS)
func UpdateMcisPolicyInfo ¶ added in v0.2.8
func UpdateMcisPolicyInfo(nsId string, mcisPolicyInfoData McisPolicyInfo)
UpdateMcisPolicyInfo updates McisPolicyInfo object in DB.
func UpdateVmInfo ¶
func UpdateVmPublicIp ¶
func UpdateVmSshKey ¶ added in v0.3.4
func UpdateVmInfo(nsId string, mcisId string, vmInfoData TbVmInfo)
Types ¶
type AgentInstallContent ¶
type AgentInstallContent struct { McisId string `json:"mcisId"` VmId string `json:"vmId"` VmIp string `json:"vmIp"` Result string `json:"result"` }
AgentInstallContent ...
type AgentInstallContentWrapper ¶
type AgentInstallContentWrapper struct {
Result_array []AgentInstallContent `json:"result_array"`
}
AgentInstallContentWrapper ...
func InstallAgentToMcis ¶
func InstallAgentToMcis(nsId string, mcisId string, req *McisCmdReq) (AgentInstallContentWrapper, error)
func InstallMonitorAgentToMcis ¶
func InstallMonitorAgentToMcis(nsId string, mcisId string, req *McisCmdReq) (AgentInstallContentWrapper, error)
type AutoAction ¶ added in v0.2.8
type AutoAction struct { ActionType string `json:"actionType"` Vm TbVmInfo `json:"vm"` PostCommand McisCmdReq `json:"postCommand"` PlacementAlgo string `json:"placementAlgo"` }
AutoAction is struct for MCIS auto-control action.
type AutoCondition ¶ added in v0.2.8
type AutoCondition struct { Metric string `json:"metric"` Operator string `json:"operator"` // <, <=, >, >=, ... Operand string `json:"operand"` // 10, 70, 80, 98, ... EvaluationPeriod string `json:"evaluationPeriod"` // evaluationPeriod EvaluationValue []string `json:"evaluationValue"` }
AutoCondition is struct for MCIS auto-control condition.
type BenchmarkInfo ¶
type BenchmarkInfoArray ¶
type BenchmarkInfoArray struct {
ResultArray []BenchmarkInfo `json:"resultarray"`
}
func BenchmarkAction ¶
func CoreGetAllBenchmark ¶
func CoreGetAllBenchmark(nsId string, mcisId string, host string) (*BenchmarkInfoArray, error)
func CoreGetBenchmark ¶
type BenchmarkReq ¶
type ControlVmResult ¶
type ControlVmResultWrapper ¶
type ControlVmResultWrapper struct {
ResultArray []ControlVmResult `json:"resultarray"`
}
type DeploymentPlan ¶ added in v0.3.7
type DeploymentPlan struct { Filter FilterInfo `json:"filter"` Priority PriorityInfo `json:"priority"` Limit string `json:"limit" example:"5" enums:"1,2,...,30,..."` }
DeploymentPlan is struct for .
type FilterCondition ¶ added in v0.3.7
type FilterCondition struct { Metric string `json:"metric" example:"num_vCPU" enums:"num_vCPU,mem_GiB,Cost_per_hour"` Condition []Operation `json:"condition"` }
FilterCondition is struct for .
type FilterInfo ¶ added in v0.3.7
type FilterInfo struct {
Policy []FilterCondition `json:"policy"`
}
FilterInfo is struct for .
type GeoLocation ¶
type GeoLocation struct { Latitude string `json:"latitude"` Longitude string `json:"longitude"` BriefAddr string `json:"briefAddr"` CloudType string `json:"cloudType"` NativeRegion string `json:"nativeRegion"` }
func GetCloudLocation ¶
func GetCloudLocation(cloudType string, nativeRegion string) GeoLocation
GetCloudLocation. (need error handling)
type McisCmdReq ¶
type McisCmdReq struct { UserName string `json:"userName" example:"cb-user" default:""` Command string `json:"command" example:"sudo apt-get install ..." default:""` }
McisCmdReq is remote command struct
type McisPolicyInfo ¶ added in v0.2.8
type McisPolicyInfo struct { Name string `json:"Name"` //MCIS Name (for request) Id string `json:"Id"` //MCIS Id (generated ID by the Name) Policy []Policy `json:"policy"` ActionLog string `json:"actionLog"` Description string `json:"description"` }
McisPolicyInfo is struct for MCIS auto-control Policy object.
func CreateMcisPolicy ¶ added in v0.2.8
func CreateMcisPolicy(nsId string, mcisId string, u *McisPolicyInfo) (McisPolicyInfo, error)
CreateMcisPolicy create McisPolicyInfo object in DB according to user's requirements.
func GetAllMcisPolicyObject ¶ added in v0.2.8
func GetAllMcisPolicyObject(nsId string) ([]McisPolicyInfo, error)
GetAllMcisPolicyObject returns all McisPolicyInfo objects.
func GetMcisPolicyObject ¶ added in v0.2.8
func GetMcisPolicyObject(nsId string, mcisId string) (McisPolicyInfo, error)
GetMcisPolicyObject returns McisPolicyInfo object.
type McisRecommendReq ¶
type McisRecommendReq struct { VmReq []TbVmRecommendReq `json:"vmReq"` PlacementAlgo string `json:"placementAlgo"` PlacementParam []common.KeyValue `json:"placementParam"` MaxResultNum string `json:"maxResultNum"` }
type McisStatusInfo ¶
type McisStatusInfo struct { Id string `json:"id"` Name string `json:"name"` //Vm_num string `json:"vm_num"` Status string `json:"status"` TargetStatus string `json:"targetStatus"` TargetAction string `json:"targetAction"` // InstallMonAgent Option for CB-Dragonfly agent installation ([yes/no] default:yes) InstallMonAgent string `json:"installMonAgent" example:"[yes, no]"` // yes or no MasterVmId string `json:"masterVmId" example:"vm-asiaeast1-cb-01"` MasterIp string `json:"masterIp" example:"32.201.134.113"` MasterSSHPort string `json:"masterSSHPort"` Vm []TbVmStatusInfo `json:"vm"` }
struct McisStatusInfo is to define simple information of MCIS with updated status of all VMs
func GetMcisStatus ¶
func GetMcisStatus(nsId string, mcisId string) (*McisStatusInfo, error)
func GetMcisStatusAll ¶ added in v0.2.8
func GetMcisStatusAll(nsId string) ([]McisStatusInfo, error)
type MonAgentInstallReq ¶
type MonAgentInstallReq struct { NsId string `json:"nsId,omitempty"` McisId string `json:"mcisId,omitempty"` VmId string `json:"vmId,omitempty"` PublicIp string `json:"publicIp,omitempty"` Port string `json:"port,omitempty"` UserName string `json:"userName,omitempty"` SshKey string `json:"sshKey,omitempty"` Csp_type string `json:"cspType,omitempty"` }
MonAgentInstallReq struct
type MonResultSimple ¶ added in v0.2.8
type MonResultSimple struct { Metric string `json:"metric"` VmId string `json:"vmId"` Value string `json:"value"` Err string `json:"err"` }
MonResultSimple struct is for containing vm monitoring results
type MonResultSimpleResponse ¶ added in v0.2.8
type MonResultSimpleResponse struct { NsId string `json:"nsId"` McisId string `json:"mcisId"` McisMonitoring []MonResultSimple `json:"mcisMonitoring"` }
MonResultSimpleResponse struct is for containing Mcis monitoring results
func GetMonitoringData ¶
func GetMonitoringData(nsId string, mcisId string, metric string) (MonResultSimpleResponse, error)
GetMonitoringData func retrieves monitoring data from cb-dragonfly
type MultihostBenchmarkReq ¶
type MultihostBenchmarkReq struct {
Multihost []BenchmarkReq `json:"multihost"`
}
type Operation ¶ added in v0.3.7
type Operation struct { Operator string `json:"operator" example:">=" enums:">=,<=,=="` // >=, <=, == Operand string `json:"operand" example:"4" enums:"4,8,.."` // 10, 70, 80, 98, ... }
Operation is struct for .
type ParameterKeyVal ¶ added in v0.3.7
type ParameterKeyVal struct { Key string `json:"key" example:"coordinateClose" enums:"coordinateClose,coordinateWithin,coordinateFair"` // coordinate Val []string `json:"val" example:"46.3772/2.3730"` // ["Latitude,Longitude","12,543",..,"31,433"] }
Operation is struct for .
type Policy ¶ added in v0.2.8
type Policy struct { AutoCondition AutoCondition `json:"autoCondition"` AutoAction AutoAction `json:"autoAction"` Status string `json:"status"` }
Policy is struct for MCIS auto-control Policy request that includes AutoCondition, AutoAction, Status.
type PriorityCondition ¶ added in v0.3.7
type PriorityCondition struct { Metric string `json:"metric" example:"location" enums:"location,latency,cost"` // location,latency,cost Weight string `json:"weight" example:"0.3" enums:"0.1,0.2,..."` // 0.3 Parameter []ParameterKeyVal `json:"parameter"` }
FilterCondition is struct for .
type PriorityInfo ¶ added in v0.3.7
type PriorityInfo struct {
Policy []PriorityCondition `json:"policy"`
}
PriorityInfo is struct for .
type RegionInfo ¶
type SSHInfo ¶
type SSHInfo struct { UserName string // ex) "root" PrivateKey []byte // ex) []byte(`-----BEGIN RSA PRIVATE KEY----- // MIIEoQIBAAKCAQEArVNOLwMIp5VmZ4VPZotcoCHdEzimKalAsz+ccLfvAA1Y2ELH // ...`) ServerPort string // ex) "node12:22" }
====================================================================
type SSHKeyPathInfo ¶
type SSHKeyPathInfo struct { UserName string // ex) "root" KeyPath string // ex) "/root/.ssh/id_rsa // You should use the full path. ServerPort string // ex) "node12:22" }
====================================================================
type SpecBenchmarkInfo ¶
type SpecBenchmarkInfo struct { SpecId string `json:"specid"` Cpus string `json:"cpus"` Cpum string `json:"cpum"` MemR string `json:"memR"` MemW string `json:"memW"` FioR string `json:"fioR"` FioW string `json:"fioW"` DbR string `json:"dbR"` DbW string `json:"dbW"` Rtt string `json:"rtt"` EvaledTime string `json:"evaledTime"` }
type SpiderAllList ¶ added in v0.3.6
type SpiderAllList struct { MappedList []SpiderNameIdSystemId OnlySpiderList []SpiderNameIdSystemId OnlyCSPList []SpiderNameIdSystemId }
type SpiderAllListWrapper ¶ added in v0.3.6
type SpiderAllListWrapper struct {
AllList SpiderAllList
}
type SpiderNameIdSystemId ¶ added in v0.3.6
type SpiderVMInfo ¶
type SpiderVMInfo struct { // Fields for request Name string ImageName string VPCName string SubnetName string SecurityGroupNames []string KeyPairName string // Fields for both request and response VMSpecName string // instance type or flavour, etc... ex) t2.micro or f1.micro VMUserId string // ex) user1 VMUserPasswd string // Fields for response IId common.IID // {NameId, SystemId} ImageIId common.IID VpcIID common.IID SubnetIID common.IID // AWS, ex) subnet-8c4a53e4 SecurityGroupIIds []common.IID // AWS, ex) sg-0b7452563e1121bb6 KeyPairIId common.IID StartTime time.Time // Timezone: based on cloud-barista server location. Region RegionInfo // ex) {us-east1, us-east1-c} or {ap-northeast-2} NetworkInterface string // ex) eth0 PublicIP string PublicDNS string PrivateIP string PrivateDNS string VMBootDisk string // ex) /dev/sda1 VMBlockDisk string // ex) SSHAccessPoint string KeyValueList []common.KeyValue }
type SpiderVMReqInfoWrapper ¶
type SpiderVMReqInfoWrapper struct { ConnectionName string ReqInfo SpiderVMInfo }
type SshCmdResult ¶
type SshCmdResult struct { McisId string `json:"mcisId"` VmId string `json:"vmId"` VmIp string `json:"vmIp"` Result string `json:"result"` Err error `json:"err"` }
func CorePostCmdMcis ¶
func CorePostCmdMcis(nsId string, mcisId string, req *McisCmdReq) ([]SshCmdResult, error)
type TbInspectResourcesResponse ¶ added in v0.3.6
type TbInspectResourcesResponse struct { // ResourcesOnCsp interface{} `json:"resourcesOnCsp"` // ResourcesOnSpider interface{} `json:"resourcesOnSpider"` // ResourcesOnTumblebug interface{} `json:"resourcesOnTumblebug"` ResourcesOnCsp []resourceOnCspOrSpider `json:"resourcesOnCsp"` ResourcesOnSpider []resourceOnCspOrSpider `json:"resourcesOnSpider"` ResourcesOnTumblebug []resourceOnTumblebug `json:"resourcesOnTumblebug"` }
Response struct for InspectResources
type TbMcisInfo ¶
type TbMcisInfo struct { Id string `json:"id"` Name string `json:"name"` Status string `json:"status"` TargetStatus string `json:"targetStatus"` TargetAction string `json:"targetAction"` // InstallMonAgent Option for CB-Dragonfly agent installation ([yes/no] default:yes) InstallMonAgent string `json:"installMonAgent" example:"yes" default:"yes" enums:"yes,no"` // yes or no Label string `json:"label"` PlacementAlgo string `json:"placementAlgo"` Description string `json:"description"` Vm []TbVmInfo `json:"vm"` }
func CoreGetAllMcis ¶
func CoreGetAllMcis(nsId string, option string) ([]TbMcisInfo, error)
func CorePostMcisGroupVm ¶ added in v0.3.4
func CorePostMcisGroupVm(nsId string, mcisId string, vmReq *TbVmReq) (*TbMcisInfo, error)
CorePostMcisGroupVm function is a wrapper for CreateMcisGroupVm
func CreateMcis ¶
func CreateMcis(nsId string, req *TbMcisReq) (*TbMcisInfo, error)
CreateMcis function create MCIS obeject and deploy requested VMs.
func CreateMcisGroupVm ¶ added in v0.3.4
func CreateMcisGroupVm(nsId string, mcisId string, vmRequest *TbVmReq) (*TbMcisInfo, error)
func GetMcisInfo ¶ added in v0.3.5
func GetMcisInfo(nsId string, mcisId string) (*TbMcisInfo, error)
GetMcisInfo func returns MCIS information with the current status update
func GetMcisObject ¶
func GetMcisObject(nsId string, mcisId string) (TbMcisInfo, error)
GetMcisObject func retrieve MCIS object from database (no current status update)
type TbMcisReq ¶
type TbMcisReq struct { Name string `json:"name"` // InstallMonAgent Option for CB-Dragonfly agent installation ([yes/no] default:yes) InstallMonAgent string `json:"installMonAgent" example:"yes" default:"yes" enums:"yes,no"` // yes or no Label string `json:"label"` PlacementAlgo string `json:"placementAlgo"` Description string `json:"description"` Vm []TbVmReq `json:"vm"` }
type TbVmGroupInfo ¶ added in v0.3.3
type TbVmGroupInfo struct { Id string `json:"id"` Name string `json:"name"` VmId []string `json:"vmId"` VmGroupSize string `json:"vmGroupSize"` }
struct TbVmGroupInfo is to define an object that includes homogeneous VMs.
type TbVmInfo ¶
type TbVmInfo struct { Id string `json:"id"` Name string `json:"name"` // defined if the VM is in a group VmGroupId string `json:"vmGroupId"` Location GeoLocation `json:"location"` // Required by CB-Tumblebug Status string `json:"status"` TargetStatus string `json:"targetStatus"` TargetAction string `json:"targetAction"` // Montoring agent status MonAgentStatus string `json:"monAgentStatus" example:"[installed, notInstalled, failed]"` // yes or no// installed, notInstalled, failed // Latest system message such as error message SystemMessage string `json:"systemMessage" example:"Failed because ..." default:""` // systeam-given string message // Created time CreatedTime string `json:"createdTime" example:"2022-11-10 23:00:00" default:""` Label string `json:"label"` Description string `json:"description"` Region RegionInfo `json:"region"` // AWS, ex) {us-east1, us-east1-c} or {ap-northeast-2} PublicIP string `json:"publicIP"` SSHPort string `json:"sshPort"` PublicDNS string `json:"publicDNS"` PrivateIP string `json:"privateIP"` PrivateDNS string `json:"privateDNS"` VMBootDisk string `json:"vmBootDisk"` // ex) /dev/sda1 VMBlockDisk string `json:"vmBlockDisk"` ConnectionName string `json:"connectionName"` SpecId string `json:"specId"` ImageId string `json:"imageId"` VNetId string `json:"vNetId"` SubnetId string `json:"subnetId"` SecurityGroupIds []string `json:"securityGroupIds"` SshKeyId string `json:"sshKeyId"` VmUserAccount string `json:"vmUserAccount"` VmUserPassword string `json:"vmUserPassword"` CspViewVmDetail SpiderVMInfo `json:"cspViewVmDetail"` }
struct TbVmGroupInfo is to define a server instance object
func CoreGetMcisVmInfo ¶
func CorePostMcisVm ¶
type TbVmPriority ¶
type TbVmPriority struct { Priority string `json:"priority"` VmSpec mcir.TbSpecInfo `json:"vmSpec"` }
func GetRecommendList ¶
func GetRecommendList(nsId string, cpuSize string, memSize string, diskSize string) ([]TbVmPriority, error)
// Info manage for MCIS recommendation
type TbVmRecommendInfo ¶
type TbVmRecommendInfo struct { VmReq TbVmRecommendReq `json:"vmReq"` VmPriority []TbVmPriority `json:"vmPriority"` PlacementAlgo string `json:"placementAlgo"` PlacementParam []common.KeyValue `json:"placementParam"` }
func CorePostMcisRecommend ¶ added in v0.3.8
func CorePostMcisRecommend(nsId string, req *McisRecommendReq) ([]TbVmRecommendInfo, error)
type TbVmRecommendReq ¶
type TbVmRecommendReq struct { RequestName string `json:"requestName"` MaxResultNum string `json:"maxResultNum"` VcpuSize string `json:"vcpuSize"` MemorySize string `json:"memorySize"` DiskSize string `json:"diskSize"` PlacementAlgo string `json:"placementAlgo"` PlacementParam []common.KeyValue `json:"placementParam"` }
type TbVmReq ¶
type TbVmReq struct { // VM name or VM group name if is (not empty) && (> 0). If it is a group, actual VM name will be generated with -N postfix. Name string `json:"name"` // if vmGroupSize is (not empty) && (> 0), VM group will be gernetad. VMs will be created accordingly. VmGroupSize string `json:"vmGroupSize" example:"3" default:""` Label string `json:"label"` Description string `json:"description"` ConnectionName string `json:"connectionName"` SpecId string `json:"specId"` ImageId string `json:"imageId"` VNetId string `json:"vNetId"` SubnetId string `json:"subnetId"` SecurityGroupIds []string `json:"securityGroupIds"` SshKeyId string `json:"sshKeyId"` VmUserAccount string `json:"vmUserAccount"` VmUserPassword string `json:"vmUserPassword"` }
struct TbVmReq is to get requirements to create a new server instance.
type TbVmStatusInfo ¶
type TbVmStatusInfo struct { Id string `json:"id"` Name string `json:"name"` CspVmId string `json:"cspVmId"` Status string `json:"status"` TargetStatus string `json:"targetStatus"` TargetAction string `json:"targetAction"` NativeStatus string `json:"nativeStatus"` // Montoring agent status MonAgentStatus string `json:"monAgentStatus" example:"[installed, notInstalled, failed]"` // yes or no// installed, notInstalled, failed // Latest system message such as error message SystemMessage string `json:"systemMessage" example:"Failed because ..." default:""` // systeam-given string message // Created time CreatedTime string `json:"createdTime" example:"2022-11-10 23:00:00" default:""` PublicIp string `json:"publicIp"` PrivateIp string `json:"privateIp"` SSHPort string `json:"sshPort"` Location GeoLocation `json:"location"` }
TbVmStatusInfo is to define simple information of VM with updated status
func CoreGetMcisVmStatus ¶
func CoreGetMcisVmStatus(nsId string, mcisId string, vmId string) (*TbVmStatusInfo, error)
func GetVmCurrentPublicIp ¶
func GetVmCurrentPublicIp(nsId string, mcisId string, vmId string) (TbVmStatusInfo, error)
func GetVmStatus ¶
func GetVmStatus(nsId string, mcisId string, vmId string) (TbVmStatusInfo, error)