mcir

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DelAllResources

func DelAllResources(nsId string, resourceType string, forceFlag string) error

func DelRecommendSpec

func DelRecommendSpec(nsId string, specId string, cpuSize string, memSize string, diskSize string) error

func DelResource

func DelResource(nsId string, resourceType string, resourceId string, forceFlag string) error

func DelResource(nsId string, resourceType string, resourceId string, forceFlag string) (int, []byte, error) {

func FetchImages

func FetchImages(nsId string) (connConfigCount uint, imageCount uint, err error)

func FetchSpecs

func FetchSpecs(nsId string) (connConfigCount uint, specCount uint, err error)

func GetNameFromStruct

func GetNameFromStruct(u interface{}) string

func GetResource

func GetResource(nsId string, resourceType string, resourceId string) (interface{}, error)

func ListResource

func ListResource(nsId string, resourceType string) (interface{}, error)

func ListResourceId

func ListResourceId(nsId string, resourceType string) []string

func LowerizeAndCheckResource

func LowerizeAndCheckResource(nsId string, resourceType string, resourceId string) (bool, string, error)

func RegisterRecommendList

func RegisterRecommendList(nsId string, connectionName string, cpuSize string, memSize string, diskSize string, specId string, price string) error

Types

type NameOnly

type NameOnly struct {
	Name string
}

type ReturnValue

type ReturnValue struct {
	CustomStruct interface{}
}

type SpiderGpuInfo

type SpiderGpuInfo struct {
	Count string
	Mfr   string
	Model string
	Mem   string
}

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)

type SpiderImageList

type SpiderImageList struct {
	Image []SpiderImageInfo `json:"image"`
}

func LookupImageList

func LookupImageList(connConfig string) (SpiderImageList, error)

type SpiderImageReqInfoWrapper

type SpiderImageReqInfoWrapper struct {
	ConnectionName string
	ReqInfo        SpiderImageInfo
}

type SpiderKeyPairInfo

type SpiderKeyPairInfo struct {
	// Fields for request
	Name string

	// Fields for response
	IId          common.IID // {NameId, SystemId}
	Fingerprint  string
	PublicKey    string
	PrivateKey   string
	VMUserID     string
	KeyValueList []common.KeyValue
}

type SpiderKeyPairReqInfoWrapper

type SpiderKeyPairReqInfoWrapper struct {
	ConnectionName string
	ReqInfo        SpiderKeyPairInfo
}

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 SpiderSecurityRuleInfo struct {
	FromPort   string `json:"fromPort"`
	ToPort     string `json:"toPort"`
	IPProtocol string `json:"ipProtocol"`
	Direction  string `json:"direction"`
}

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)

func LookupSpec(u *TbSpecInfo) (SpiderSpecInfo, error) {

type SpiderSpecList

type SpiderSpecList struct {
	Vmspec []SpiderSpecInfo `json:"vmspec"`
}

func LookupSpecList

func LookupSpecList(connConfig string) (SpiderSpecList, error)

type SpiderSubnetInfo

type SpiderSubnetInfo struct {
	IId          common.IID // {NameId, SystemId}
	IPv4_CIDR    string
	KeyValueList []common.KeyValue
}

type SpiderSubnetReqInfo

type SpiderSubnetReqInfo struct {
	Name         string
	IPv4_CIDR    string
	KeyValueList []common.KeyValue
}

type SpiderVCpuInfo

type SpiderVCpuInfo struct {
	Count string
	Clock string // GHz
}

type SpiderVPCInfo

type SpiderVPCInfo struct {
	IId            common.IID // {NameId, SystemId}
	IPv4_CIDR      string
	SubnetInfoList []SpiderSubnetInfo
	KeyValueList   []common.KeyValue
}

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 {
	Id             string            `json:"id"`
	Name           string            `json:"name"`
	ConnectionName string            `json:"connectionName"`
	CspImageId     string            `json:"cspImageId"`
	CspImageName   string            `json:"cspImageName"`
	Description    string            `json:"description"`
	CreationDate   string            `json:"creationDate"`
	GuestOS        string            `json:"guestOS"` // Windows7, Ubuntu etc.
	Status         string            `json:"status"`  // available, unavailable
	KeyValueList   []common.KeyValue `json:"keyValueList"`
}

func ConvertSpiderImageToTumblebugImage

func ConvertSpiderImageToTumblebugImage(spiderImage SpiderImageInfo) (TbImageInfo, error)

func RegisterImageWithId

func RegisterImageWithId(nsId string, u *TbImageReq) (TbImageInfo, error)

func RegisterImageWithInfo

func RegisterImageWithInfo(nsId string, content *TbImageInfo) (TbImageInfo, error)

type TbImageReq

type TbImageReq struct {
	Name           string `json:"name"`
	ConnectionName string `json:"connectionName"`
	CspImageId     string `json:"cspImageId"`
	Description    string `json:"description"`
}

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"`
}

