resources

package
v0.8.12 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STG_Type                 string = "STG" // General HDD Type
	SSD_Type                 string = "SSD"
	DefaultDiskSize          string = "100"
	DefaultDiskUsagePlanType string = "hourly"
	DefaultDiskIOPS          string = "10000"
	DefaultWindowsDiskSize   string = "50"
	KOR_Seoul_M_ZoneID       string = "95e2f517-d64a-4866-8585-5177c256f7c7"
	KOR_Seoul_M2_ZoneID      string = "d7d0177e-6cda-404a-a46f-a5b356d2874e"
)
View Source
const (
	DefaultNLBOption      string = "roundrobin" // NLBOption : roundrobin / leastconnection / leastresponse / sourceiphash /
	DefaultHealthCheckURL string = "abc.kt.com"
)
View Source
const (
	API_v1 string = "https://api.ucloudbiz.olleh.com/server/v1/client/api"
	API_v2 string = "https://api.ucloudbiz.olleh.com/server/v2/client/api" // When Zone is 'KOR-Seoul M2' => uses API v2
)
View Source
const (
	LinuxUserName string = "cb-user"
	WinUserName   string = "Administrator"

	UbuntuCloudInitFilePath string = "/cloud-driver-libs/.cloud-init-ktcloud/cloud-init-ubuntu"
	CentosCloudInitFilePath string = "/cloud-driver-libs/.cloud-init-ktcloud/cloud-init-centos"
	WinCloudInitFilePath    string = "/cloud-driver-libs/.cloud-init-ktcloud/cloud-init-windows"

	DefaultVMUsagePlanType   string = "hourly" // KT Cloud Rate Type (default : hourly)
	LinuxDefaultRootDiskSize string = "20"
	WinDefaultRootDiskSize   string = "50"
)

Variables

This section is empty.

Functions

func CheckFolder

func CheckFolder(folderPath string) error

func CheckFolderAndCreate

func CheckFolderAndCreate(folderPath string) error

func ConvertJsonString

func ConvertJsonString(v interface{}) (string, error)

Cloud Object를 JSON String 타입으로 변환

func GetCallLogScheme

func GetCallLogScheme(zone string, resourceType call.RES_TYPE, resourceName string, apiName string) call.CLOUDLOGSCHEMA

func InitLog

func InitLog()

func LoggingError

func LoggingError(hiscallInfo call.CLOUDLOGSCHEMA, err error)

func LoggingInfo

func LoggingInfo(hiscallInfo call.CLOUDLOGSCHEMA, start time.Time)

func RunCommand

func RunCommand(cmdName string, cmdArgs []string) (string, error)

func String

func String(n int32) string

int32 to string 변환 : String(), int64 to string 변환 : strconv.Itoa()

Types

type DiskOffering added in v0.8.3

type DiskOffering struct {
	Type           string
	Size           string
	DiskOfferingId string
}

type IId

type IId struct {
	NameID   string `json:"NameId"`
	SystemID string `json:"SystemId"`
}

type KeyValue

type KeyValue struct {
	Key   string `json:"Key"`
	Value string `json:"Value"`
}

type KtCloudDiskHandler added in v0.8.2

type KtCloudDiskHandler struct {
	RegionInfo idrv.RegionInfo
	Client     *ktsdk.KtCloudClient
}

func (*KtCloudDiskHandler) AttachDisk added in v0.8.2

func (diskHandler *KtCloudDiskHandler) AttachDisk(diskIID irs.IID, vmIID irs.IID) (irs.DiskInfo, error)

func (*KtCloudDiskHandler) ChangeDiskSize added in v0.8.2

func (diskHandler *KtCloudDiskHandler) ChangeDiskSize(diskIID irs.IID, newDiskSize string) (bool, error)

$$$ Caution!!) This is only for Bootalbe Disk of a VM.

func (*KtCloudDiskHandler) CreateDisk added in v0.8.2

func (diskHandler *KtCloudDiskHandler) CreateDisk(diskReqInfo irs.DiskInfo) (irs.DiskInfo, error)

func (*KtCloudDiskHandler) DeleteDisk added in v0.8.2

func (diskHandler *KtCloudDiskHandler) DeleteDisk(diskIID irs.IID) (bool, error)

func (*KtCloudDiskHandler) DetachDisk added in v0.8.2

func (diskHandler *KtCloudDiskHandler) DetachDisk(diskIID irs.IID, vmIID irs.IID) (bool, error)

func (*KtCloudDiskHandler) GetDisk added in v0.8.2

func (diskHandler *KtCloudDiskHandler) GetDisk(diskIID irs.IID) (irs.DiskInfo, error)

func (*KtCloudDiskHandler) ListDisk added in v0.8.2

func (diskHandler *KtCloudDiskHandler) ListDisk() ([]*irs.DiskInfo, error)

