resources

package
v0.7.8 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

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
)

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 ConvertVMStatus

func ConvertVMStatus(vmStatus string) (irs.VMStatus, error)

func ConvertVMStatusToString

func ConvertVMStatusToString(vmStatus string) (string, error)

func GetCallLogScheme

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

func GetKTVMSpecIdAndDiskSize

func GetKTVMSpecIdAndDiskSize(instanceSpecId string) (string, string, string)

func InitLog

func InitLog()

func LoggingError

func LoggingError(hiscallInfo call.CLOUDLOGSCHEMA, err error)

func LoggingInfo

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

func MappingImageInfo

func MappingImageInfo(ktServerProductType ktsdk.ProductTypes) irs.ImageInfo

func MappingKeyPairInfo

func MappingKeyPairInfo(KtCloudKeyPair ktsdk.KeyPair) irs.KeyPairInfo

KeyPair 정보를 추출함

func MappingVMSpecInfo

func MappingVMSpecInfo(ZoneId string, ImageId string, ktServerProductType ktsdk.ProductTypes) irs.VMSpecInfo

Extract instance Specification information

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 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 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 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) MappingSecurityInfo

func (securityHandler *KtCloudSecurityHandler) MappingSecurityInfo(secuGroup SecurityGroup) (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) AssociateIpAddress

func (vmHandler *KtCloudVMHandler) AssociateIpAddress() (string, error)

func (*KtCloudVMHandler) CreatePortForwardingFirewallRules

func (vmHandler *KtCloudVMHandler) CreatePortForwardingFirewallRules(sgSystemIDs []string, publicIpId string, vmID string) (bool, error)

### To Apply 'PortForwarding Rules' and 'Firewall Rules' to the Public IP ID.

func (*KtCloudVMHandler) DeleteFirewall

func (vmHandler *KtCloudVMHandler) DeleteFirewall(publicIpId string) (irs.VMStatus, error)

Whenever a VM is terminated, Delete the Firewall rules that the PublicIP has first.

func (*KtCloudVMHandler) DeletePortForwarding

func (vmHandler *KtCloudVMHandler) DeletePortForwarding(publicIpId string) (irs.VMStatus, error)

Whenever a VM is terminated, Delete the PortForwarding rule that the PublicIP has.

func (*KtCloudVMHandler) DisassociatePublicIp

func (vmHandler *KtCloudVMHandler) DisassociatePublicIp(publicIpId string) (irs.VMStatus, error)

Whenever a VM is terminated, Delete the PortForwarding rule that the PublicIP has.

func (*KtCloudVMHandler) GetIPFromPortForwardingRules

func (vmHandler *KtCloudVMHandler) GetIPFromPortForwardingRules(instanceId string) (string, error)

func (*KtCloudVMHandler) GetSGListFromTags

func (vmHandler *KtCloudVMHandler) GetSGListFromTags(instanceId string) ([]irs.IID, error)

func (*KtCloudVMHandler) GetSubnetFromTags

func (vmHandler *KtCloudVMHandler) GetSubnetFromTags(instanceId string) (string, error)

func (*KtCloudVMHandler) GetVM

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

func (*KtCloudVMHandler) GetVMSpecFromTags

func (vmHandler *KtCloudVMHandler) GetVMSpecFromTags(instanceId string) (string, error)

func (*KtCloudVMHandler) GetVMStatus

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

func (*KtCloudVMHandler) GetVPCFromTags

func (vmHandler *KtCloudVMHandler) GetVPCFromTags(instanceId string) (string, error)

func (*KtCloudVMHandler) GetVmIdByName

func (vmHandler *KtCloudVMHandler) GetVmIdByName(vmNameID string) (string, error)

func (*KtCloudVMHandler) ListVM

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

func (*KtCloudVMHandler) ListVMStatus

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

func (*KtCloudVMHandler) MappingServerInfo

func (vmHandler *KtCloudVMHandler) MappingServerInfo(KtCloudInstance ktsdk.Virtualmachine) (irs.VMInfo, 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)

func (*KtCloudVMHandler) WaitToGetInfo

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

Waiting for up to 300 seconds until VM info. can be get

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) MappingVPCInfo

func (VPCHandler *KtCloudVPCHandler) MappingVPCInfo(vpcFileInfo VPCFileInfo) (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