resources

package
v0.0.0-...-9c72d28 Latest Latest
Warning

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

Go to latest
Published: May 29, 2020 License: Apache-2.0, Apache-2.0, Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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) // AWS는 keyPairName
	DeleteKey(keyName string) (bool, error)     // AWS는 keyPairName
}

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 // AWS : Name Tag대신 AllocationId를 리턴 함.(편의를 위해 Name 정보는 KeyValueList에 전달 함.), OpenStack : 381a10f8-5831-4822-8388-922673addde4(ID), Cloudit : 182.252.135.44(IP)
	Id        string // AWS : Name에는 NameId가 설정되기 때문에 삭제를 위해 Id 필드 추가
	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 // GCP 는 하나에 한개의 Direction만 생성/조회 가능
	SecurityRules *[]SecurityRuleInfo

	KeyValueList []KeyValue
}

type SecurityReqInfo

type SecurityReqInfo struct {
	Name          string
	Direction     string // GCP 는 하나에 한개의 Direction만 생성/조회 가능
	SecurityRules *[]SecurityRuleInfo
}

type SecurityRuleInfo

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

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    // AWS,
	Id        string    // AWS,
	StartTime time.Time // Timezone: based on cloud-barista server location.

	Region           RegionInfo // AWS, ex) {us-east1, us-east1-c} or {ap-northeast-2}
	ImageId          string
	VMSpecId         string   // AWS, 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 // ex) AWS, 13.125.43.21
	PublicDNS          string // ex) AWS, ec2-13-125-43-0.ap-northeast-2.compute.amazonaws.com
	PrivateIP          string // ex) AWS, ip-172-31-4-60.ap-northeast-2.compute.internal
	PrivateDNS         string // ex) AWS, 172.31.4.60

	KeyPairName  string // ex) AWS, powerkimKeyPair
	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 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 // ex) OpenStack, 0b108f81-f2a7-4fb7-bae3-fe5544b0b1d0
	SecurityGroupIds []string
	PublicIPid       string
}

Jump to

Keyboard shortcuts

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