### Caution!!) Except for the DISK(ROOT and DATADISK installed an OS) provided when creating VMs.

type KtCloudImageHandler

type KtCloudImageHandler struct {
	CredentialInfo idrv.CredentialInfo
	RegionInfo     idrv.RegionInfo
	Client         *ktsdk.KtCloudClient
}

func (*KtCloudImageHandler) CheckWindowsImage

func (imageHandler *KtCloudImageHandler) CheckWindowsImage(imageIID irs.IID) (bool, error)

func (*KtCloudImageHandler) CreateImage

func (imageHandler *KtCloudImageHandler) CreateImage(imageReqInfo irs.ImageReqInfo) (irs.ImageInfo, error)

func (*KtCloudImageHandler) DeleteImage

func (imageHandler *KtCloudImageHandler) DeleteImage(imageIID irs.IID) (bool, error)

func (*KtCloudImageHandler) GetImage

func (imageHandler *KtCloudImageHandler) GetImage(imageIID irs.IID) (irs.ImageInfo, error)

func (*KtCloudImageHandler) ListImage

func (imageHandler *KtCloudImageHandler) ListImage() ([]*irs.ImageInfo, error)

type KtCloudKeyPairHandler

type KtCloudKeyPairHandler struct {
	CredentialInfo idrv.CredentialInfo
	RegionInfo     idrv.RegionInfo
	Client         *ktsdk.KtCloudClient
}

func (*KtCloudKeyPairHandler) CreateKey

func (keyPairHandler *KtCloudKeyPairHandler) CreateKey(keyPairReqInfo irs.KeyPairReqInfo) (irs.KeyPairInfo, error)

func (*KtCloudKeyPairHandler) DeleteKey

func (keyPairHandler *KtCloudKeyPairHandler) DeleteKey(keyIID irs.IID) (bool, error)

func (*KtCloudKeyPairHandler) GetKey

func (keyPairHandler *KtCloudKeyPairHandler) GetKey(keyIID irs.IID) (irs.KeyPairInfo, error)

func (*KtCloudKeyPairHandler) ListKey

func (keyPairHandler *KtCloudKeyPairHandler) ListKey() ([]*irs.KeyPairInfo, error)

type KtCloudMyImageHandler added in v0.8.3

type KtCloudMyImageHandler struct {
	RegionInfo idrv.RegionInfo
	Client     *ktsdk.KtCloudClient
}

func (*KtCloudMyImageHandler) CheckWindowsImage added in v0.8.3

func (myImageHandler *KtCloudMyImageHandler) CheckWindowsImage(myImageIID irs.IID) (bool, error)

func (*KtCloudMyImageHandler) DeleteMyImage added in v0.8.3

func (myImageHandler *KtCloudMyImageHandler) DeleteMyImage(myImageIID irs.IID) (bool, error)

func (*KtCloudMyImageHandler) GetMyImage added in v0.8.3

func (myImageHandler *KtCloudMyImageHandler) GetMyImage(myImageIID irs.IID) (irs.MyImageInfo, error)

func (*KtCloudMyImageHandler) ListMyImage added in v0.8.3

func (myImageHandler *KtCloudMyImageHandler) ListMyImage() ([]*irs.MyImageInfo, error)

func (*KtCloudMyImageHandler) SnapshotVM added in v0.8.3

func (myImageHandler *KtCloudMyImageHandler) SnapshotVM(snapshotReqInfo irs.MyImageInfo) (irs.MyImageInfo, error)

To Take a Snapshot with a VM ID (To Create My Image)

type KtCloudNLBHandler added in v0.8.3

type KtCloudNLBHandler struct {
	RegionInfo idrv.RegionInfo
	Client     *ktsdk.KtCloudClient
	NLBClient  *ktsdk.KtCloudClient
}

func (*KtCloudNLBHandler) AddVMs added in v0.8.3

func (nlbHandler *KtCloudNLBHandler) AddVMs(nlbIID irs.IID, vmIIDs *[]irs.IID) (irs.VMGroupInfo, error)

func (*KtCloudNLBHandler) ChangeHealthCheckerInfo added in v0.8.3

func (nlbHandler *KtCloudNLBHandler) ChangeHealthCheckerInfo(nlbIID irs.IID, healthChecker irs.HealthCheckerInfo) (irs.HealthCheckerInfo, error)

func (*KtCloudNLBHandler) ChangeListener added in v0.8.3

func (nlbHandler *KtCloudNLBHandler) ChangeListener(nlbIID irs.IID, listener irs.ListenerInfo) (irs.ListenerInfo, error)

func (*KtCloudNLBHandler) ChangeVMGroupInfo added in v0.8.3

