resources

package
v0.8.8 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NCP Classic LB Algorithm type codes : RR (ROUND ROBIN), LC (LEAST_CONNECTION), SIPHS (Source IP Hash)
	DefaultLBAlgorithmType string = "RR" // ROUND ROBIN

	// You can select whether to create a load balancer with public/private IP
	// NCP Classic Cloud NLB network type code : PBLIP(Public IP LB), PRVT(Private IP LB). default : PBLIP
	NcpPublicNlBType   string = "PBLIP"
	NcpInternalNlBType string = "PRVT"

	// 'L7HealthCheckPath' required if ProtocolTypeCode value is 'HTTP' or 'HTTPS' for NCP Classic NLB.
	DefaulthealthCheckPath string = "/index.html"
)
View Source
const (
	BaseURL             string = "https://billingapi.apigw.ntruss.com/billing/v1"
	ProductListURL      string = "/product/getProductList"
	ProductPriceListURL string = "/product/getProductPriceList"
)
View Source
const (
	LnxTypeOs string = "LINUX"
	WinTypeOS string = "WINDOWS"
)
View Source
const (
	DefaultDiskSize string = "10"
)

Variables

This section is empty.

Functions

func CheckFolderAndCreate

func CheckFolderAndCreate(folderPath string) error

func ConvertDiskStatus

func ConvertDiskStatus(diskStatus string) irs.DiskStatus

func ConvertImageStatus

func ConvertImageStatus(myImageStatus string) irs.MyImageStatus

func ConvertJsonString

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

Cloud Object를 JSON String 타입으로 변환

func ConvertVMStatusString

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

func GetCallLogScheme

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

func GetOriginalNameId

