resources

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 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
	Mfr   string
	Model string
	Mem   string
}

type IID added in v0.1.2

type IID struct {
	NameId   string // NameID by user
	SystemId string // SystemID by CloudOS
}

Integrated-ID consisting of User's ID and CloudOS's ID

type ImageHandler

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

type ImageInfo

type ImageInfo struct {
	IId     IID    // {NameId, SystemId}
	GuestOS string // Windows7, Ubuntu etc.
	Status  string // available, unavailable

	KeyValueList []KeyValue
}

type ImageReqInfo

type ImageReqInfo struct {
	IId IID // {NameId, SystemId}

}

type KeyPairHandler

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

type KeyPairInfo

type KeyPairInfo struct {
	IId         IID // {NameId, SystemId}
	Fingerprint string
	PublicKey   string
	PrivateKey  string
	VMUserID    string

	KeyValueList []KeyValue
}

type KeyPairReqInfo

type KeyPairReqInfo struct {
	IId IID // {NameId, SystemId}
}

type KeyValue

type KeyValue struct {
	Key   string
	Value string
}

type RegionInfo

type RegionInfo struct {
	Region string
	Zone   string
}

type SecurityHandler

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

type SecurityInfo

type SecurityInfo struct {
	IId IID // {NameId, SystemId}

	VpcIID        IID    // {NameId, SystemId}
	Direction     string // @todo userd??
	SecurityRules *[]SecurityRuleInfo

	KeyValueList []KeyValue
}

type SecurityReqInfo

type SecurityReqInfo struct {
	IId IID // {NameId, SystemId}

	VpcIID        IID    // {NameId, SystemId}
	Direction     string // @todo used??
	SecurityRules *[]SecurityRuleInfo
}

type SecurityRuleInfo

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

@definitionAlias cres.SecurityRuleInfo

type SubnetInfo added in v0.1.3

type SubnetInfo struct {
	IId       IID // {NameId, SystemId}
	IPv4_CIDR string

	KeyValueList []KeyValue
}

type VCpuInfo

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

type VMHandler

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

	SuspendVM(vmIID IID) (VMStatus, error)
	ResumeVM(vmIID IID) (VMStatus, error)
	RebootVM(vmIID IID) (VMStatus, error)
	TerminateVM(vmIID IID) (VMStatus, error)

	ListVMStatus() ([]*VMStatusInfo, error)
	GetVMStatus(vmIID IID) (VMStatus, error)

	ListVM() ([]*VMInfo, error)
	GetVM(vmIID IID) (VMInfo, error)
}

type VMInfo

type VMInfo struct {
	IId       IID       // {NameId, SystemId}
	StartTime time.Time // Timezone: based on cloud-barista server location.

	Region            RegionInfo //  ex) {us-east1, us-east1-c} or {ap-northeast-2}
	ImageIId          IID
	VMSpecName        string //  instance type or flavour, etc... ex) t2.micro or f1.micro
	VpcIID            IID
	SubnetIID         IID   // AWS, ex) subnet-8c4a53e4
	SecurityGroupIIds []IID // AWS, ex) sg-0b7452563e1121bb6

	KeyPairIId IID

	VMUserId     string // ex) user1
	VMUserPasswd string

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

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

	SSHAccessPoint string // ex) 10.2.3.2:22, 123.456.789.123:4321

	KeyValueList []KeyValue
}

type VMReqInfo

type VMReqInfo struct {
	IId IID // {NameId, SystemId}

	ImageIID          IID
	VpcIID            IID
	SubnetIID         IID
	SecurityGroupIIDs []IID

	VMSpecName string
	KeyPairIID IID

	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 {
	IId      IID // {NameId, SystemId}
	VmStatus VMStatus
}

type VPCHandler added in v0.1.3

type VPCHandler interface {
	CreateVPC(vpcReqInfo VPCReqInfo) (VPCInfo, error)
	ListVPC() ([]*VPCInfo, error)
	GetVPC(vpcIID IID) (VPCInfo, error)
	DeleteVPC(vpcIID IID) (bool, error)

	AddSubnet(vpcIID IID, subnetInfo SubnetInfo) (VPCInfo, error)
	RemoveSubnet(vpcIID IID, subnetIID IID) (bool, error)
}

type VPCInfo added in v0.1.3

type VPCInfo struct {
	IId            IID // {NameId, SystemId}
	IPv4_CIDR      string
	SubnetInfoList []SubnetInfo

	KeyValueList []KeyValue
}

type VPCReqInfo added in v0.1.3

type VPCReqInfo struct {
	IId            IID // {NameId, SystemId}
	IPv4_CIDR      string
	SubnetInfoList []SubnetInfo
}

Jump to

Keyboard shortcuts

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