Documentation ¶
Index ¶
- func CheckResource(nsId string, resourceType string, resourceId string) (bool, error)
- func DelAllResources(nsId string, resourceType string, forceFlag string) error
- func DelRecommendSpec(nsId string, specId string, cpuSize uint16, memSize uint16, diskSize uint32) error
- func DelResource(nsId string, resourceType string, resourceId string, forceFlag string) error
- func FetchImagesForAllConnConfigs(nsId string) (connConfigCount uint, imageCount uint, err error)
- func FetchImagesForConnConfig(connConfig string, nsId string) (imageCount uint, err error)
- func FetchSpecsForAllConnConfigs(nsId string) (connConfigCount uint, specCount uint, err error)
- func FetchSpecsForConnConfig(connConfig string, nsId string) (specCount uint, err error)
- func GetAssociatedObjectCount(nsId string, resourceType string, resourceId string) (int, error)
- func GetAssociatedObjectList(nsId string, resourceType string, resourceId string) ([]string, error)
- func GetNameFromStruct(u interface{}) string
- func GetResource(nsId string, resourceType string, resourceId string) (interface{}, error)
- func InspectResources(connConfig string, resourceType string) (interface{}, error)
- func ListResource(nsId string, resourceType string) (interface{}, error)
- func ListResourceId(nsId string, resourceType string) ([]string, error)
- func RefineImageName(imageName string) string
- func RefineSpecName(specName string) string
- func RegisterRecommendList(nsId string, connectionName string, cpuSize uint16, memSize uint16, ...) error
- func UpdateAssociatedObjectList(nsId string, resourceType string, resourceId string, cmd string, ...) ([]string, error)
- type FilterSpecsByRangeRequest
- type NameOnly
- type Range
- type ReturnValue
- type SpiderAllList
- type SpiderAllListWrapper
- type SpiderGpuInfo
- type SpiderImageInfo
- type SpiderImageList
- type SpiderImageReqInfoWrapper
- type SpiderKeyPairInfo
- type SpiderKeyPairReqInfoWrapper
- type SpiderNameIdSystemId
- type SpiderSecurityInfo
- type SpiderSecurityReqInfoWrapper
- type SpiderSecurityRuleInfo
- type SpiderSpecInfo
- type SpiderSpecList
- type SpiderSubnetInfo
- type SpiderSubnetReqInfo
- type SpiderVCpuInfo
- type SpiderVPCInfo
- type SpiderVPCReqInfo
- type SpiderVPCReqInfoWrapper
- type TbImageInfo
- func ConvertSpiderImageToTumblebugImage(spiderImage SpiderImageInfo) (TbImageInfo, error)
- func RegisterImageWithId(nsId string, u *TbImageReq) (TbImageInfo, error)
- func RegisterImageWithInfo(nsId string, content *TbImageInfo) (TbImageInfo, error)
- func SearchImage(nsId string, keywords ...string) ([]TbImageInfo, error)
- type TbImageReq
- type TbInspectResourcesResponse
- type TbSecurityGroupInfo
- type TbSecurityGroupReq
- type TbSpecInfo
- func ConvertSpiderSpecToTumblebugSpec(spiderSpec SpiderSpecInfo) (TbSpecInfo, error)
- func FilterSpecs(nsId string, filter TbSpecInfo) ([]TbSpecInfo, error)
- func FilterSpecsByRange(nsId string, filter FilterSpecsByRangeRequest) ([]TbSpecInfo, error)
- func RegisterSpecWithCspSpecName(nsId string, u *TbSpecReq) (TbSpecInfo, error)
- func RegisterSpecWithInfo(nsId string, content *TbSpecInfo) (TbSpecInfo, error)
- func SortSpecs(specList []TbSpecInfo, orderBy string, direction string) ([]TbSpecInfo, error)
- func UpdateSpec(nsId string, newSpec TbSpecInfo) (TbSpecInfo, error)
- type TbSpecReq
- type TbSshKeyInfo
- type TbSshKeyReq
- type TbVNetInfo
- type TbVNetReq
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckResource ¶
CheckResource returns the existence of the TB MCIR resource in bool form.
func DelAllResources ¶
DelAllResources deletes all TB MCIR object of given resourceType
func DelRecommendSpec ¶
func DelRecommendSpec(nsId string, specId string, cpuSize uint16, memSize uint16, diskSize uint32) error
DelRecommendSpec deletes the spec recommendation info
func DelResource ¶
DelResource deletes the TB MCIR object
func FetchImagesForAllConnConfigs ¶
FetchImagesForAllConnConfigs gets all conn configs from Spider, lookups all images for each region of conn config, and saves into TB image objects
func FetchImagesForConnConfig ¶
FetchImagesForAllConnConfigs gets all conn configs from Spider, lookups all images for each region of conn config, and saves into TB image objects
func FetchSpecsForAllConnConfigs ¶
FetchSpecsForAllConnConfigs gets all conn configs from Spider, lookups all specs for each region of conn config, and saves into TB spec objects
func FetchSpecsForConnConfig ¶
FetchSpecsForConnConfig lookups all specs for region of conn config, and saves into TB spec objects
func GetAssociatedObjectCount ¶
GetAssociatedObjectCount returns the number of MCIR's associated Tumblebug objects
func GetAssociatedObjectList ¶
GetAssociatedObjectList returns the list of MCIR's associated Tumblebug objects
func GetNameFromStruct ¶
func GetNameFromStruct(u interface{}) string
GetNameFromStruct accepts any struct for argument, and returns
func GetResource ¶
GetResource returns the requested TB MCIR object
func InspectResources ¶
InspectResources returns the state list of TB MCIR objects of given connConfig and resourceType
func ListResource ¶
ListResource returns the list of TB MCIR objects of given resourceType
func ListResourceId ¶
ListResourceId returns the list of TB MCIR object IDs of given resourceType
func RefineImageName ¶
func RefineSpecName ¶
Types ¶
type FilterSpecsByRangeRequest ¶
type FilterSpecsByRangeRequest struct { Id string `json:"id"` Name string `json:"name"` ConnectionName string `json:"connectionName"` CspSpecName string `json:"cspSpecName"` Os_type string `json:"os_type"` Num_vCPU Range `json:"num_vCPU"` Num_core Range `json:"num_core"` Mem_GiB Range `json:"mem_GiB"` Storage_GiB Range `json:"storage_GiB"` Description string `json:"description"` Cost_per_hour Range `json:"cost_per_hour"` Num_storage Range `json:"num_storage"` Max_num_storage Range `json:"max_num_storage"` Max_total_storage_TiB Range `json:"max_total_storage_TiB"` Net_bw_Gbps Range `json:"net_bw_Gbps"` Ebs_bw_Mbps Range `json:"ebs_bw_Mbps"` Gpu_model string `json:"gpu_model"` Num_gpu Range `json:"num_gpu"` Gpumem_GiB Range `json:"gpumem_GiB"` Gpu_p2p string `json:"gpu_p2p"` EvaluationStatus string `json:"evaluationStatus"` EvaluationScore_01 Range `json:"evaluationScore_01"` EvaluationScore_02 Range `json:"evaluationScore_02"` EvaluationScore_03 Range `json:"evaluationScore_03"` EvaluationScore_04 Range `json:"evaluationScore_04"` EvaluationScore_05 Range `json:"evaluationScore_05"` EvaluationScore_06 Range `json:"evaluationScore_06"` EvaluationScore_07 Range `json:"evaluationScore_07"` EvaluationScore_08 Range `json:"evaluationScore_08"` EvaluationScore_09 Range `json:"evaluationScore_09"` EvaluationScore_10 Range `json:"evaluationScore_10"` }
type ReturnValue ¶
type ReturnValue struct {
CustomStruct interface{}
}
type SpiderAllList ¶
type SpiderAllList struct { MappedList []SpiderNameIdSystemId OnlySpiderList []SpiderNameIdSystemId OnlyCSPList []SpiderNameIdSystemId }
type SpiderAllListWrapper ¶
type SpiderAllListWrapper struct {
AllList SpiderAllList
}
type SpiderImageInfo ¶
type SpiderImageInfo struct { // Fields for request Name string // Fields for response IId common.IID // {NameId, SystemId} GuestOS string // Windows7, Ubuntu etc. Status string // available, unavailable KeyValueList []common.KeyValue }
func LookupImage ¶
func LookupImage(connConfig string, imageId string) (SpiderImageInfo, error)
LookupImage accepts Spider conn config and CSP image ID, lookups and returns the Spider image object
type SpiderImageList ¶
type SpiderImageList struct {
Image []SpiderImageInfo `json:"image"`
}
func LookupImageList ¶
func LookupImageList(connConfig string) (SpiderImageList, error)
LookupImageList accepts Spider conn config, lookups and returns the list of all images in the region of conn config in the form of the list of Spider image objects
type SpiderImageReqInfoWrapper ¶
type SpiderImageReqInfoWrapper struct { ConnectionName string ReqInfo SpiderImageInfo }
type SpiderKeyPairInfo ¶
type SpiderKeyPairReqInfoWrapper ¶
type SpiderKeyPairReqInfoWrapper struct { ConnectionName string ReqInfo SpiderKeyPairInfo }
type SpiderNameIdSystemId ¶
type SpiderSecurityInfo ¶
type SpiderSecurityInfo struct { // Fields for request Name string VPCName string // Fields for both request and response SecurityRules *[]SpiderSecurityRuleInfo // Fields for response IId common.IID // {NameId, SystemId} VpcIID common.IID // {NameId, SystemId} Direction string // @todo userd?? KeyValueList []common.KeyValue }
type SpiderSecurityReqInfoWrapper ¶
type SpiderSecurityReqInfoWrapper struct { ConnectionName string ReqInfo SpiderSecurityInfo }
type SpiderSecurityRuleInfo ¶
type SpiderSpecInfo ¶
type SpiderSpecInfo struct { Region string Name string VCpu SpiderVCpuInfo Mem string Gpu []SpiderGpuInfo KeyValueList []common.KeyValue }
func LookupSpec ¶
func LookupSpec(connConfig string, specName string) (SpiderSpecInfo, error)
LookupSpec accepts Spider conn config and CSP spec name, lookups and returns the Spider spec object
type SpiderSpecList ¶
type SpiderSpecList struct {
Vmspec []SpiderSpecInfo `json:"vmspec"`
}
func LookupSpecList ¶
func LookupSpecList(connConfig string) (SpiderSpecList, error)
LookupSpecList accepts Spider conn config, lookups and returns the list of all specs in the region of conn config in the form of the list of Spider spec objects
type SpiderSubnetInfo ¶
type SpiderSubnetReqInfo ¶
type SpiderVCpuInfo ¶
type SpiderVPCInfo ¶
type SpiderVPCReqInfo ¶
type SpiderVPCReqInfo struct { Name string IPv4_CIDR string SubnetInfoList []SpiderSubnetReqInfo }
type SpiderVPCReqInfoWrapper ¶
type SpiderVPCReqInfoWrapper struct { ConnectionName string ReqInfo SpiderVPCReqInfo }
type TbImageInfo ¶
type TbImageInfo struct { Namespace string `json:"namespace"` // required to save in RDB Id string `json:"id"` Name string `json:"name"` ConnectionName string `json:"connectionName"` CspImageId string `json:"cspImageId"` CspImageName string `json:"cspImageName"` Description string `json:"description,omitempty"` CreationDate string `json:"creationDate,omitempty"` GuestOS string `json:"guestOS,omitempty"` // Windows7, Ubuntu etc. Status string `json:"status,omitempty"` // available, unavailable KeyValueList []common.KeyValue `json:"keyValueList,omitempty"` AssociatedObjectList []string `json:"associatedObjectList"` IsAutoGenerated bool `json:"isAutoGenerated"` }
func ConvertSpiderImageToTumblebugImage ¶
func ConvertSpiderImageToTumblebugImage(spiderImage SpiderImageInfo) (TbImageInfo, error)
ConvertSpiderImageToTumblebugImage accepts an Spider image object, converts to and returns an TB image object
func RegisterImageWithId ¶
func RegisterImageWithId(nsId string, u *TbImageReq) (TbImageInfo, error)
RegisterImageWithId accepts image creation request, creates and returns an TB image object
func RegisterImageWithInfo ¶
func RegisterImageWithInfo(nsId string, content *TbImageInfo) (TbImageInfo, error)
RegisterImageWithInfo accepts image creation request, creates and returns an TB image object
func SearchImage ¶
func SearchImage(nsId string, keywords ...string) ([]TbImageInfo, error)
SearchImage accepts arbitrary number of keywords, and returns the list of matched TB image objects
type TbImageReq ¶
type TbInspectResourcesResponse ¶
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 TbSecurityGroupInfo ¶
type TbSecurityGroupInfo struct { Id string `json:"id"` Name string `json:"name"` ConnectionName string `json:"connectionName"` VNetId string `json:"vNetId"` Description string `json:"description"` FirewallRules *[]SpiderSecurityRuleInfo `json:"firewallRules"` CspSecurityGroupId string `json:"cspSecurityGroupId"` CspSecurityGroupName string `json:"cspSecurityGroupName"` KeyValueList []common.KeyValue `json:"keyValueList"` AssociatedObjectList []string `json:"associatedObjectList"` IsAutoGenerated bool `json:"isAutoGenerated"` }
func CreateSecurityGroup ¶
func CreateSecurityGroup(nsId string, u *TbSecurityGroupReq) (TbSecurityGroupInfo, error)
CreateSecurityGroup accepts SG creation request, creates and returns an TB SG object
type TbSecurityGroupReq ¶
type TbSecurityGroupReq struct { Name string `json:"name"` ConnectionName string `json:"connectionName"` VNetId string `json:"vNetId"` Description string `json:"description"` FirewallRules *[]SpiderSecurityRuleInfo `json:"firewallRules"` }
type TbSpecInfo ¶
type TbSpecInfo struct { Namespace string `json:"namespace"` // required to save in RDB Id string `json:"id"` Name string `json:"name"` ConnectionName string `json:"connectionName"` CspSpecName string `json:"cspSpecName"` Os_type string `json:"os_type"` Num_vCPU uint16 `json:"num_vCPU"` Num_core uint16 `json:"num_core"` Mem_GiB uint16 `json:"mem_GiB"` Storage_GiB uint32 `json:"storage_GiB"` Description string `json:"description"` Cost_per_hour float32 `json:"cost_per_hour"` Num_storage uint8 `json:"num_storage"` Max_num_storage uint8 `json:"max_num_storage"` Max_total_storage_TiB uint16 `json:"max_total_storage_TiB"` Net_bw_Gbps uint16 `json:"net_bw_Gbps"` Ebs_bw_Mbps uint32 `json:"ebs_bw_Mbps"` Gpu_model string `json:"gpu_model"` Num_gpu uint8 `json:"num_gpu"` Gpumem_GiB uint16 `json:"gpumem_GiB"` Gpu_p2p string `json:"gpu_p2p"` OrderInFilteredResult uint16 `json:"orderInFilteredResult"` EvaluationStatus string `json:"evaluationStatus"` EvaluationScore_01 float32 `json:"evaluationScore_01"` EvaluationScore_02 float32 `json:"evaluationScore_02"` EvaluationScore_03 float32 `json:"evaluationScore_03"` EvaluationScore_04 float32 `json:"evaluationScore_04"` EvaluationScore_05 float32 `json:"evaluationScore_05"` EvaluationScore_06 float32 `json:"evaluationScore_06"` EvaluationScore_07 float32 `json:"evaluationScore_07"` EvaluationScore_08 float32 `json:"evaluationScore_08"` EvaluationScore_09 float32 `json:"evaluationScore_09"` EvaluationScore_10 float32 `json:"evaluationScore_10"` AssociatedObjectList []string `json:"associatedObjectList"` IsAutoGenerated bool `json:"isAutoGenerated"` }
func ConvertSpiderSpecToTumblebugSpec ¶
func ConvertSpiderSpecToTumblebugSpec(spiderSpec SpiderSpecInfo) (TbSpecInfo, error)
ConvertSpiderSpecToTumblebugSpec accepts an Spider spec object, converts to and returns an TB spec object
func FilterSpecs ¶
func FilterSpecs(nsId string, filter TbSpecInfo) ([]TbSpecInfo, error)
FilterSpecs accepts criteria for filtering, and returns the list of filtered TB spec objects
func FilterSpecsByRange ¶
func FilterSpecsByRange(nsId string, filter FilterSpecsByRangeRequest) ([]TbSpecInfo, error)
FilterSpecsByRange accepts criteria ranges for filtering, and returns the list of filtered TB spec objects
func RegisterSpecWithCspSpecName ¶
func RegisterSpecWithCspSpecName(nsId string, u *TbSpecReq) (TbSpecInfo, error)
RegisterSpecWithCspSpecName accepts spec creation request, creates and returns an TB spec object
func RegisterSpecWithInfo ¶
func RegisterSpecWithInfo(nsId string, content *TbSpecInfo) (TbSpecInfo, error)
RegisterSpecWithInfo accepts spec creation request, creates and returns an TB spec object
func SortSpecs ¶
func SortSpecs(specList []TbSpecInfo, orderBy string, direction string) ([]TbSpecInfo, error)
SortSpecs accepts the list of TB spec objects, criteria and sorting direction, sorts and returns the sorted list of TB spec objects
func UpdateSpec ¶
func UpdateSpec(nsId string, newSpec TbSpecInfo) (TbSpecInfo, error)
UpdateSpec accepts to-be TB spec objects, updates and returns the updated TB spec objects
type TbSshKeyInfo ¶
type TbSshKeyInfo struct { Id string `json:"id"` Name string `json:"name"` ConnectionName string `json:"connectionName"` Description string `json:"description"` CspSshKeyName string `json:"cspSshKeyName"` Fingerprint string `json:"fingerprint"` Username string `json:"username"` VerifiedUsername string `json:"verifiedUsername"` PublicKey string `json:"publicKey"` PrivateKey string `json:"privateKey"` KeyValueList []common.KeyValue `json:"keyValueList"` AssociatedObjectList []string `json:"associatedObjectList"` IsAutoGenerated bool `json:"isAutoGenerated"` }
func CreateSshKey ¶
func CreateSshKey(nsId string, u *TbSshKeyReq) (TbSshKeyInfo, error)
CreateSshKey accepts SSH key creation request, creates and returns an TB sshKey object
type TbSshKeyReq ¶
type TbVNetInfo ¶
type TbVNetInfo struct { Id string `json:"id"` Name string `json:"name"` ConnectionName string `json:"connectionName"` CidrBlock string `json:"cidrBlock"` SubnetInfoList []SpiderSubnetInfo `json:"subnetInfoList"` Description string `json:"description"` CspVNetId string `json:"cspVNetId"` CspVNetName string `json:"cspVNetName"` Status string `json:"status"` KeyValueList []common.KeyValue `json:"keyValueList"` AssociatedObjectList []string `json:"associatedObjectList"` IsAutoGenerated bool `json:"isAutoGenerated"` }
func CreateVNet ¶
func CreateVNet(nsId string, u *TbVNetReq) (TbVNetInfo, error)
CreateVNet accepts vNet creation request, creates and returns an TB vNet object