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 {
	//2차 인터페이스
	Id      string
	Name    string
	GuestOS string // Windows7, Ubuntu etc.
	Status  string // available, unavailable

	KeyValueList []KeyValue
}

type ImageReqInfo

type ImageReqInfo struct {
	//2차 인터페이스
	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 {
	//2차 인터페이스
	Name        string
	Fingerprint string // 추가 - AWS, OpenStack
	PublicKey   string
	PrivateKey  string
	VMUserID    string

	KeyValueList []KeyValue

	// @todo - 삭제예정(1차 인터페이스 잔여 필드)
	Id          string
	KeyMaterial string // 추가 - AWS(PEM파일-RSA PRIVATE KEY)
}

type KeyPairReqInfo

type KeyPairReqInfo struct {
	//2차 인터페이스
	Name string

	// @todo - 삭제예정(1차 인터페이스 잔여 필드)
	Id string
}

type KeyValue

type KeyValue struct {
	Key   string
	Value string
}

type LoginInfo

type LoginInfo struct {
	AdminUsername string
	AdminPassword string
}

@todo - 삭제예정(1차 인터페이스 잔여 구조체)

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 {
	//2차 인터페이스
	Name      string
	PublicIP  string
	OwnedVMID string
	Status    string

	KeyValueList []KeyValue

	// @todo - 삭제예정(1차 인터페이스 잔여 필드)
	Id                      string
	Domain                  string // AWS
	PublicIp                string // AWS
	PublicIpv4Pool          string // AWS
	AllocationId            string // AWS:할당ID
	AssociationId           string // AWS:연결ID
	InstanceId              string // AWS:연결된 VM
	NetworkInterfaceId      string // AWS:연결된 Nic
	NetworkInterfaceOwnerId string // AWS
	PrivateIpAddress        string // AWS
}

type PublicIPReqInfo

type PublicIPReqInfo struct {
	//2차 인터페이스
	Name string

	// @todo - 삭제예정(1차 인터페이스 잔여 필드)
	Id string
}

type RegionInfo

type RegionInfo struct {
	Region string
	Zone   string
}

2차 인터페이스

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 {
	//2차 인터페이스
	Id            string
	Name          string
	SecurityRules *[]SecurityRuleInfo

	KeyValueList []KeyValue

	// @todo - 삭제예정(1차 인터페이스 잔여 필드)
	GroupName           string              //AWS
	GroupID             string              //AWS
	IPPermissions       []*SecurityRuleInfo //AWS:InBounds
	IPPermissionsEgress []*SecurityRuleInfo //AWS:OutBounds
	Description         string              //AWS
	VpcID               string              //AWS
	OwnerID             string              //AWS, Azure & OpenStack은 TenantId
}

type SecurityReqInfo

type SecurityReqInfo struct {
	//2차 인터페이스
	Name          string
	SecurityRules *[]SecurityRuleInfo

	// @todo - 삭제예정(1차 인터페이스 잔여 필드)
	Id                  string
	GroupName           string              //AWS
	Description         string              //AWS
	VpcId               string              //AWS
	IPPermissions       []*SecurityRuleInfo //AWS:InBounds
	IPPermissionsEgress []*SecurityRuleInfo //AWS:OutBounds
}

type SecurityRuleInfo

type SecurityRuleInfo struct {
	//2차 인터페이스
	FromPort   string
	ToPort     string
	IPProtocol string // tcp | udp | icmp | ...
	Direction  string // inbound | outbound

	// @todo - 삭제예정(1차 인터페이스 잔여 필드)
	Cidr string
}

type VMHandler

type VMHandler interface {
	StartVM(vmReqInfo VMReqInfo) (VMInfo, error)
	SuspendVM(vmID string)
	ResumeVM(vmID string)
	RebootVM(vmID string)
	TerminateVM(vmID string)

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

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

type VMInfo

type VMInfo struct {
	//2차 인터페이스
	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

	// @todo - 삭제예정(1차 인터페이스 잔여 필드)
	ImageID      string // AWS, ex) ami-047f7b46bd6dd5d84 or projects/gce-uefi-images/global/images/centos-7-v20190326
	SpecID       string // AWS, instance type or flavour, etc... ex) t2.micro or f1-micro
	VNetworkID   string // AWS, ex) vpc-23ed0a4b
	SubNetworkID string // AWS, ex) subnet-8c4a53e4
	SecurityID   string // AWS, ex) sg-0b7452563e1121bb6 - @todo AWS는 배열임

	VNIC         string // ex) eth0
	KeyPairID    string // ex) AWS, powerkimKeyPair
	GuestUserID  string // ex) user1
	GuestUserPwd string

	GuestBootDisk  string // ex) /dev/sda1
	GuestBlockDisk string // ex)

	AdditionalInfo string // Any information to be good for users and developers.
}

type VMReqInfo

type VMReqInfo struct {
	//2차 인터페이스
	VMName string

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

	VMSpecId string

	KeyPairName  string
	VMUserId     string
	VMUserPasswd string

	// @todo - 삭제예정(1차 인터페이스 잔여 필드)
	Name string

	ImageInfo    ImageInfo
	VNetworkInfo VNetworkInfo
	SecurityInfo SecurityInfo
	KeyPairInfo  KeyPairInfo
	SpecID       string // instance type or flavour, etc...

	PublicIPInfo PublicIPInfo
	LoginInfo    LoginInfo
	// contains filtered or unexported fields
}

type VMStatus

type VMStatus string

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

type VMStatusInfo

type VMStatusInfo struct {
	VmId     string
	VmStatus VMStatus
}

2차 인터페이스

type VNetworkHandler

type VNetworkHandler interface {
	CreateVNetwork(vNetworkReqInfo VNetworkReqInfo) (VNetworkInfo, error)
	ListVNetwork() ([]*VNetworkInfo, error) //@TODO : 여러 VPC에 속한 Subnet 목록을 조회하게되는데... 입력 아규먼트가 없고 맥락상 CB-Vnet의 서브넷만 조회해야할지 결정이 필요함. 현재는 1차 버전의 변경될 I/F 문맥상 CB-Vnet으로 내부적으로 제한해서 구현했음.
	GetVNetwork(vNetworkID string) (VNetworkInfo, error)
	DeleteVNetwork(vNetworkID string) (bool, error)
}

type VNetworkInfo

type VNetworkInfo struct {
	//2차 인터페이스
	Id            string
	Name          string
	AddressPrefix string
	Status        string

	KeyValueList []KeyValue

	// @todo - 삭제예정(1차 인터페이스 잔여 구조체)
	SubnetId  string // AWS에서는 이 필드에 Subnet ID할당
	CidrBlock string // AWS
	State     string // AWS

	MapPublicIpOnLaunch     bool   // AWS(향후 Map으로 변환?)
	AvailableIpAddressCount int64  // AWS(향후 Map으로 변환?)
	AvailabilityZone        string // AWS(향후 Map으로 변환?)
}

type VNetworkReqInfo

type VNetworkReqInfo struct {
	//2차 인터페이스
	Name string // AWS

	// @todo - 삭제예정(1차 인터페이스 잔여 구조체)
	Id        string
	CidrBlock string // AWS
}

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
}

2차 인터페이스 필드 반영

type VNicReqInfo

type VNicReqInfo struct {
	//2차 인터페이스
	Name             string
	VNetName         string
	SecurityGroupIds []string
	PublicIPid       string

	// @todo - 삭제예정(1차 인터페이스 잔여 구조체)
	Id string
}

Jump to

Keyboard shortcuts

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