Documentation ¶
Overview ¶
VPC & Subnet 처리 (AlibabaCloud's Subnet --> VSwitch 임)
Index ¶
- Constants
- func AttachDisk(client *ecs.Client, regionInfo idrv.RegionInfo, ownerVM irs.IID, ...) error
- func ContainString(s []string, str string) bool
- func ConvertJsonString(v interface{}) (string, error)
- func ConvertKeyValueList(v interface{}) ([]irs.KeyValue, error)
- func ConvertToString(value interface{}) (string, error)
- func DescribeAvailableResource(client *ecs.Client, regionId string, zoneId string, resourceType string, ...) (ecs.AvailableZonesInDescribeAvailableResource, error)
- func DescribeDiskByDiskId(client *ecs.Client, regionInfo idrv.RegionInfo, diskIID irs.IID) (ecs.Disk, error)
- func DescribeDisks(client *ecs.Client, regionInfo idrv.RegionInfo, instanceIID irs.IID, ...) ([]ecs.Disk, error)
- func DescribeDisksByInstanceId(client *ecs.Client, regionInfo idrv.RegionInfo, instanceIID irs.IID) ([]ecs.Disk, error)
- func DescribeInstanceById(client *ecs.Client, regionInfo idrv.RegionInfo, vmIID irs.IID) (ecs.Instance, error)
- func DescribeInstances(client *ecs.Client, regionInfo idrv.RegionInfo, vmIIDs []irs.IID) ([]ecs.Instance, error)
- func ExtractDiskDescribeInfo(aliDisk *ecs.Disk) (irs.DiskInfo, error)
- func ExtractImageDescribeInfo(image *ecs.Image) irs.ImageInfo
- func ExtractKeyPairDescribeInfo(keyPair *ecs.KeyPair) (irs.KeyPairInfo, error)
- func ExtractSubnetDescribeInfo(subnetInfo vpc.VSwitch) irs.SubnetInfo
- func ExtractVMSpecInfo(Region string, instanceTypeInfo ecs.InstanceType) irs.VMSpecInfo
- func ExtractVpcDescribeInfo(vpcInfo *vpc.Vpc) irs.VPCInfo
- func GetCBResourceGroupName() string
- func GetCBSubnetName() string
- func GetCBVirutalNetworkName() string
- func GetCBVnetDefaultCidr() string
- func SetNameTag(Client *ecs.Client, resourceId string, resourceType string, value string) bool
- type AlibabaCBNetworkInfo
- type AlibabaDiskHandler
- func (diskHandler *AlibabaDiskHandler) AttachDisk(diskIID irs.IID, ownerVM irs.IID) (irs.DiskInfo, error)
- func (diskHandler *AlibabaDiskHandler) ChangeDiskSize(diskIID irs.IID, size string) (bool, error)
- func (diskHandler *AlibabaDiskHandler) CreateDisk(diskReqInfo irs.DiskInfo) (irs.DiskInfo, error)
- func (diskHandler *AlibabaDiskHandler) DeleteDisk(diskIID irs.IID) (bool, error)
- func (diskHandler *AlibabaDiskHandler) DetachDisk(diskIID irs.IID, ownerVM irs.IID) (bool, error)
- func (diskHandler *AlibabaDiskHandler) GetDisk(diskIID irs.IID) (irs.DiskInfo, error)
- func (diskHandler *AlibabaDiskHandler) ListDisk() ([]*irs.DiskInfo, error)
- type AlibabaImageHandler
- func (imageHandler *AlibabaImageHandler) CreateImage(imageReqInfo irs.ImageReqInfo) (irs.ImageInfo, error)
- func (imageHandler *AlibabaImageHandler) DeleteImage(imageIID irs.IID) (bool, error)
- func (imageHandler *AlibabaImageHandler) GetImage(imageIID irs.IID) (irs.ImageInfo, error)
- func (imageHandler *AlibabaImageHandler) ListImage() ([]*irs.ImageInfo, error)
- type AlibabaKeyPairHandler
- func (keyPairHandler *AlibabaKeyPairHandler) CheckKeyPairFolder(keyPairPath string) error
- func (keyPairHandler *AlibabaKeyPairHandler) CreateKey(keyPairReqInfo irs.KeyPairReqInfo) (irs.KeyPairInfo, error)
- func (keyPairHandler *AlibabaKeyPairHandler) DeleteKey(keyIID irs.IID) (bool, error)
- func (keyPairHandler *AlibabaKeyPairHandler) GetKey(keyIID irs.IID) (irs.KeyPairInfo, error)
- func (keyPairHandler *AlibabaKeyPairHandler) ListKey() ([]*irs.KeyPairInfo, error)
- type AlibabaNLBBackendServer
- type AlibabaNLBHandler
- func (NLBHandler *AlibabaNLBHandler) AddLoadBalancerListener(nlbIID irs.IID, nlbReqInfo irs.NLBInfo) (irs.ListenerInfo, error)
- func (NLBHandler *AlibabaNLBHandler) AddVMs(nlbIID irs.IID, vmIIDs *[]irs.IID) (irs.VMGroupInfo, error)
- func (NLBHandler *AlibabaNLBHandler) ChangeHealthCheckerInfo(nlbIID irs.IID, healthChecker irs.HealthCheckerInfo) (irs.HealthCheckerInfo, error)
- func (NLBHandler *AlibabaNLBHandler) ChangeListener(nlbIID irs.IID, listener irs.ListenerInfo) (irs.ListenerInfo, error)
- func (NLBHandler *AlibabaNLBHandler) ChangeVMGroupInfo(nlbIID irs.IID, vmGroup irs.VMGroupInfo) (irs.VMGroupInfo, error)
- func (NLBHandler *AlibabaNLBHandler) CreateNLB(nlbReqInfo irs.NLBInfo) (irs.NLBInfo, error)
- func (NLBHandler *AlibabaNLBHandler) DeleteNLB(nlbIID irs.IID) (bool, error)
- func (NLBHandler *AlibabaNLBHandler) GetNLB(nlbIID irs.IID) (irs.NLBInfo, error)
- func (NLBHandler *AlibabaNLBHandler) GetVMGroupHealthInfo(nlbIID irs.IID) (irs.HealthInfo, error)
- func (NLBHandler *AlibabaNLBHandler) ListNLB() ([]*irs.NLBInfo, error)
- func (NLBHandler *AlibabaNLBHandler) RemoveVMs(nlbIID irs.IID, vmIIDs *[]irs.IID) (bool, error)
- type AlibabaSecurityHandler
- func (securityHandler *AlibabaSecurityHandler) AddRules(securityIID irs.IID, reqSecurityRules *[]irs.SecurityRuleInfo) (irs.SecurityInfo, error)
- func (securityHandler *AlibabaSecurityHandler) CreateSecurity(securityReqInfo irs.SecurityReqInfo) (irs.SecurityInfo, error)
- func (securityHandler *AlibabaSecurityHandler) DeleteSecurity(securityIID irs.IID) (bool, error)
- func (securityHandler *AlibabaSecurityHandler) ExtractSecurityInfo(securityGroupResult *ecs.SecurityGroup) (irs.SecurityInfo, error)
- func (securityHandler *AlibabaSecurityHandler) ExtractSecurityRuleInfo(securityGroupId string) ([]irs.SecurityRuleInfo, error)
- func (securityHandler *AlibabaSecurityHandler) GetSecurity(securityIID irs.IID) (irs.SecurityInfo, error)
- func (securityHandler *AlibabaSecurityHandler) ListSecurity() ([]*irs.SecurityInfo, error)
- func (securityHandler *AlibabaSecurityHandler) RemoveRules(securityIID irs.IID, reqSecurityRules *[]irs.SecurityRuleInfo) (bool, error)
- type AlibabaVMHandler
- func (vmHandler *AlibabaVMHandler) ConvertVMStatusString(vmStatus string) (irs.VMStatus, error)
- func (vmHandler *AlibabaVMHandler) ExtractDescribeInstances(instanceInfo *ecs.Instance) (irs.VMInfo, error)
- func (vmHandler *AlibabaVMHandler) GetImageSize(ImageSystemId string) (int64, error)
- func (vmHandler *AlibabaVMHandler) GetVM(vmIID irs.IID) (irs.VMInfo, error)
- func (vmHandler *AlibabaVMHandler) GetVMStatus(vmIID irs.IID) (irs.VMStatus, error)
- func (vmHandler *AlibabaVMHandler) ListVM() ([]*irs.VMInfo, error)
- func (vmHandler *AlibabaVMHandler) ListVMStatus() ([]*irs.VMStatusInfo, error)
- func (vmHandler *AlibabaVMHandler) RebootVM(vmIID irs.IID) (irs.VMStatus, error)
- func (vmHandler *AlibabaVMHandler) ResumeVM(vmIID irs.IID) (irs.VMStatus, error)
- func (vmHandler *AlibabaVMHandler) StartVM(vmReqInfo irs.VMReqInfo) (irs.VMInfo, error)
- func (vmHandler *AlibabaVMHandler) SuspendVM(vmIID irs.IID) (irs.VMStatus, error)
- func (vmHandler *AlibabaVMHandler) TerminateVM(vmIID irs.IID) (irs.VMStatus, error)
- func (vmHandler *AlibabaVMHandler) WaitForExist(vmIID irs.IID) (irs.VMStatus, error)
- func (vmHandler *AlibabaVMHandler) WaitForRun(vmIID irs.IID) (irs.VMStatus, error)
- type AlibabaVPCHandler
- func (VPCHandler *AlibabaVPCHandler) AddSubnet(vpcIID irs.IID, subnetInfo irs.SubnetInfo) (irs.VPCInfo, error)
- func (VPCHandler *AlibabaVPCHandler) CreateSubnet(vpcId string, reqSubnetInfo irs.SubnetInfo) (irs.SubnetInfo, error)
- func (VPCHandler *AlibabaVPCHandler) CreateVPC(vpcReqInfo irs.VPCReqInfo) (irs.VPCInfo, error)
- func (VPCHandler *AlibabaVPCHandler) DeleteSubnet(subnetIID irs.IID) (bool, error)
- func (VPCHandler *AlibabaVPCHandler) DeleteVPC(vpcIID irs.IID) (bool, error)
- func (VPCHandler *AlibabaVPCHandler) GetSubnet(reqSubnetId string) (irs.SubnetInfo, error)
- func (VPCHandler *AlibabaVPCHandler) GetVPC(vpcIID irs.IID) (irs.VPCInfo, error)
- func (VPCHandler *AlibabaVPCHandler) ListVPC() ([]*irs.VPCInfo, error)
- func (VPCHandler *AlibabaVPCHandler) RemoveSubnet(vpcIID irs.IID, subnetIID irs.IID) (bool, error)
- func (VPCHandler *AlibabaVPCHandler) WaitForRun(vpcId string) error
- type AlibabaVmSpecHandler
- func (vmSpecHandler *AlibabaVmSpecHandler) GetOrgVMSpec(Name string) (string, error)
- func (vmSpecHandler *AlibabaVmSpecHandler) GetVMSpec(Name string) (irs.VMSpecInfo, error)
- func (vmSpecHandler *AlibabaVmSpecHandler) ListOrgVMSpec() (string, error)
- func (vmSpecHandler *AlibabaVmSpecHandler) ListVMSpec() ([]*irs.VMSpecInfo, error)
- type DiskSize
- type RuleAction
Constants ¶
const ( // default Resource GROUP Name CBResourceGroupName = "CB-GROUP" // default VPC Name CBVirutalNetworkName = "CB-VNet" // default CIDR Block CBVnetDefaultCidr = "130.0.0.0/16" // default VM User Name CBDefaultVmUserName = "cb-user" // default Subnet Name CBSubnetName = "CB-VNet-Sub" // default Bandwidth is 5 Mbit/s CBBandwidth = "5" // default InstanceChargeType CBInstanceChargeType = "PostPaid" // default InternetChargeType CBInternetChargeType = "PayByTraffic" // default Tag Name CBMetaDefaultTagName = "cbCate" // default Tag Value CBMetaDefaultTagValue = "cbAlibaba" CBPageOn = true // page number for control pages CBPageNumber = 1 // 페이지 시작은 1부터 시작되기 때문에 삭제 예정 // page size for control pages CBPageSize = 100 //오브젝트(예: 이미지 / 키페어 / ...) 마다 지정 개수가 달라서 삭제 예정 CBKeyPairPath = "/meta_db/.ssh-aliyun/" //CBCloudInitFilePath = "/cloud-driver-libs/.cloud-init-aliyun/cloud-init" CBCloudInitFilePath = "/cloud-driver-libs/.cloud-init-common/cloud-init" )
const ( ALIBABA_DISK_STATUS_AVAILABLE = "Available" ALIBABA_DISK_STATUS_INUSE = "In_use" ALIBABA_DISK_STATUS_ATTACHING = "Attaching" ALIBABA_DISK_STATUS_DETACHING = "Detaching" ALIBABA_DISK_STATUS_CREATING = "Creating" ALIBABA_DISK_STATUS_REINITING = "ReIniting" )
const ( ListenerProtocol_TCP string = "tcp" ListenerProtocol_UDP string = "udp" BackendServerType_ECS string = "ecs" LoadBalancerSpec_SLBS1SMALL string = "slb.s1.small" ALI_LoadBalancerAddressType_INTERNET = "internet" ALI_LoadBalancerAddressType_INTRANET = "intranet" SPIDER_LoadBalancerType_PUBLIC = "PUBLIC" SPIDER_LoadBalancerType_PRIVATE = "PRIVATE" SCOPE_REGION = "REGION" SCOPE_GLOBAL = "GLOBAL" ServerHealthStatus_NORMAL string = "normal" ServerHealthStatus_ABNORMAL string = "abnormal" )
Variables ¶
This section is empty.
Functions ¶
func AttachDisk ¶ added in v0.6.7
func AttachDisk(client *ecs.Client, regionInfo idrv.RegionInfo, ownerVM irs.IID, diskIID irs.IID) error
* Instance에 Disk Attach 한번에 1개씩.
func ContainString ¶ added in v0.6.7
array에 주어진 string이 있는지 체크
func ConvertJsonString ¶
Cloud Object를 JSON String 타입으로 변환
func ConvertKeyValueList ¶
Cloud Object를 CB-KeyValue 형식으로 변환이 필요할 경우 이용
func ConvertToString ¶
CB-KeyValue 등을 위해 String 타입으로 변환
func DescribeAvailableResource ¶ added in v0.6.7
func DescribeAvailableResource(client *ecs.Client, regionId string, zoneId string, resourceType string, destinationResource string, categoryValue string) (ecs.AvailableZonesInDescribeAvailableResource, error)
* 해당 리소스가 사용가능한지 조회
https://help.aliyun.com/document_detail/66186.html?spm=api-workbench.Troubleshoot.0.0.43651e0folUpip#doc-api-Ecs-DescribeAvailableResource https://next.api.alibabacloud.com/api/Ecs/2014-05-26/DescribeAvailableResource?lang=GO¶ms={}
필수 parameter
RegionId DestinationResource : "Zone", "IoOptimized", "InstanceType", "SystemDisk", "DataDisk", "Network", "ddh"
결과 : AvailableZone 값이 들어있음. 배열형태임.
비정상 : requestID만 반환. ex) {"RequestId":"7F2E6252-7FF6-31AF-9067-1EECF1B6B3FA"} 정상 : requestID 외에 Available ex) {"RequestId":"7F2E6252-7FF6-31AF-9067-1EECF1B6B3FA","AvailableZones":{"AvailableZone":[{"Status":"Available","StatusCategory":"WithStock","ZoneId":"ap-southeast-1b","AvailableResources":{"AvailableResource":[{"Type":"DataDisk","SupportedResources":{"SupportedResource":[{"Status":"Available","Min":20,"Max":32768,"Value":"cloud_efficiency","Unit":"GiB"}]}}]},"RegionId":"ap-southeast-1"}]}}
func DescribeDiskByDiskId ¶ added in v0.6.7
func DescribeDiskByDiskId(client *ecs.Client, regionInfo idrv.RegionInfo, diskIID irs.IID) (ecs.Disk, error)
* DiskID로 1개 Disk의 정보 조회
func DescribeDisks ¶ added in v0.6.7
func DescribeDisks(client *ecs.Client, regionInfo idrv.RegionInfo, instanceIID irs.IID, diskIIDs []irs.IID) ([]ecs.Disk, error)
* 디스크 목록 조회
func DescribeDisksByInstanceId ¶ added in v0.6.7
func DescribeDisksByInstanceId(client *ecs.Client, regionInfo idrv.RegionInfo, instanceIID irs.IID) ([]ecs.Disk, error)
* InstanceID로 1개 Disk의 정보 조회
func DescribeInstanceById ¶ added in v0.6.7
func DescribeInstanceById(client *ecs.Client, regionInfo idrv.RegionInfo, vmIID irs.IID) (ecs.Instance, error)
* 인스턴스 1개만 조회
func DescribeInstances ¶ added in v0.6.7
func DescribeInstances(client *ecs.Client, regionInfo idrv.RegionInfo, vmIIDs []irs.IID) ([]ecs.Instance, error)
* Instance 목록 조회
iid를 parameter로 주면 해당 iid들만 조회.
func ExtractDiskDescribeInfo ¶ added in v0.6.7
https://pkg.go.dev/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs?tab=doc#Image package ecs v1.61.170 Latest Published: Apr 30, 2020 Image 정보를 추출함
func ExtractImageDescribeInfo ¶
https://pkg.go.dev/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs?tab=doc#Image package ecs v1.61.170 Latest Published: Apr 30, 2020 Image 정보를 추출함
func ExtractKeyPairDescribeInfo ¶
func ExtractKeyPairDescribeInfo(keyPair *ecs.KeyPair) (irs.KeyPairInfo, error)
2021-10-27 이슈#480에 의해 Local Key 로직 제거 KeyPair 정보를 추출함
func ExtractSubnetDescribeInfo ¶
func ExtractSubnetDescribeInfo(subnetInfo vpc.VSwitch) irs.SubnetInfo
Subnet(VSwitch) 정보를 추출함
func ExtractVMSpecInfo ¶
func ExtractVMSpecInfo(Region string, instanceTypeInfo ecs.InstanceType) irs.VMSpecInfo
인스턴스 스펙 정보를 추출함
func GetCBResourceGroupName ¶
func GetCBResourceGroupName() string
func GetCBVnetDefaultCidr ¶
func GetCBVnetDefaultCidr() string
Types ¶
type AlibabaCBNetworkInfo ¶
type AlibabaDiskHandler ¶ added in v0.6.7
type AlibabaDiskHandler struct { Region idrv.RegionInfo Client *ecs.Client }
func (*AlibabaDiskHandler) AttachDisk ¶ added in v0.6.7
func (*AlibabaDiskHandler) ChangeDiskSize ¶ added in v0.6.7
func (*AlibabaDiskHandler) CreateDisk ¶ added in v0.6.7
* create 시 특정 instance에 바로 attach 가능하나 CB-SPIDER에서는 사용하지 않음
func (*AlibabaDiskHandler) DeleteDisk ¶ added in v0.6.7
func (diskHandler *AlibabaDiskHandler) DeleteDisk(diskIID irs.IID) (bool, error)
func (*AlibabaDiskHandler) DetachDisk ¶ added in v0.6.7
* The disk must be attached to an ECS instance and in the In Use (In_Use) state. The instance from which you want to detach the data disk must be in the Running (Running) or Stopped (Stopped) state. The instance from which you want to detach the system disk must be in the Stopped (Stopped) state. If OperationLocks in the response contains "LockReason" : "security" when you query information of an instance, the instance is locked for security reasons and all operations cannot take effect on the instance. DetachDisk is an asynchronous operation. It takes about 1 minute for a disk to be detached from an instance after the operation is called.
type AlibabaImageHandler ¶
type AlibabaImageHandler struct { Region idrv.RegionInfo Client *ecs.Client }
func (*AlibabaImageHandler) CreateImage ¶
func (imageHandler *AlibabaImageHandler) CreateImage(imageReqInfo irs.ImageReqInfo) (irs.ImageInfo, error)
func (*AlibabaImageHandler) DeleteImage ¶
func (imageHandler *AlibabaImageHandler) DeleteImage(imageIID irs.IID) (bool, error)
type AlibabaKeyPairHandler ¶
type AlibabaKeyPairHandler struct { Region idrv.RegionInfo Client *ecs.Client }
func (*AlibabaKeyPairHandler) CheckKeyPairFolder ¶ added in v0.3.8
func (keyPairHandler *AlibabaKeyPairHandler) CheckKeyPairFolder(keyPairPath string) error
================================= 공개 키 변환 및 키 정보 로컬 보관 로직 추가 =================================
func (*AlibabaKeyPairHandler) CreateKey ¶
func (keyPairHandler *AlibabaKeyPairHandler) CreateKey(keyPairReqInfo irs.KeyPairReqInfo) (irs.KeyPairInfo, error)
2021-10-27 이슈#480에 의해 Local Key 로직 제거
func (*AlibabaKeyPairHandler) DeleteKey ¶
func (keyPairHandler *AlibabaKeyPairHandler) DeleteKey(keyIID irs.IID) (bool, error)
2021-10-27 이슈#480에 의해 Local Key 로직 제거
func (*AlibabaKeyPairHandler) GetKey ¶
func (keyPairHandler *AlibabaKeyPairHandler) GetKey(keyIID irs.IID) (irs.KeyPairInfo, error)
2021-10-27 이슈#480에 의해 Local Key 로직 제거 혼선을 피하기 위해 keyPairID 대신 keyPairName으로 변경 함.
func (*AlibabaKeyPairHandler) ListKey ¶
func (keyPairHandler *AlibabaKeyPairHandler) ListKey() ([]*irs.KeyPairInfo, error)
type AlibabaNLBBackendServer ¶ added in v0.6.1
type AlibabaNLBHandler ¶ added in v0.6.1
type AlibabaNLBHandler struct { Region idrv.RegionInfo //Client *ecs.Client Client *slb.Client VMClient *ecs.Client VpcClient *vpc.Client }
func (*AlibabaNLBHandler) AddLoadBalancerListener ¶ added in v0.6.1
func (NLBHandler *AlibabaNLBHandler) AddLoadBalancerListener(nlbIID irs.IID, nlbReqInfo irs.NLBInfo) (irs.ListenerInfo, error)
////////
//리스너는 Client의 요청 및 입력 스트림을 수신하여 백엔드 영역의 VM그룹으로 전달한다. // 하나의 NLB는 하나의 리스너를 포함하며, 수신 프로토콜, IP 및 수신 포트로 구성된다. // 선택 가능한 수신 프로토콜은 TCP 및 UDP이며, IP는 CSP 또는 대상 Driver에서 자동 생성 및 관리된다. // 수신 포트는 1-65535 범위의 값으로 설정이 가능하다. //※ 리스너 IP에 매핑 되는 DNS-Name 지원: 추후 고려 //https://www.alibabacloud.com/help/en/server-load-balancer/latest/createloadbalancertcplistener
Newly created listeners are in the stopped state. After a listener is created, you must call the StartLoadBalancerListener operation to start the listener. This way, the listener can forward network traffic.
리스너를 생성하면 중단 상태임. startListener 호출하여 동작시켜야 함
func (*AlibabaNLBHandler) AddVMs ¶ added in v0.6.1
func (NLBHandler *AlibabaNLBHandler) AddVMs(nlbIID irs.IID, vmIIDs *[]irs.IID) (irs.VMGroupInfo, error)
loadBalancer에 VM추가 vm만 추가
func (*AlibabaNLBHandler) ChangeHealthCheckerInfo ¶ added in v0.6.1
func (NLBHandler *AlibabaNLBHandler) ChangeHealthCheckerInfo(nlbIID irs.IID, healthChecker irs.HealthCheckerInfo) (irs.HealthCheckerInfo, error)
HealthChecker 의 정보가 실제로는 listener에 들어있음. 따라서 nblId, port 에 해당하는 listener를 찾고 nlbInfo에 모든정보를 set(lb ID, listener protocol,port, healthchecker info)하여 healthchecker정보를 수정
func (*AlibabaNLBHandler) ChangeListener ¶ added in v0.6.1
func (NLBHandler *AlibabaNLBHandler) ChangeListener(nlbIID irs.IID, listener irs.ListenerInfo) (irs.ListenerInfo, error)
Spider에서 원하는 listener의 변경은 protocol, ip, port 의 변경아나 ALIBABA에서는 listener의 key 가 loadbalancerId, port 이므로 실제로 변경할 수 있는 parameter가 없음.
수정 가능한 항목은 healthcheck 부분으로 현재버전에서는 error로 return 향후 필요시 삭제 후 추가 하는 방법 고려.
func (*AlibabaNLBHandler) ChangeVMGroupInfo ¶ added in v0.6.1
func (NLBHandler *AlibabaNLBHandler) ChangeVMGroupInfo(nlbIID irs.IID, vmGroup irs.VMGroupInfo) (irs.VMGroupInfo, error)
------ Backend Control
func (*AlibabaNLBHandler) CreateNLB ¶ added in v0.6.1
https://www.alibabacloud.com/help/en/server-load-balancer/latest/createloadbalancer-2
같은이름의 NLB생성가능. ID가 다름.
func (*AlibabaNLBHandler) DeleteNLB ¶ added in v0.6.1
func (NLBHandler *AlibabaNLBHandler) DeleteNLB(nlbIID irs.IID) (bool, error)
NLB 삭제 After you delete an SLB instance, the listeners and tags added to the SLB instance are deleted.
func (*AlibabaNLBHandler) GetVMGroupHealthInfo ¶ added in v0.6.1
func (NLBHandler *AlibabaNLBHandler) GetVMGroupHealthInfo(nlbIID irs.IID) (irs.HealthInfo, error)
type AlibabaSecurityHandler ¶
type AlibabaSecurityHandler struct { Region idrv.RegionInfo Client *ecs.Client }
func (*AlibabaSecurityHandler) AddRules ¶ added in v0.5.4
func (securityHandler *AlibabaSecurityHandler) AddRules(securityIID irs.IID, reqSecurityRules *[]irs.SecurityRuleInfo) (irs.SecurityInfo, error)
SecurityGroup에 Rule 추가 공통 함수명은 AddRules 이나 실제 Alibaba는 AuthorizeSecurityRules SecurityGroup 생성시에도 호출 저장 후 rule 목록 조회하여 return
- vpcId deprecated
- function name 변경 : AuthorizeSecurityRules to AddRules
func (securityHandler *AlibabaSecurityHandler) AuthorizeSecurityRules(securityGroupId string, vpcId string, securityRuleInfos *[]irs.SecurityRuleInfo) (*[]irs.SecurityRuleInfo, error) { func (securityHandler *AlibabaSecurityHandler) AuthorizeSecurityRules(securityGroupId string, securityRuleInfos *[]irs.SecurityRuleInfo) (*[]irs.SecurityRuleInfo, error) {
func (*AlibabaSecurityHandler) CreateSecurity ¶
func (securityHandler *AlibabaSecurityHandler) CreateSecurity(securityReqInfo irs.SecurityReqInfo) (irs.SecurityInfo, error)
func (*AlibabaSecurityHandler) DeleteSecurity ¶
func (securityHandler *AlibabaSecurityHandler) DeleteSecurity(securityIID irs.IID) (bool, error)
func (*AlibabaSecurityHandler) ExtractSecurityInfo ¶ added in v0.1.4
func (securityHandler *AlibabaSecurityHandler) ExtractSecurityInfo(securityGroupResult *ecs.SecurityGroup) (irs.SecurityInfo, error)
func (*AlibabaSecurityHandler) ExtractSecurityRuleInfo ¶ added in v0.1.4
func (securityHandler *AlibabaSecurityHandler) ExtractSecurityRuleInfo(securityGroupId string) ([]irs.SecurityRuleInfo, error)
보안 그룹의 InBound / OutBound 정보를 조회함.
func (*AlibabaSecurityHandler) GetSecurity ¶
func (securityHandler *AlibabaSecurityHandler) GetSecurity(securityIID irs.IID) (irs.SecurityInfo, error)
func (*AlibabaSecurityHandler) ListSecurity ¶
func (securityHandler *AlibabaSecurityHandler) ListSecurity() ([]*irs.SecurityInfo, error)
func (*AlibabaSecurityHandler) RemoveRules ¶ added in v0.5.4
func (securityHandler *AlibabaSecurityHandler) RemoveRules(securityIID irs.IID, reqSecurityRules *[]irs.SecurityRuleInfo) (bool, error)
If the security group rule to be deleted does not exist, the RevokeSecurityGroup operation succeeds but no rule is deleted. func (securityHandler *AlibabaSecurityHandler) RevokeSecurityRules(securityGroupId string, securityRuleInfos *[]irs.SecurityRuleInfo) (*[]irs.SecurityRuleInfo, error) {
type AlibabaVMHandler ¶
type AlibabaVMHandler struct { Region idrv.RegionInfo Client *ecs.Client }
func (*AlibabaVMHandler) ConvertVMStatusString ¶ added in v0.1.4
func (vmHandler *AlibabaVMHandler) ConvertVMStatusString(vmStatus string) (irs.VMStatus, error)
알리 클라우드 라이프 사이클 : https://www.alibabacloud.com/help/doc-detail/25380.htm
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“
) <최종 상태> Running(동작 상태): MCIS가 동작 상태 Suspended(중지 상태): MCIS가 중지된 상태 Failed(실패 상태): MCIS가 오류로 인해 중단된 상태 Terminated(종료 상태): MCIS가 종료된 상태 <전이 상태> Creating(생성 진행 상태): MCIS가 생성되는 중간 상태 Suspending(중지 진행 상태): MCIS를 일시 중지하기 위한 중간 상태 Resuming(재개 진행 상태): MCIS를 다시 실행하기 위한 중간 상태 Rebooting(재시작 진행 상태): MCIS를 재부팅하는 상태 Terminating(종료 진행 상태): MCIS의 종료를 실행하고 있는 중간 상태
func (*AlibabaVMHandler) ExtractDescribeInstances ¶ added in v0.1.4
func (vmHandler *AlibabaVMHandler) ExtractDescribeInstances(instanceInfo *ecs.Instance) (irs.VMInfo, error)
@TODO : 2020-03-26 Ali클라우드 API 구조가 바뀐 것 같아서 임시로 변경해 놓음. func (vmHandler *AlibabaVMHandler) ExtractDescribeInstances() irs.VMInfo {
func (*AlibabaVMHandler) GetImageSize ¶ added in v0.5.4
func (vmHandler *AlibabaVMHandler) GetImageSize(ImageSystemId string) (int64, error)
주어진 이미지 id에 대한 이미지 사이즈 조회 -1 : 정보 조회 실패
func (*AlibabaVMHandler) GetVMStatus ¶
SHUTTING-DOWN / TERMINATED
func (*AlibabaVMHandler) ListVM ¶
func (vmHandler *AlibabaVMHandler) ListVM() ([]*irs.VMInfo, error)
func (*AlibabaVMHandler) ListVMStatus ¶
func (vmHandler *AlibabaVMHandler) ListVMStatus() ([]*irs.VMStatusInfo, error)
func (*AlibabaVMHandler) StartVM ¶
참고 : VM 생성 시 인증 방식은 KeyPair 또는 ID&PWD 방식이 가능하지만 계정은 모두 root - 비번 조회 기능은 없음
비밀번호는 8-30자로서 대문자, 소문자, 숫자 및/또는 특수 문자가 포함되어야 합니다.
@TODO : root 계정의 비번만 설정 가능한 데 다른 계정이 요청되었을 경우 예외 처리할 것인지.. 아니면 비번을 설정할 것인지 확인 필요. @TODO : PublicIp 요금제 방식과 대역폭 설정 방법 논의 필요
func (*AlibabaVMHandler) SuspendVM ¶
@TODO - 이슈 : 인스턴스 일시정지 시에 과금 정책을 결정해야 함 - StopCharging / KeepCharging
func (*AlibabaVMHandler) TerminateVM ¶
func (*AlibabaVMHandler) WaitForExist ¶ added in v0.3.14
VM 상태가 정보를 조회할 수 있는 상태가 될때까지 기다림(최대 30초간 대기)
func (*AlibabaVMHandler) WaitForRun ¶ added in v0.1.4
VM 정보를 조회할 수 있을 때까지 최대 30초간 대기
type AlibabaVPCHandler ¶ added in v0.1.4
type AlibabaVPCHandler struct { Region idrv.RegionInfo Client *vpc.Client }
func (*AlibabaVPCHandler) AddSubnet ¶ added in v0.2.1
func (VPCHandler *AlibabaVPCHandler) AddSubnet(vpcIID irs.IID, subnetInfo irs.SubnetInfo) (irs.VPCInfo, error)
func (*AlibabaVPCHandler) CreateSubnet ¶ added in v0.1.4
func (VPCHandler *AlibabaVPCHandler) CreateSubnet(vpcId string, reqSubnetInfo irs.SubnetInfo) (irs.SubnetInfo, error)
func (*AlibabaVPCHandler) CreateVPC ¶ added in v0.1.4
func (VPCHandler *AlibabaVPCHandler) CreateVPC(vpcReqInfo irs.VPCReqInfo) (irs.VPCInfo, error)
func (*AlibabaVPCHandler) DeleteSubnet ¶ added in v0.1.4
func (VPCHandler *AlibabaVPCHandler) DeleteSubnet(subnetIID irs.IID) (bool, error)
func (*AlibabaVPCHandler) DeleteVPC ¶ added in v0.1.4
func (VPCHandler *AlibabaVPCHandler) DeleteVPC(vpcIID irs.IID) (bool, error)
@TODO : 라우트 삭제 로직이 없어서 VPC가 삭제 안되는 현상이 있어서 라우트 정보를 조회해서 삭제하려다 서브넷 삭제 후 특정 시간 이후에 Route가 자동으로 삭제되기 때문에 임시로 4초 대기 후 VPC를 삭제하도록 로직을 변경함. @TODO : VPCHandler로 생성하지 않은 VPC의 경우 다른 서비스가 있을 수 있기 때문에 관련 서비스들을 조회후 삭제하는 로직이 필요할 수 있음.
- 삭제 오류 자동 할당된 Route가 남아있어서 삭제가 안되는 듯. ErrorCode: Forbbiden Recommend: RequestId: 8871BF19-330B-4F00-93ED-D886F2CE066F Message: Active custom route in vpc.)
func (*AlibabaVPCHandler) GetSubnet ¶ added in v0.1.4
func (VPCHandler *AlibabaVPCHandler) GetSubnet(reqSubnetId string) (irs.SubnetInfo, error)
func (*AlibabaVPCHandler) ListVPC ¶ added in v0.1.4
func (VPCHandler *AlibabaVPCHandler) ListVPC() ([]*irs.VPCInfo, error)
func (*AlibabaVPCHandler) RemoveSubnet ¶ added in v0.2.1
func (*AlibabaVPCHandler) WaitForRun ¶ added in v0.1.4
func (VPCHandler *AlibabaVPCHandler) WaitForRun(vpcId string) error
Pending , Available
type AlibabaVmSpecHandler ¶
type AlibabaVmSpecHandler struct { Region idrv.RegionInfo Client *ecs.Client }
func (*AlibabaVmSpecHandler) GetOrgVMSpec ¶
func (vmSpecHandler *AlibabaVmSpecHandler) GetOrgVMSpec(Name string) (string, error)
func (*AlibabaVmSpecHandler) GetVMSpec ¶
func (vmSpecHandler *AlibabaVmSpecHandler) GetVMSpec(Name string) (irs.VMSpecInfo, error)
func (*AlibabaVmSpecHandler) ListOrgVMSpec ¶
func (vmSpecHandler *AlibabaVmSpecHandler) ListOrgVMSpec() (string, error)
Alibaba Cloud의 정보 그대로를 가공 없이 JSON으로 리턴 함.
func (*AlibabaVmSpecHandler) ListVMSpec ¶
func (vmSpecHandler *AlibabaVmSpecHandler) ListVMSpec() ([]*irs.VMSpecInfo, error)
type RuleAction ¶ added in v0.5.5
type RuleAction string
const ( Add RuleAction = "Add" Remove RuleAction = "Remove" )