func GetOriginalNameId(IID2NameId 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(serverImage server.Product) irs.ImageInfo

func MappingKeyPairInfo

func MappingKeyPairInfo(NcpKeyPairList *server.LoginKey) irs.KeyPairInfo

KeyPair 정보를 추출함

func MappingVMSpecInfo

func MappingVMSpecInfo(Region string, ImageId string, NcpVMSpec server.Product) irs.VMSpecInfo

func Reverse

func Reverse(s string) (result string)

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 Code added in v0.8.2

type Code struct {
	Code     string `json:"code"`
	CodeName string `json:"codeName"`
}

=========================== For PriceList ============================

type ErrorResponse added in v0.8.2

type ErrorResponse struct {
	Code    string `json:"errorCode,omitempty"`
	Message string `json:"message,omitempty"`
	Details string `json:"details,omitempty"`
}

=========================== Common ============================

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 NcpDiskHandler

type NcpDiskHandler struct {
	RegionInfo idrv.RegionInfo
	VMClient   *server.APIClient
}

func (*NcpDiskHandler) AttachDisk

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

func (*NcpDiskHandler) ChangeDiskSize

func (diskHandler *NcpDiskHandler) ChangeDiskSize(diskIID irs.IID, size string) (bool, error)

func (*NcpDiskHandler) CreateDisk

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

Caution : Incase of NCP, there must be a created VM to create a new disk volume.

func (*NcpDiskHandler) DeleteDisk

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

func (*NcpDiskHandler) DetachDisk

func (diskHandler *NcpDiskHandler) DetachDisk(diskIID irs.IID, ownerVM irs.IID) (bool, error)

func (*NcpDiskHandler) GetDisk

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

func (*NcpDiskHandler) GetDiskStatus

func (diskHandler *NcpDiskHandler) GetDiskStatus(diskIID irs.IID) (irs.DiskStatus, error)

func (*NcpDiskHandler) GetNcpDiskInfo

func (diskHandler *NcpDiskHandler) GetNcpDiskInfo(diskIID irs.IID) (*server.BlockStorageInstance, error)

func (*NcpDiskHandler) GetNcpVMList

func (diskHandler *NcpDiskHandler) GetNcpVMList() ([]*server.ServerInstance, error)

func (*NcpDiskHandler) IsBasicBlockStorage

func (diskHandler *NcpDiskHandler) IsBasicBlockStorage(diskIID irs.IID) (bool, error)

func (*NcpDiskHandler) ListDisk

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

func (*NcpDiskHandler) MappingDiskInfo

func (diskHandler *NcpDiskHandler) MappingDiskInfo(storage server.BlockStorageInstance) (irs.DiskInfo, error)

func (*NcpDiskHandler) WaitForDiskAttachment

func (diskHandler *NcpDiskHandler) WaitForDiskAttachment(diskIID irs.IID) (irs.DiskStatus, error)

Waiting for up to 500 seconds during Disk Attachment

func (*NcpDiskHandler) WaitForDiskCreation

func (diskHandler *NcpDiskHandler) WaitForDiskCreation(diskIID irs.IID) (irs.DiskStatus, error)

Waiting for up to 500 seconds during Disk creation until Disk info. can be get

func (*NcpDiskHandler) WaitForDiskDetachment

func (diskHandler *NcpDiskHandler) WaitForDiskDetachment(diskIID irs.IID) (irs.DiskStatus, error)

Waiting for up to 500 seconds during Disk Attachment

type NcpImageHandler

type NcpImageHandler struct {
	CredentialInfo idrv.CredentialInfo
	RegionInfo     idrv.RegionInfo
	VMClient       *server.APIClient
}

func (*NcpImageHandler) CheckWindowsImage

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

func (*NcpImageHandler) CreateImage

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

func (*NcpImageHandler) DeleteImage

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

func (*NcpImageHandler) GetImage

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

func (*NcpImageHandler) GetNcpImageInfo

func (imageHandler *NcpImageHandler) GetNcpImageInfo(imageIID irs.IID) (*server.Product, error)

func (*NcpImageHandler) ListImage

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

type NcpKeyPairHandler

type NcpKeyPairHandler struct {
	CredentialInfo idrv.CredentialInfo
	RegionInfo     idrv.RegionInfo
	VMClient       *server.APIClient
}

func (*NcpKeyPairHandler) CreateKey

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

func (*NcpKeyPairHandler) DeleteKey

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

func (*NcpKeyPairHandler) GetKey

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

func (*NcpKeyPairHandler) ListKey

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

type NcpMyImageHandler

type NcpMyImageHandler struct {
	RegionInfo idrv.RegionInfo
	VMClient   *server.APIClient
}

func (*NcpMyImageHandler) CheckWindowsImage

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

func (*NcpMyImageHandler) DeleteMyImage

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

func (*NcpMyImageHandler) GetMyImage

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

func (*NcpMyImageHandler) GetMyImageStatus

func (myImageHandler *NcpMyImageHandler) GetMyImageStatus(myImageIID irs.IID) (irs.MyImageStatus, error)

func (*NcpMyImageHandler) GetNcpMemberServerImageInfo

func (myImageHandler *NcpMyImageHandler) GetNcpMemberServerImageInfo(myImageIID irs.IID) (server.MemberServerImage, error)

func (*NcpMyImageHandler) GetOriginImageOSPlatform

func (myImageHandler *NcpMyImageHandler) GetOriginImageOSPlatform(imageIID irs.IID) (string, error)

func (*NcpMyImageHandler) ListMyImage

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

To Manage My Images

func (*NcpMyImageHandler) MappingMyImageInfo

func (myImageHandler *NcpMyImageHandler) MappingMyImageInfo(myImage *server.MemberServerImage) (*irs.MyImageInfo, error)

func (*NcpMyImageHandler) SnapshotVM

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

func (*NcpMyImageHandler) WaitForImageSnapshot

func (myImageHandler *NcpMyImageHandler) WaitForImageSnapshot(myImageIID irs.IID) (irs.MyImageStatus, error)

Waiting for up to 500 seconds during Taking a Snapshot from a VM

type NcpNLBHandler

type NcpNLBHandler struct {
	CredentialInfo idrv.CredentialInfo
	RegionInfo     idrv.RegionInfo
	VMClient       *server.APIClient
	LBClient       *lb.APIClient
}

func (*NcpNLBHandler) AddVMs

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

func (*NcpNLBHandler) ChangeHealthCheckerInfo

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

func (*NcpNLBHandler) ChangeListener

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

Note!! : Will be decided later if we would support bellow methoeds or not. ------ Frontend Control

func (*NcpNLBHandler) ChangeVMGroupInfo

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

------ Backend Control

func (*NcpNLBHandler) CreateNLB

func (nlbHandler *NcpNLBHandler) CreateNLB(nlbReqInfo irs.NLBInfo) (createNLB irs.NLBInfo, newErr error)

Note : Cloud-Barista supports only this case => [ LB : Listener : VM Group : Health Checker = 1 : 1 : 1 : 1 ] NCP Classic NLB Supported regions: Korea, US West, Hong Kong, Singapore, Japan, Germany ### Caution!! : Listener, VM Group and Healthchecker all use the same protocol type in NCP Classic NLB.(The Protocol specified by 'ProtocolTypeCode' when created).

func (*NcpNLBHandler) DeleteNLB

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

func (*NcpNLBHandler) GetHealthCheckerInfo

func (nlbHandler *NcpNLBHandler) GetHealthCheckerInfo(nlb lb.LoadBalancerInstance) (irs.HealthCheckerInfo, error)

func (*NcpNLBHandler) GetListenerInfo

func (nlbHandler *NcpNLBHandler) GetListenerInfo(nlb lb.LoadBalancerInstance) (irs.ListenerInfo, error)

func (*NcpNLBHandler) GetNLB

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

func (*NcpNLBHandler) GetNcpNlbInfo

func (nlbHandler *NcpNLBHandler) GetNcpNlbInfo(nlbIID irs.IID) (*lb.LoadBalancerInstance, error)

func (*NcpNLBHandler) GetNcpNlbStatus

func (nlbHandler *NcpNLBHandler) GetNcpNlbStatus(nlbIID irs.IID) (string, error)

func (*NcpNLBHandler) GetVMGroupHealthInfo

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

func (*NcpNLBHandler) GetVMGroupInfo

func (nlbHandler *NcpNLBHandler) GetVMGroupInfo(nlb lb.LoadBalancerInstance) (irs.VMGroupInfo, error)

func (*NcpNLBHandler) ListNLB

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

func (*NcpNLBHandler) MappingNlbInfo

func (nlbHandler *NcpNLBHandler) MappingNlbInfo(nlb *lb.LoadBalancerInstance) (irs.NLBInfo, error)

NCP Classic LB resource Def. : https://api.ncloud-docs.com/docs/networking-loadbalancing-createloadbalancerinstance

func (*NcpNLBHandler) RemoveVMs

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

func (*NcpNLBHandler) WaitForDelNlb

func (nlbHandler *NcpNLBHandler) WaitForDelNlb(nlbIID irs.IID) (bool, error)

func (*NcpNLBHandler) WaitToGetNlbInfo

func (nlbHandler *NcpNLBHandler) WaitToGetNlbInfo(nlbIID irs.IID) (bool, error)

type NcpPriceInfoHandler added in v0.8.2

type NcpPriceInfoHandler struct {
	CredentialInfo idrv.CredentialInfo
	RegionInfo     idrv.RegionInfo
	VMClient       *server.APIClient
}

func (*NcpPriceInfoHandler) GetPriceInfo added in v0.8.2

func (priceInfoHandler *NcpPriceInfoHandler) GetPriceInfo(productFamily string, regionName string, filterList []irs.KeyValue) (string, error)

func (*NcpPriceInfoHandler) GetRequestBody added in v0.8.2

func (priceInfoHandler *NcpPriceInfoHandler) GetRequestBody(regionCode string, callURL string) ([]uint8, error)

This is necessary because NCP GoSDK does not support these PriceInfo APIs.

func (*NcpPriceInfoHandler) GetRequestBodyWithProductCode added in v0.8.2

func (priceInfoHandler *NcpPriceInfoHandler) GetRequestBodyWithProductCode(regionCode string, callURL string, productCode string, filterList []irs.KeyValue) ([]uint8, error)

This is necessary because NCP GoSDK does not support these PriceInfo APIs.

func (*NcpPriceInfoHandler) ListProductFamily added in v0.8.2

func (priceInfoHandler *NcpPriceInfoHandler) ListProductFamily(regionName string) ([]string, error)

type NcpRegionZoneHandler

type NcpRegionZoneHandler struct {
	CredentialInfo idrv.CredentialInfo
	RegionInfo     idrv.RegionInfo
	VMClient       *server.APIClient
}

func (NcpRegionZoneHandler) GetRegionZone

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

func (*NcpRegionZoneHandler) ListOrgRegion

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

func (*NcpRegionZoneHandler) ListOrgZone

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

func (*NcpRegionZoneHandler) ListRegionZone

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

type NcpSecurityHandler

type NcpSecurityHandler struct {
	CredentialInfo idrv.CredentialInfo
	RegionInfo     idrv.RegionInfo
	VMClient       *server.APIClient
}

func (*NcpSecurityHandler) AddRules

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

func (*NcpSecurityHandler) CreateSecurity

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

func (*NcpSecurityHandler) DeleteSecurity

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

func (*NcpSecurityHandler) ExtractSecurityRuleInfo

func (securityHandler *NcpSecurityHandler) ExtractSecurityRuleInfo(ncpSecurityGroupId string) ([]irs.SecurityRuleInfo, error)

Search NCP SecurityGroup Rule List

func (*NcpSecurityHandler) GetSecurity

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

func (*NcpSecurityHandler) ListSecurity

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

func (*NcpSecurityHandler) MappingSecurityInfo

func (securityHandler *NcpSecurityHandler) MappingSecurityInfo(ncpSecurityGroup server.AccessControlGroup) (irs.SecurityInfo, error)

func (*NcpSecurityHandler) RemoveRules

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

type NcpVMHandler

type NcpVMHandler struct {
	CredentialInfo idrv.CredentialInfo
	RegionInfo     idrv.RegionInfo
	VMClient       *server.APIClient
}

func (*NcpVMHandler) CreateLinuxInitUserData

func (vmHandler *NcpVMHandler) CreateLinuxInitUserData(imageIID irs.IID, keyPairId string) (*string, error)

func (*NcpVMHandler) CreateVPCnSubnetTag

func (vmHandler *NcpVMHandler) CreateVPCnSubnetTag(vmID *string, vpcName string, subnetName string) (bool, error)

func (*NcpVMHandler) CreateWinInitUserData

func (vmHandler *NcpVMHandler) CreateWinInitUserData(passWord string) (*string, error)

func (*NcpVMHandler) DeletePublicIP

func (vmHandler *NcpVMHandler) DeletePublicIP(vmInfo irs.VMInfo) (irs.VMStatus, error)

Whenever a VM is terminated, Delete the public IP that the VM has

func (*NcpVMHandler) DeleteVMTags

func (vmHandler *NcpVMHandler) DeleteVMTags(vmID *string) (bool, error)

func (*NcpVMHandler) GetNcpVMInfo

func (vmHandler *NcpVMHandler) GetNcpVMInfo(instanceId string) (*server.ServerInstance, error)

func (*NcpVMHandler) GetRegionNo

func (vmHandler *NcpVMHandler) GetRegionNo(regionCode string) (*string, error)

func (*NcpVMHandler) GetVM

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

func (*NcpVMHandler) GetVMStatus

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

func (*NcpVMHandler) GetVPCnSubnetNameFromTag

func (vmHandler *NcpVMHandler) GetVPCnSubnetNameFromTag(vmID *string) (string, string, error)

func (*NcpVMHandler) GetVmDataDiskList

func (vmHandler *NcpVMHandler) GetVmDataDiskList(vmId *string) ([]irs.IID, error)

func (*NcpVMHandler) GetVmIdByName

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

func (*NcpVMHandler) GetVmRootDiskInfo

func (vmHandler *NcpVMHandler) GetVmRootDiskInfo(vmId *string) (*string, *string, error)

func (*NcpVMHandler) GetZoneNo

func (vmHandler *NcpVMHandler) GetZoneNo(zoneCode string) (*string, error)

func (*NcpVMHandler) ListVM

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

func (*NcpVMHandler) ListVMStatus

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

func (*NcpVMHandler) MappingServerInfo

func (vmHandler *NcpVMHandler) MappingServerInfo(NcpInstance server.ServerInstance) (irs.VMInfo, error)

func (*NcpVMHandler) RebootVM

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

func (*NcpVMHandler) ResumeVM

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

func (*NcpVMHandler) StartVM

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

func (*NcpVMHandler) SuspendVM

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

func (*NcpVMHandler) TerminateVM

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

func (*NcpVMHandler) WaitToDelPublicIp

func (vmHandler *NcpVMHandler) WaitToDelPublicIp(vmIID irs.IID) (irs.VMStatus, error)

Waiting for up to 300 seconds until Public IP can be deleted.

func (*NcpVMHandler) WaitToGetInfo

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

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

type NcpVMSpecHandler

type NcpVMSpecHandler struct {
	CredentialInfo idrv.CredentialInfo
	RegionInfo     idrv.RegionInfo
	VMClient       *server.APIClient
}

func (*NcpVMSpecHandler) GetOrgVMSpec

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

func (*NcpVMSpecHandler) GetVMSpec

func (vmSpecHandler *NcpVMSpecHandler) GetVMSpec(Name string) (irs.VMSpecInfo, error)

func (*NcpVMSpecHandler) ListOrgVMSpec

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

func (*NcpVMSpecHandler) ListVMSpec

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

type NcpVPCHandler

type NcpVPCHandler struct {
	CredentialInfo idrv.CredentialInfo
	RegionInfo     idrv.RegionInfo
	VMClient       *server.APIClient
}

func (*NcpVPCHandler) AddSubnet

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

func (*NcpVPCHandler) CreateSubnet

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

func (*NcpVPCHandler) CreateVPC

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

func (*NcpVPCHandler) DeleteVPC

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

func (*NcpVPCHandler) GetVPC

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

func (*NcpVPCHandler) ListVPC

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

func (*NcpVPCHandler) MappingVPCInfo

func (VPCHandler *NcpVPCHandler) MappingVPCInfo(vpcJSON VPC) (irs.VPCInfo, error)

func (*NcpVPCHandler) RemoveSubnet

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

type Price added in v0.8.2

type Price struct {
	PriceNo                string  `json:"priceNo"` // Not int
	PriceType              Code    `json:"priceType"`
	Region                 Region  `json:"region"`
	ChargingUnitType       Code    `json:"chargingUnitType"`
	RatingUnitType         Code    `json:"ratingUnitType"`
	ChargingUnitBasicValue string  `json:"chargingUnitBasicValue"` // Not int
	Unit                   Code    `json:"unit"`
	PriceValue             float32 `json:"price"` // Not float64
	ConditionType          Code    `json:"conditionType"`
	ConditionPrice         float32 `json:"conditionPrice"` // Not float64
	PriceDescription       string  `json:"priceDescription"`
	MeteringUnit           Code    `json:"meteringUnit"`
	StartDate              string  `json:"startDate"`
	PayCurrency            Code    `json:"payCurrency"`
}

type PriceListAPIResponse added in v0.8.2

type PriceListAPIResponse struct {
	GetProductPriceListResponse struct {
		RequestID        string         `json:"request_id"`
		ReturnCode       int            `json:"return_code"`
		ReturnMessage    string         `returnMessage`
		TotalRows        int            `json:"totalRows"`
		ProductPriceList []ProductPrice `json:"productPriceList"`
	} `json:"getProductPriceListResponse"`

	Error *ErrorResponse `json:"error,omitempty"`
}

type Product added in v0.8.2

type Product struct {
	ItemKind       ProductItemKind       `json:"productItemKind"`
	ItemKindDetail ProductItemKindDetail `json:"productItemKindDetail"`
	ProductCode    string                `json:"productCode"`
	ProductName    string                `json:"productName"`
	Description    string                `json:"productDescription"`
	// contains filtered or unexported fields
}

type ProductItemKind added in v0.8.2

type ProductItemKind struct {
	Code     string `json:"code"`
	CodeName string `json:"code_name"`
}

=========================== For ProductList ============================

type ProductItemKindDetail added in v0.8.2

type ProductItemKindDetail struct {
	Code     string `json:"code"`
	CodeName string `json:"code_name"`
}

type ProductListAPIResponse added in v0.8.2

type ProductListAPIResponse struct {
	GetProductListResponse struct {
		RequestID     string    `json:"request_id"`
		ReturnCode    int       `json:"return_code"`
		ReturnMessage string    `returnMessage`
		TotalRows     int       `json:"totalRows"`
		ProductList   []Product `json:"productList"`
	} `json:"getProductListResponse"`

	Error *ErrorResponse `json:"error,omitempty"`
}

type ProductPrice added in v0.8.2

type ProductPrice struct {
	ProductItemKind       Code   `json:"productItemKind"`
	ProductItemKindDetail Code   `json:"productItemKindDetail"`
	ProductCode           string `json:"productCode"`
	ProductName           string `json:"productName"`
	ProductDescription    string `json:"productDescription"`
	ProductType           Code   `json:"productType"`
	GpuCount              int    `json:"gpuCount"`
	CpuCount              int    `json:"cpuCount"`
	MemorySize            int64  `json:"memorySize"`
	BaseBlockStorageSize  int64  `json:"baseBlockStorageSize"`
	DiskType              Code   `json:"diskType"`
	DiskDetailType        Code   `json:"diskDetailType"`
	GenerationCode        string `json:"generationCode"`

	PriceList []Price `json:"priceList"`
	// contains filtered or unexported fields
}

type Region added in v0.8.2

type Region struct {
	RegionNo   int    `json:"regionNo"` // Not string
	RegionCode string `json:"regionCode"`
	RegionName string `json:"regionName"`
}

type Subnet

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

type VPC

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

Jump to

Keyboard shortcuts

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