Documentation
¶
Overview ¶
Package mcir is to manage multi-cloud infra resource
Package mcir is to manage multi-cloud infra resource ¶
Package mcir is to manage multi-cloud infra resource ¶
Package mcir is to manage multi-cloud infra resource ¶
Package mcir is to manage multi-cloud infra resource ¶
Package mcir is to manage multi-cloud infra resource ¶
Package mcir is to manage multi-cloud infra resource ¶
Package mcir is to manage multi-cloud infra resource
Index ¶
- func CheckChildResource(nsId string, resourceType string, parentResourceId string, resourceId string) (bool, error)
- func CheckResource(nsId string, resourceType string, resourceId string) (bool, error)
- func DelAllDefaultResources(nsId string) (common.IdList, error)
- func DelAllResources(nsId string, resourceType string, subString string, forceFlag string) (common.IdList, error)
- func DelChildResource(nsId string, resourceType string, parentResourceId string, resourceId string, ...) error
- func DelEleInSlice(arr interface{}, index int)
- 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 ListResource(nsId string, resourceType string, filterKey string, filterVal string) (interface{}, error)
- func ListResourceId(nsId string, resourceType string) ([]string, error)
- func LoadCommonResource() (common.IdList, error)
- func LoadDefaultResource(nsId string, resType string, connectionName string) error
- func TbImageReqStructLevelValidation(sl validator.StructLevel)
- func TbSecurityGroupReqStructLevelValidation(sl validator.StructLevel)
- func TbSpecReqStructLevelValidation(sl validator.StructLevel)
- func TbSshKeyReqStructLevelValidation(sl validator.StructLevel)
- func TbSubnetReqStructLevelValidation(sl validator.StructLevel)
- func TbVNetReqStructLevelValidation(sl validator.StructLevel)
- func ToNamingRuleCompatible(rawName string) string
- func UpdateAssociatedObjectList(nsId string, resourceType string, resourceId string, cmd string, ...) ([]string, error)
- type FilterSpecsByRangeRequest
- type NameOnly
- type Range
- type ReturnValue
- type SpiderGpuInfo
- type SpiderImageInfo
- type SpiderImageList
- type SpiderImageReqInfoWrapper
- type SpiderKeyPairInfo
- type SpiderKeyPairReqInfoWrapper
- type SpiderSecurityInfo
- type SpiderSecurityReqInfoWrapper
- type SpiderSecurityRuleInfo
- type SpiderSecurityRuleReqInfoIntermediateWrapper
- type SpiderSecurityRuleReqInfoWrapper
- type SpiderSpecInfo
- type SpiderSpecList
- type SpiderSubnetInfo
- type SpiderSubnetReqInfo
- type SpiderSubnetReqInfoWrapper
- type SpiderVCpuInfo
- type SpiderVPCInfo
- type SpiderVPCReqInfo
- type SpiderVPCReqInfoWrapper
- type TbFirewallRuleInfo
- 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)
- func UpdateImage(nsId string, imageId string, fieldsToUpdate TbImageInfo) (TbImageInfo, error)
- type TbImageReq
- type TbSecurityGroupInfo
- func CreateFirewallRules(nsId string, securityGroupId string, req []TbFirewallRuleInfo, objectOnly bool) (TbSecurityGroupInfo, error)
- func CreateSecurityGroup(nsId string, u *TbSecurityGroupReq, option string) (TbSecurityGroupInfo, error)
- func DeleteFirewallRules(nsId string, securityGroupId string, req []TbFirewallRuleInfo) (TbSecurityGroupInfo, error)
- 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, specId string, fieldsToUpdate TbSpecInfo) (TbSpecInfo, error)
- type TbSpecReq
- type TbSshKeyInfo
- type TbSshKeyReq
- type TbSubnetInfo
- type TbSubnetReq
- type TbVNetInfo
- type TbVNetReq
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckChildResource ¶ added in v0.4.10
func CheckChildResource(nsId string, resourceType string, parentResourceId string, resourceId string) (bool, error)
CheckChildResource returns the existence of the TB MCIR resource in bool form.
func CheckResource ¶ added in v0.3.1
CheckResource returns the existence of the TB MCIR resource in bool form.
func DelAllDefaultResources ¶ added in v0.4.12
DelAllDefaultResources deletes all Default securityGroup, sshKey, vNet objects
func DelAllResources ¶
func DelAllResources(nsId string, resourceType string, subString string, forceFlag string) (common.IdList, error)
DelAllResources deletes all TB MCIR object of given resourceType
func DelChildResource ¶ added in v0.4.10
func DelChildResource(nsId string, resourceType string, parentResourceId string, resourceId string, forceFlag string) error
DelChildResource deletes the TB MCIR object
func DelEleInSlice ¶ added in v0.4.10
func DelEleInSlice(arr interface{}, index int)
DelEleInSlice delete an element from slice by index
- arr: the reference of slice
- index: the index of element will be deleted
func DelResource ¶
DelResource deletes the TB MCIR object
func FetchImagesForAllConnConfigs ¶ added in v0.3.8
FetchImagesForAllConnConfigs gets all conn configs from Spider, lookups all images for each region of conn config, and saves into TB image objects
func FetchImagesForConnConfig ¶ added in v0.3.8
FetchImagesForAllConnConfigs gets all conn configs from Spider, lookups all images for each region of conn config, and saves into TB image objects
func FetchSpecsForAllConnConfigs ¶ added in v0.3.8
FetchSpecsForAllConnConfigs gets all conn configs from Spider, lookups all specs for each region of conn config, and saves into TB spec objects
func FetchSpecsForConnConfig ¶ added in v0.3.8
FetchSpecsForConnConfig lookups all specs for region of conn config, and saves into TB spec objects
func GetAssociatedObjectCount ¶ added in v0.3.1
GetAssociatedObjectCount returns the number of MCIR's associated Tumblebug objects
func GetAssociatedObjectList ¶ added in v0.3.1
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 ListResource ¶
func ListResource(nsId string, resourceType string, filterKey string, filterVal string) (interface{}, error)
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 LoadCommonResource ¶ added in v0.4.9
LoadCommonResource is to register common resources from asset files (../assets/*.csv)
func LoadDefaultResource ¶ added in v0.4.10
LoadDefaultResource is to register default resource from asset files (../assets/*.csv)
func TbImageReqStructLevelValidation ¶ added in v0.4.7
func TbImageReqStructLevelValidation(sl validator.StructLevel)
TbImageReqStructLevelValidation func is for Validation
func TbSecurityGroupReqStructLevelValidation ¶ added in v0.4.7
func TbSecurityGroupReqStructLevelValidation(sl validator.StructLevel)
TbSecurityGroupReqStructLevelValidation is a function to validate 'TbSecurityGroupReq' object.
func TbSpecReqStructLevelValidation ¶ added in v0.4.7
func TbSpecReqStructLevelValidation(sl validator.StructLevel)
TbSpecReqStructLevelValidation is a function to validate 'TbSpecReq' object.
func TbSshKeyReqStructLevelValidation ¶ added in v0.4.7
func TbSshKeyReqStructLevelValidation(sl validator.StructLevel)
TbSshKeyReqStructLevelValidation is a function to validate 'TbSshKeyReq' object.
func TbSubnetReqStructLevelValidation ¶ added in v0.4.10
func TbSubnetReqStructLevelValidation(sl validator.StructLevel)
TbSubnetReqStructLevelValidation is a function to validate 'TbSubnetReq' object.
func TbVNetReqStructLevelValidation ¶ added in v0.4.7
func TbVNetReqStructLevelValidation(sl validator.StructLevel)
TbVNetReqStructLevelValidation is a function to validate 'TbVNetReq' object.
func ToNamingRuleCompatible ¶ added in v0.4.10
ToNamingRuleCompatible func is a tool to replace string for name to make the name follow naming convention
Types ¶
type FilterSpecsByRangeRequest ¶ added in v0.2.8
type FilterSpecsByRangeRequest struct {
Id string `json:"id"`
Name string `json:"name"`
ConnectionName string `json:"connectionName"`
ProviderName string `json:"providerName"`
RegionName string `json:"regionName"`
CspSpecName string `json:"cspSpecName"`
OsType string `json:"osType"`
NumvCPU Range `json:"numvCPU"`
NumCore Range `json:"numcore"`
MemGiB Range `json:"memGiB"`
StorageGiB Range `json:"storageGiB"`
Description string `json:"description"`
CostPerHour Range `json:"costPerHour"`
NumStorage Range `json:"numStorage"`
MaxNumStorage Range `json:"maxNumStorage"`
MaxTotalStorageTiB Range `json:"maxTotalStorageTiB"`
NetBwGbps Range `json:"netBwGbps"`
EbsBwMbps Range `json:"ebsBwMbps"`
GpuModel string `json:"gpuModel"`
NumGpu Range `json:"numGpu"`
GpuMemGiB Range `json:"gpuMemGiB"`
GpuP2p string `json:"gpuP2p"`
EvaluationStatus string `json:"evaluationStatus"`
EvaluationScore01 Range `json:"evaluationScore01"`
EvaluationScore02 Range `json:"evaluationScore02"`
EvaluationScore03 Range `json:"evaluationScore03"`
EvaluationScore04 Range `json:"evaluationScore04"`
EvaluationScore05 Range `json:"evaluationScore05"`
EvaluationScore06 Range `json:"evaluationScore06"`
EvaluationScore07 Range `json:"evaluationScore07"`
EvaluationScore08 Range `json:"evaluationScore08"`
EvaluationScore09 Range `json:"evaluationScore09"`
EvaluationScore10 Range `json:"evaluationScore10"`
}
FilterSpecsByRangeRequest is for 'FilterSpecsByRange'
type ReturnValue ¶
type ReturnValue struct {
CustomStruct interface{}
}
type SpiderGpuInfo ¶
SpiderGpuInfo is a struct to handle GPU Info from CB-Spider.
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
}
SpiderImageInfo is a struct to create JSON body of 'Get image request'
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"`
}
SpiderImageList is struct for Spider Image List
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
}
SpiderImageReqInfoWrapper is a wrapper struct to create JSON body of 'Get image request'
type SpiderKeyPairInfo ¶
type SpiderKeyPairInfo struct {
// Fields for request
Name string
CSPId string
// Fields for response
IId common.IID // {NameId, SystemId}
Fingerprint string
PublicKey string
PrivateKey string
VMUserID string
KeyValueList []common.KeyValue
}
SpiderKeyPairInfo is a struct to create JSON body of 'Create keypair request'
type SpiderKeyPairReqInfoWrapper ¶
type SpiderKeyPairReqInfoWrapper struct {
ConnectionName string
ReqInfo SpiderKeyPairInfo
}
SpiderKeyPairReqInfoWrapper is a wrapper struct to create JSON body of 'Create keypair request'
type SpiderSecurityInfo ¶
type SpiderSecurityInfo struct {
// Fields for request
Name string
VPCName string
CSPId 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
}
SpiderSecurityRuleInfo is a struct to create JSON body of 'Create security group request'
type SpiderSecurityReqInfoWrapper ¶
type SpiderSecurityReqInfoWrapper struct {
ConnectionName string
ReqInfo SpiderSecurityInfo
}
SpiderSecurityReqInfoWrapper is a wrapper struct to create JSON body of 'Create security group request'
type SpiderSecurityRuleInfo ¶
type SpiderSecurityRuleInfo struct {
FromPort string //`json:"fromPort"`
ToPort string //`json:"toPort"`
IPProtocol string //`json:"ipProtocol"`
Direction string //`json:"direction"`
CIDR string
}
SpiderSecurityRuleInfo is a struct to handle security group rule info from/to CB-Spider.
type SpiderSecurityRuleReqInfoIntermediateWrapper ¶ added in v0.5.3
type SpiderSecurityRuleReqInfoIntermediateWrapper struct {
RuleInfoList []SpiderSecurityRuleInfo
}
SpiderSecurityRuleReqInfoIntermediateWrapper is a intermediate wrapper struct between SpiderSecurityRuleReqInfoWrapper and SpiderSecurityRuleInfo.
type SpiderSecurityRuleReqInfoWrapper ¶ added in v0.5.3
type SpiderSecurityRuleReqInfoWrapper struct {
ConnectionName string
ReqInfo SpiderSecurityRuleReqInfoIntermediateWrapper
}
SpiderSecurityRuleReqInfoWrapper is a wrapper struct to create JSON body of 'Create security rule'
type SpiderSpecInfo ¶
type SpiderSpecInfo struct {
Region string
Name string
VCpu SpiderVCpuInfo
Mem string
Gpu []SpiderGpuInfo
KeyValueList []common.KeyValue
}
SpiderSpecInfo is a struct to create JSON body of 'Get spec request'
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"`
}
SpiderSpecList is a struct to handle spec list from the CB-Spider's REST API response
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 SpiderSubnetInfo struct {
IId common.IID // {NameId, SystemId}
IPv4_CIDR string
KeyValueList []common.KeyValue
}
SpiderSubnetInfo is a struct to handle subnet information from the CB-Spider's REST API response
type SpiderSubnetReqInfo ¶
type SpiderSubnetReqInfo struct {
Name string `validate:"required"`
IPv4_CIDR string `validate:"required"`
KeyValueList []common.KeyValue
}
SpiderSubnetReqInfo is a struct to create JSON body of 'Create subnet request'
type SpiderSubnetReqInfoWrapper ¶ added in v0.4.10
type SpiderSubnetReqInfoWrapper struct {
ConnectionName string
ReqInfo SpiderSubnetReqInfo
}
SpiderSubnetReqInfoWrapper is a wrapper struct to create JSON body of 'Create subnet request'
type SpiderVCpuInfo ¶
SpiderVCpuInfo is a struct to handle vCPU Info from CB-Spider.
type SpiderVPCInfo ¶
type SpiderVPCInfo struct {
IId common.IID // {NameId, SystemId}
IPv4_CIDR string
SubnetInfoList []SpiderSubnetInfo
KeyValueList []common.KeyValue
}
SpiderVPCInfo is a struct to handle VPC information from the CB-Spider's REST API response
type SpiderVPCReqInfo ¶
type SpiderVPCReqInfo struct {
Name string
IPv4_CIDR string
SubnetInfoList []SpiderSubnetReqInfo
CSPId string
}
SpiderVPCReqInfo is a struct to create JSON body of 'Create VPC request'
type SpiderVPCReqInfoWrapper ¶
type SpiderVPCReqInfoWrapper struct {
ConnectionName string
ReqInfo SpiderVPCReqInfo
}
SpiderVPCReqInfoWrapper is a wrapper struct to create JSON body of 'Create VPC request'
type TbFirewallRuleInfo ¶ added in v0.5.3
type TbFirewallRuleInfo struct {
FromPort string `validate:"required"` //`json:"fromPort"`
ToPort string `validate:"required"` //`json:"toPort"`
IPProtocol string `validate:"required"` //`json:"ipProtocol"`
Direction string `validate:"required"` //`json:"direction"`
CIDR string
}
TbFirewallRuleInfo is a struct to handle firewall rule info of CB-Tumblebug.
type TbImageInfo ¶
type TbImageInfo struct {
Namespace string `json:"namespace,omitempty"` // required to save in RDB
Id string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
ConnectionName string `json:"connectionName,omitempty"`
CspImageId string `json:"cspImageId,omitempty"`
CspImageName string `json:"cspImageName,omitempty"`
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,omitempty"`
IsAutoGenerated bool `json:"isAutoGenerated,omitempty"`
// SystemLabel is for describing the MCIR in a keyword (any string can be used) for special System purpose
SystemLabel string `json:"systemLabel,omitempty" example:"Managed by CB-Tumblebug" default:""`
}
TbImageInfo is a struct that represents TB image object.
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 ¶ added in v0.2.8
func SearchImage(nsId string, keywords ...string) ([]TbImageInfo, error)
SearchImage accepts arbitrary number of keywords, and returns the list of matched TB image objects
func UpdateImage ¶ added in v0.4.10
func UpdateImage(nsId string, imageId string, fieldsToUpdate TbImageInfo) (TbImageInfo, error)
UpdateImage accepts to-be TB image objects, updates and returns the updated TB image objects
type TbImageReq ¶
type TbImageReq struct {
Name string `json:"name" validate:"required"`
ConnectionName string `json:"connectionName" validate:"required"`
CspImageId string `json:"cspImageId" validate:"required"`
Description string `json:"description"`
}
TbImageReq is a struct to handle 'Register image' request toward CB-Tumblebug.
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 []TbFirewallRuleInfo `json:"firewallRules"`
CspSecurityGroupId string `json:"cspSecurityGroupId"`
CspSecurityGroupName string `json:"cspSecurityGroupName"`
KeyValueList []common.KeyValue `json:"keyValueList"`
AssociatedObjectList []string `json:"associatedObjectList"`
IsAutoGenerated bool `json:"isAutoGenerated"`
// SystemLabel is for describing the MCIR in a keyword (any string can be used) for special System purpose
SystemLabel string `json:"systemLabel" example:"Managed by CB-Tumblebug" default:""`
}
TbSecurityGroupInfo is a struct that represents TB security group object.
func CreateFirewallRules ¶ added in v0.5.3
func CreateFirewallRules(nsId string, securityGroupId string, req []TbFirewallRuleInfo, objectOnly bool) (TbSecurityGroupInfo, error)
CreateFirewallRules accepts firewallRule creation request, creates and returns an TB securityGroup object
func CreateSecurityGroup ¶
func CreateSecurityGroup(nsId string, u *TbSecurityGroupReq, option string) (TbSecurityGroupInfo, error)
CreateSecurityGroup accepts SG creation request, creates and returns an TB SG object
func DeleteFirewallRules ¶ added in v0.5.3
func DeleteFirewallRules(nsId string, securityGroupId string, req []TbFirewallRuleInfo) (TbSecurityGroupInfo, error)
DeleteFirewallRules accepts firewallRule creation request, creates and returns an TB securityGroup object
type TbSecurityGroupReq ¶
type TbSecurityGroupReq struct {
Name string `json:"name" validate:"required"`
ConnectionName string `json:"connectionName" validate:"required"`
VNetId string `json:"vNetId" validate:"required"`
Description string `json:"description"`
FirewallRules *[]TbFirewallRuleInfo `json:"firewallRules"` // validate:"required"`
// CspSecurityGroupId is required to register object from CSP (option=register)
CspSecurityGroupId string `json:"cspSecurityGroupId"`
}
TbSecurityGroupReq is a struct to handle 'Create security group' request toward CB-Tumblebug.
type TbSpecInfo ¶
type TbSpecInfo struct {
Namespace string `json:"namespace,omitempty"` // required to save in RDB
Id string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
ConnectionName string `json:"connectionName,omitempty"`
ProviderName string `json:"providerName,omitempty"`
RegionName string `json:"regionName,omitempty"`
CspSpecName string `json:"cspSpecName,omitempty"`
OsType string `json:"osType,omitempty"`
NumvCPU uint16 `json:"numvCPU,omitempty"`
NumCore uint16 `json:"numCore,omitempty"`
MemGiB float32 `json:"memGiB,omitempty"`
StorageGiB uint32 `json:"storageGiB,omitempty"`
Description string `json:"description,omitempty"`
CostPerHour float32 `json:"costPerHour,omitempty"`
NumStorage uint8 `json:"numStorage,omitempty"`
MaxNumStorage uint8 `json:"maxNumStorage,omitempty"`
MaxTotalStorageTiB uint16 `json:"maxTotalStorageTiB,omitempty"`
NetBwGbps uint16 `json:"netBwGbps,omitempty"`
EbsBwMbps uint32 `json:"ebsBwMbps,omitempty"`
GpuModel string `json:"gpuModel,omitempty"`
NumGpu uint8 `json:"numGpu,omitempty"`
GpuMemGiB float32 `json:"gpuMemGiB,omitempty"`
GpuP2p string `json:"gpuP2p,omitempty"`
OrderInFilteredResult uint16 `json:"orderInFilteredResult,omitempty"`
EvaluationStatus string `json:"evaluationStatus,omitempty"`
EvaluationScore01 float32 `json:"evaluationScore01"`
EvaluationScore02 float32 `json:"evaluationScore02"`
EvaluationScore03 float32 `json:"evaluationScore03"`
EvaluationScore04 float32 `json:"evaluationScore04"`
EvaluationScore05 float32 `json:"evaluationScore05"`
EvaluationScore06 float32 `json:"evaluationScore06"`
EvaluationScore07 float32 `json:"evaluationScore07"`
EvaluationScore08 float32 `json:"evaluationScore08"`
EvaluationScore09 float32 `json:"evaluationScore09"`
EvaluationScore10 float32 `json:"evaluationScore10"`
RootDiskType string `json:"rootDiskType"`
RootDiskSize string `json:"rootDiskSize"`
AssociatedObjectList []string `json:"associatedObjectList,omitempty"`
IsAutoGenerated bool `json:"isAutoGenerated,omitempty"`
// SystemLabel is for describing the MCIR in a keyword (any string can be used) for special System purpose
SystemLabel string `json:"systemLabel,omitempty" example:"Managed by CB-Tumblebug" default:""`
}
TbSpecInfo is a struct that represents TB spec object.
func ConvertSpiderSpecToTumblebugSpec ¶
func ConvertSpiderSpecToTumblebugSpec(spiderSpec SpiderSpecInfo) (TbSpecInfo, error)
ConvertSpiderSpecToTumblebugSpec accepts an Spider spec object, converts to and returns an TB spec object
func FilterSpecs ¶ added in v0.2.8
func FilterSpecs(nsId string, filter TbSpecInfo) ([]TbSpecInfo, error)
FilterSpecs accepts criteria for filtering, and returns the list of filtered TB spec objects
func FilterSpecsByRange ¶ added in v0.2.8
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 ¶ added in v0.2.8
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 ¶ added in v0.2.8
func UpdateSpec(nsId string, specId string, fieldsToUpdate TbSpecInfo) (TbSpecInfo, error)
UpdateSpec accepts to-be TB spec objects, updates and returns the updated TB spec objects
type TbSpecReq ¶
type TbSpecReq struct {
Name string `json:"name" validate:"required"`
ConnectionName string `json:"connectionName" validate:"required"`
CspSpecName string `json:"cspSpecName" validate:"required"`
Description string `json:"description"`
}
TbSpecReq is a struct to handle 'Register spec' request toward CB-Tumblebug.
type TbSshKeyInfo ¶
type TbSshKeyInfo struct {
Id string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
ConnectionName string `json:"connectionName,omitempty"`
Description string `json:"description,omitempty"`
// CspSshKeyId used for CSP-native identifier (either Name or ID)
CspSshKeyId string `json:"cspSshKeyId,omitempty"`
// CspSshKeyName used for CB-Spider identifier
CspSshKeyName string `json:"cspSshKeyName,omitempty"`
Fingerprint string `json:"fingerprint,omitempty"`
Username string `json:"username,omitempty"`
VerifiedUsername string `json:"verifiedUsername,omitempty"`
PublicKey string `json:"publicKey,omitempty"`
PrivateKey string `json:"privateKey,omitempty"`
KeyValueList []common.KeyValue `json:"keyValueList,omitempty"`
AssociatedObjectList []string `json:"associatedObjectList,omitempty"`
IsAutoGenerated bool `json:"isAutoGenerated,omitempty"`
// SystemLabel is for describing the MCIR in a keyword (any string can be used) for special System purpose
SystemLabel string `json:"systemLabel,omitempty" example:"Managed by CB-Tumblebug" default:""`
}
TbSshKeyInfo is a struct that represents TB SSH key object.
func CreateSshKey ¶
func CreateSshKey(nsId string, u *TbSshKeyReq, option string) (TbSshKeyInfo, error)
CreateSshKey accepts SSH key creation request, creates and returns an TB sshKey object
func UpdateSshKey ¶ added in v0.5.1
func UpdateSshKey(nsId string, sshKeyId string, fieldsToUpdate TbSshKeyInfo) (TbSshKeyInfo, error)
UpdateSshKey accepts to-be TB sshKey objects, updates and returns the updated TB sshKey objects
type TbSshKeyReq ¶
type TbSshKeyReq struct {
Name string `json:"name" validate:"required"`
ConnectionName string `json:"connectionName" validate:"required"`
Description string `json:"description"`
// Fields for "Register existing SSH keys" feature
// CspSshKeyId is required to register object from CSP (option=register)
CspSshKeyId string `json:"cspSshKeyId"`
Fingerprint string `json:"fingerprint"`
Username string `json:"username"`
VerifiedUsername string `json:"verifiedUsername"`
PublicKey string `json:"publicKey"`
PrivateKey string `json:"privateKey"`
}
TbSshKeyReq is a struct to handle 'Create SSH key' request toward CB-Tumblebug.
type TbSubnetInfo ¶ added in v0.4.10
type TbSubnetInfo struct {
Id string
Name string `validate:"required"`
IPv4_CIDR string `validate:"required"`
KeyValueList []common.KeyValue
Description string
}
TbSubnetInfo is a struct that represents TB subnet object.
type TbSubnetReq ¶ added in v0.4.10
type TbSubnetReq struct {
Name string `validate:"required"`
IPv4_CIDR string `validate:"required"`
KeyValueList []common.KeyValue
Description string
}
TbSubnetReq is a struct that represents TB subnet object.
type TbVNetInfo ¶
type TbVNetInfo struct {
Id string `json:"id"`
Name string `json:"name"`
ConnectionName string `json:"connectionName"`
CidrBlock string `json:"cidrBlock"`
SubnetInfoList []TbSubnetInfo `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"`
// SystemLabel is for describing the MCIR in a keyword (any string can be used) for special System purpose
SystemLabel string `json:"systemLabel" example:"Managed by CB-Tumblebug" default:""`
}
TbVNetInfo is a struct that represents TB vNet object.
func CreateSubnet ¶ added in v0.4.10
func CreateSubnet(nsId string, vNetId string, req TbSubnetReq, objectOnly bool) (TbVNetInfo, error)
CreateSubnet accepts subnet creation request, creates and returns an TB vNet object
func CreateVNet ¶
func CreateVNet(nsId string, u *TbVNetReq, option string) (TbVNetInfo, error)
CreateVNet accepts vNet creation request, creates and returns an TB vNet object
type TbVNetReq ¶
type TbVNetReq struct {
Name string `json:"name" validate:"required"`
ConnectionName string `json:"connectionName" validate:"required"`
CidrBlock string `json:"cidrBlock"`
SubnetInfoList []TbSubnetReq `json:"subnetInfoList"`
Description string `json:"description"`
CspVNetId string `json:"cspVNetId"`
}
TbVNetReq is a struct to handle 'Create vNet' request toward CB-Tumblebug.