func (nlbHandler *KtCloudNLBHandler) ChangeVMGroupInfo(nlbIID irs.IID, vmGroup irs.VMGroupInfo) (irs.VMGroupInfo, error)

func (*KtCloudNLBHandler) CreateNLB added in v0.8.3

func (nlbHandler *KtCloudNLBHandler) CreateNLB(nlbReqInfo irs.NLBInfo) (irs.NLBInfo, error)

func (*KtCloudNLBHandler) DeleteNLB added in v0.8.3

func (nlbHandler *KtCloudNLBHandler) DeleteNLB(nlbIID irs.IID) (bool, error)

func (*KtCloudNLBHandler) GetNLB added in v0.8.3

func (nlbHandler *KtCloudNLBHandler) GetNLB(nlbIID irs.IID) (irs.NLBInfo, error)

func (*KtCloudNLBHandler) GetVMGroupHealthInfo added in v0.8.3

func (nlbHandler *KtCloudNLBHandler) GetVMGroupHealthInfo(nlbIID irs.IID) (irs.HealthInfo, error)

func (*KtCloudNLBHandler) ListNLB added in v0.8.3

func (nlbHandler *KtCloudNLBHandler) ListNLB() ([]*irs.NLBInfo, error)

func (*KtCloudNLBHandler) RemoveVMs added in v0.8.3

func (nlbHandler *KtCloudNLBHandler) RemoveVMs(nlbIID irs.IID, vmIIDs *[]irs.IID) (bool, error)

type KtCloudRegionZoneHandler

type KtCloudRegionZoneHandler struct {
	CredentialInfo idrv.CredentialInfo
	RegionInfo     idrv.RegionInfo
	Client         *ktsdk.KtCloudClient
}

func (KtCloudRegionZoneHandler) GetRegionZone

func (regionZoneHandler KtCloudRegionZoneHandler) GetRegionZone(regionCode string) (irs.RegionZoneInfo, error)

func (*KtCloudRegionZoneHandler) ListOrgRegion

func (regionZoneHandler *KtCloudRegionZoneHandler) ListOrgRegion() (string, error)

func (*KtCloudRegionZoneHandler) ListOrgZone

func (regionZoneHandler *KtCloudRegionZoneHandler) ListOrgZone() (string, error)

func (*KtCloudRegionZoneHandler) ListRegionZone

func (regionZoneHandler *KtCloudRegionZoneHandler) ListRegionZone() ([]*irs.RegionZoneInfo, error)

type KtCloudSecurityHandler

type KtCloudSecurityHandler struct {
	CredentialInfo idrv.CredentialInfo
	RegionInfo     idrv.RegionInfo
	Client         *ktsdk.KtCloudClient
}

func (*KtCloudSecurityHandler) AddRules

func (securityHandler *KtCloudSecurityHandler) AddRules(sgIID irs.IID, securityRules *[]irs.SecurityRuleInfo) (irs.SecurityInfo, error)

func (*KtCloudSecurityHandler) CreateSecurity

func (securityHandler *KtCloudSecurityHandler) CreateSecurity(securityReqInfo irs.SecurityReqInfo) (irs.SecurityInfo, error)

func (*KtCloudSecurityHandler) DeleteSecurity

func (securityHandler *KtCloudSecurityHandler) DeleteSecurity(securityIID irs.IID) (bool, error)

func (*KtCloudSecurityHandler) GetSecurity

func (securityHandler *KtCloudSecurityHandler) GetSecurity(securityIID irs.IID) (irs.SecurityInfo, error)

func (*KtCloudSecurityHandler) ListSecurity

func (securityHandler *KtCloudSecurityHandler) ListSecurity() ([]*irs.SecurityInfo, error)

func (*KtCloudSecurityHandler) RemoveRules

func (securityHandler *KtCloudSecurityHandler) RemoveRules(sgIID irs.IID, securityRules *[]irs.SecurityRuleInfo) (bool, error)

type KtCloudVMHandler

type KtCloudVMHandler struct {
	CredentialInfo idrv.CredentialInfo
	RegionInfo     idrv.RegionInfo
	Client         *ktsdk.KtCloudClient
}

func (*KtCloudVMHandler) GetVM

func (vmHandler *KtCloudVMHandler) GetVM(vmIID irs.IID) (irs.VMInfo, error)

func (*KtCloudVMHandler) GetVMStatus

func (vmHandler *KtCloudVMHandler) GetVMStatus(vmIID irs.IID) (irs.VMStatus, error)

func (*KtCloudVMHandler) ListVM

func (vmHandler *KtCloudVMHandler) ListVM() ([]*irs.VMInfo, error)

func (*KtCloudVMHandler) ListVMStatus

func (vmHandler *KtCloudVMHandler) ListVMStatus() ([]*irs.VMStatusInfo, error)

func (*KtCloudVMHandler) RebootVM

