resources

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GpuInfo

type GpuInfo struct {
	Count string //  오타로 보여 수정 Conut => Count
	Mfr   string
	Model string
	Mem   string
}

type ImageHandler

type ImageHandler interface {
	CreateImage(imageReqInfo ImageReqInfo) (ImageInfo, error)
	ListImage() ([]*ImageInfo, error)
	GetImage(imageID string) (ImageInfo, error)
	DeleteImage(imageID string) (bool, error)
}

type ImageInfo

type ImageInfo struct {
	Id      string
	Name    string
	GuestOS string // Windows7, Ubuntu etc.
	Status  string // available, unavailable

	KeyValueList []KeyValue
}

type ImageReqInfo

type ImageReqInfo struct {
	Name string
	Id   string
}

type KeyPairHandler

type KeyPairHandler interface {
	CreateKey(keyPairReqInfo KeyPairReqInfo) (KeyPairInfo, error)
	ListKey() ([]*KeyPairInfo, error)
	GetKey(keyName string) (KeyPairInfo, error)
	DeleteKey(keyName string) (bool, error)
}

type KeyPairInfo

type KeyPairInfo struct {
	Name        string
	Fingerprint string
	PublicKey   string
	PrivateKey  string
	VMUserID    string

	KeyValueList []KeyValue
}

type KeyPairReqInfo

type KeyPairReqInfo struct {
	Name string
}

type KeyValue

type KeyValue struct {
	Key   string
	Value string
}

type PublicIPHandler

type PublicIPHandler interface {
	CreatePublicIP(publicIPReqInfo PublicIPReqInfo) (PublicIPInfo, error)
	ListPublicIP() ([]*PublicIPInfo, error)
	GetPublicIP(publicIPID string) (PublicIPInfo, error)
	DeletePublicIP(publicIPID string) (bool, error)
}

type PublicIPInfo

type PublicIPInfo struct {
	Name      string
	Id        string
	PublicIP  string
	OwnedVMID string
	Status    string

	KeyValueList []KeyValue
}

type PublicIPReqInfo

type PublicIPReqInfo struct {
	Name         string
	KeyValueList []KeyValue
}

type RegionInfo

type RegionInfo struct {
	Region string
	Zone   string
}

type SecurityHandler

type SecurityHandler interface {
	CreateSecurity(securityReqInfo SecurityReqInfo) (SecurityInfo, error)
	ListSecurity() ([]*SecurityInfo, error)
	GetSecurity(securityID string) (SecurityInfo, error)
	DeleteSecurity(securityID string) (bool, error)
}

type SecurityInfo

type SecurityInfo struct {
	Id            string
	Name          string
	Direction     string
	SecurityRules *[]SecurityRuleInfo

	KeyValueList []KeyValue
}

type SecurityReqInfo

type SecurityReqInfo struct {
	Name          string
	Direction     string
	SecurityRules *[]SecurityRuleInfo
}

type SecurityRuleInfo

type SecurityRuleInfo struct {
	FromPort   string
	ToPort     string
	IPProtocol string
	Direction  string
}

type VCpuInfo

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

type VMHandler

type VMHandler interface {
	StartVM(vmReqInfo VMReqInfo) (VMInfo, error)

	SuspendVM(vmID string) (VMStatus, error)
	ResumeVM(vmID string) (VMStatus, error)
	RebootVM(vmID string) (VMStatus, error)
	TerminateVM(vmID string) (VMStatus, error)

	ListVMStatus() ([]*VMStatusInfo, error)
	GetVMStatus(vmID string) (VMStatus, error)

	ListVM() ([]*VMInfo, error)
	GetVM(vmID string) (VMInfo, error)
}

type VMInfo

type VMInfo struct {
	Name      string
	Id        string
	StartTime time.Time // Timezone: based on cloud-barista server location.

	Region           RegionInfo //  ex) {us-east1, us-east1-c} or {ap-northeast-2}
	ImageId          string
	VMSpecId         string   //  instance type or flavour, etc... ex) t2.micro or f1.micro
	VirtualNetworkId string   // AWS, ex) subnet-8c4a53e4
	SecurityGroupIds []string // AWS, ex) sg-0b7452563e1121bb6

	NetworkInterfaceId string // ex) eth0
	PublicIP           string
	PublicDNS          string
	PrivateIP          string
	PrivateDNS         string

	KeyPairName  string
	VMUserId     string // ex) user1
	VMUserPasswd string

	VMBootDisk  string // ex) /dev/sda1
	VMBlockDisk string // ex)

	KeyValueList []KeyValue
}

type VMReqInfo

type VMReqInfo struct {
	VMName string

	ImageId            string
	VirtualNetworkId   string
	NetworkInterfaceId string
	PublicIPId         string
	SecurityGroupIds   []string

	VMSpecId string

	KeyPairName  string
	VMUserId     string
	VMUserPasswd string
}

type VMSpecHandler

type VMSpecHandler interface {

	// Region: AWS=Region, GCP=Zone, Azure=Location
	ListVMSpec(Region string) ([]*VMSpecInfo, error)
	GetVMSpec(Region string, Name string) (VMSpecInfo, error)

	ListOrgVMSpec(Region string) (string, error)             // return string: json format
	GetOrgVMSpec(Region string, Name string) (string, error) // return string: json format
}

type VMSpecInfo

type VMSpecInfo struct {
	Region string
	Name   string
	VCpu   VCpuInfo
	Mem    string
	Gpu    []GpuInfo

	KeyValueList []KeyValue
}

type VMStatus

type VMStatus string

GO do not support Enum. So, define like this.

const (
	Creating VMStatus = "Creating" // from launch to running
	Running  VMStatus = "Running"

	Suspending VMStatus = "Suspending" // from running to suspended
	Suspended  VMStatus = "Suspended"
	Resuming   VMStatus = "Resuming" // from suspended to running

	Rebooting VMStatus = "Rebooting" // from running to running

	Terminating VMStatus = "Terminating" // from running, suspended to terminated
	Terminated  VMStatus = "Terminated"
	NotExist    VMStatus = "NotExist" // VM does not exist

	Failed VMStatus = "Failed"
)

type VMStatusInfo

type VMStatusInfo struct {
	VmId     string
	VmName   string
	VmStatus VMStatus
}

type VNetworkHandler

type VNetworkHandler interface {
	CreateVNetwork(vNetworkReqInfo VNetworkReqInfo) (VNetworkInfo, error)
	ListVNetwork() ([]*VNetworkInfo, error)
	GetVNetwork(vNetworkID string) (VNetworkInfo, error)
	DeleteVNetwork(vNetworkID string) (bool, error)
}

type VNetworkInfo

type VNetworkInfo struct {
	Id            string
	Name          string
	AddressPrefix string
	Status        string

	KeyValueList []KeyValue
}

type VNetworkReqInfo

type VNetworkReqInfo struct {
	Name string
}

type VNicHandler

type VNicHandler interface {
	CreateVNic(vNicReqInfo VNicReqInfo) (VNicInfo, error)
	ListVNic() ([]*VNicInfo, error)
	GetVNic(vNicID string) (VNicInfo, error)
	DeleteVNic(vNicID string) (bool, error)
}

type VNicInfo

type VNicInfo struct {
	Id               string
	Name             string
	PublicIP         string
	MacAddress       string
	OwnedVMID        string
	SecurityGroupIds []string
	Status           string

	KeyValueList []KeyValue
}

type VNicReqInfo

type VNicReqInfo struct {
	Name             string
	VNetName         string
	VNetId           string
	SecurityGroupIds []string
	PublicIPid       string
}

Jump to

Keyboard shortcuts

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