func CreateSecurityGroup

func CreateSecurityGroup(nsId string, u *TbSecurityGroupReq) (TbSecurityGroupInfo, error)

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 {
	Id                    string `json:"id"`
	Name                  string `json:"name"`
	ConnectionName        string `json:"connectionName"`
	CspSpecName           string `json:"cspSpecName"`
	Os_type               string `json:"os_type"`
	Num_vCPU              string `json:"num_vCPU"`
	Num_core              string `json:"num_core"`
	Mem_GiB               string `json:"mem_GiB"`
	Mem_MiB               string `json:"mem_MiB"`
	Storage_GiB           string `json:"storage_GiB"`
	Description           string `json:"description"`
	Cost_per_hour         string `json:"cost_per_hour"`
	Num_storage           string `json:"num_storage"`
	Max_num_storage       string `json:"max_num_storage"`
	Max_total_storage_TiB string `json:"max_total_storage_TiB"`
	Net_bw_Gbps           string `json:"net_bw_Gbps"`
	Ebs_bw_Mbps           string `json:"ebs_bw_Mbps"`
	Gpu_model             string `json:"gpu_model"`
	Num_gpu               string `json:"num_gpu"`
	Gpumem_GiB            string `json:"gpumem_GiB"`
	Gpu_p2p               string `json:"gpu_p2p"`
}

func ConvertSpiderSpecToTumblebugSpec

func ConvertSpiderSpecToTumblebugSpec(spiderSpec SpiderSpecInfo) (TbSpecInfo, error)

func RegisterSpecWithCspSpecName

func RegisterSpecWithCspSpecName(nsId string, u *TbSpecReq) (TbSpecInfo, error)

func RegisterSpecWithInfo

func RegisterSpecWithInfo(nsId string, content *TbSpecInfo) (TbSpecInfo, error)

type TbSpecReq

type TbSpecReq struct {
	Name           string `json:"name"`
	ConnectionName string `json:"connectionName"`
	CspSpecName    string `json:"cspSpecName"`
	Description    string `json:"description"`
}

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"`
	PublicKey      string            `json:"publicKey"`
	PrivateKey     string            `json:"privateKey"`
	KeyValueList   []common.KeyValue `json:"keyValueList"`
}

func CreateSshKey

func CreateSshKey(nsId string, u *TbSshKeyReq) (TbSshKeyInfo, error)

type TbSshKeyReq

type TbSshKeyReq struct {
	Name           string `json:"name"`
	ConnectionName string `json:"connectionName"`
	Description    string `json:"description"`
}

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"`
}

func CreateVNet

func CreateVNet(nsId string, u *TbVNetReq) (TbVNetInfo, error)

type TbVNetReq

type TbVNetReq struct {
	Name           string                `json:"name"`
	ConnectionName string                `json:"connectionName"`
	CidrBlock      string                `json:"cidrBlock"`
	SubnetInfoList []SpiderSubnetReqInfo `json:"subnetInfoList"`
	Description    string                `json:"description"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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