func (vmHandler *KtCloudVMHandler) RebootVM(vmIID irs.IID) (irs.VMStatus, error)

func (*KtCloudVMHandler) ResumeVM

func (vmHandler *KtCloudVMHandler) ResumeVM(vmIID irs.IID) (irs.VMStatus, error)

func (*KtCloudVMHandler) StartVM

func (vmHandler *KtCloudVMHandler) StartVM(vmReqInfo irs.VMReqInfo) (irs.VMInfo, error)

func (*KtCloudVMHandler) SuspendVM

func (vmHandler *KtCloudVMHandler) SuspendVM(vmIID irs.IID) (irs.VMStatus, error)

func (*KtCloudVMHandler) TerminateVM

func (vmHandler *KtCloudVMHandler) TerminateVM(vmIID irs.IID) (irs.VMStatus, error)

type KtCloudVMSpecHandler

type KtCloudVMSpecHandler struct {
	CredentialInfo idrv.CredentialInfo
	RegionInfo     idrv.RegionInfo
	Client         *ktsdk.KtCloudClient
}

func (*KtCloudVMSpecHandler) GetOrgVMSpec

func (vmSpecHandler *KtCloudVMSpecHandler) GetOrgVMSpec(Name string) (string, error)

func (*KtCloudVMSpecHandler) GetVMSpec

func (vmSpecHandler *KtCloudVMSpecHandler) GetVMSpec(VMSpecName string) (irs.VMSpecInfo, error)

func (*KtCloudVMSpecHandler) ListOrgVMSpec

func (vmSpecHandler *KtCloudVMSpecHandler) ListOrgVMSpec() (string, error)

func (*KtCloudVMSpecHandler) ListVMSpec

func (vmSpecHandler *KtCloudVMSpecHandler) ListVMSpec() ([]*irs.VMSpecInfo, error)

type KtCloudVPCHandler

type KtCloudVPCHandler struct {
	CredentialInfo idrv.CredentialInfo
	RegionInfo     idrv.RegionInfo
	Client         *ktsdk.KtCloudClient
}

func (*KtCloudVPCHandler) AddSubnet

func (VPCHandler *KtCloudVPCHandler) AddSubnet(vpcIID irs.IID, subnetInfo irs.SubnetInfo) (irs.VPCInfo, error)

func (*KtCloudVPCHandler) CreateSubnet

func (VPCHandler *KtCloudVPCHandler) CreateSubnet(subnetReqInfo irs.SubnetInfo) (irs.SubnetInfo, error)

func (*KtCloudVPCHandler) CreateVPC

func (VPCHandler *KtCloudVPCHandler) CreateVPC(vpcReqInfo irs.VPCReqInfo) (irs.VPCInfo, error)

func (*KtCloudVPCHandler) DeleteVPC

func (VPCHandler *KtCloudVPCHandler) DeleteVPC(vpcIID irs.IID) (bool, error)

func (*KtCloudVPCHandler) GetVPC

func (VPCHandler *KtCloudVPCHandler) GetVPC(vpcIID irs.IID) (irs.VPCInfo, error)

func (*KtCloudVPCHandler) ListVPC

func (VPCHandler *KtCloudVPCHandler) ListVPC() ([]*irs.VPCInfo, error)

func (*KtCloudVPCHandler) RemoveSubnet

func (VPCHandler *KtCloudVPCHandler) RemoveSubnet(vpcIID irs.IID, subnetIID irs.IID) (bool, error)

type KtRegionInfo

type KtRegionInfo struct {
	RegionCode string
	RegionName string
}

type SecurityGroup

type SecurityGroup struct {
	IID        IId             `json:"IId"`
	VpcIID     VpcIId          `json:"VpcIID"`
	Direc      string          `json:"Direction"`
	Secu_Rules []Security_Rule `json:"SecurityRules"`
}

type Security_Rule

type Security_Rule struct {
	FromPort string `json:"FromPort"`
	ToPort   string `json:"ToPort"`
	Protocol string `json:"IPProtocol"`
	Direc    string `json:"Direction"`
	Cidr     string `json:"CIDR"`
}

type Subnet

type Subnet struct {
	IID           IId        `json:"IId"`
	Cidr          string     `json:"IPv4_CIDR"`
	KeyValue_List []KeyValue `json:"KeyValueList"`
}

type VPCFileInfo

type VPCFileInfo struct {
	IID           IId        `json:"IId"`
	Cidr          string     `json:"IPv4_CIDR"`
	Subnet_List   []Subnet   `json:"SubnetInfoList"`
	KeyValue_List []KeyValue `json:"KeyValueList"`
}

type VpcIId

type VpcIId struct {
	NameID   string `json:"NameId"`
	SystemID string `json:"SystemId"`
}

Jump to

Keyboard shortcuts

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