Documentation ¶
Overview ¶
VPC & Subnet 처리 (AlibabaCloud's Subnet --> VSwitch 임)
Index ¶
- Constants
- func AddEcsTags(client *ecs.Client, regionInfo idrv.RegionInfo, resType irs.RSType, ...) (*responses.CommonResponse, error)
- func AddVpcTags(client *vpc.Client, regionInfo idrv.RegionInfo, resType irs.RSType, ...) (*responses.CommonResponse, error)
- func AttachDisk(client *ecs.Client, regionInfo idrv.RegionInfo, ownerVM irs.IID, ...) error
- func BindpricingPolicy(priceResp AliPriceInfo, subscriptionType string, pricingModulePriceType string, ...) (irs.PricingPolicies, error)
- func CallEcsRequest(resType irs.RSType, client *ecs.Client, regionInfo idrv.RegionInfo, ...) (*responses.CommonResponse, error)
- func CallNlbRequest(resType irs.RSType, client *slb.Client, regionInfo idrv.RegionInfo, ...) (*responses.CommonResponse, error)
- func CallVpcRequest(resType irs.RSType, client *vpc.Client, regionInfo idrv.RegionInfo, ...) (*responses.CommonResponse, 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 DescribeAvailableSystemDisksByInstanceType(client *ecs.Client, regionId string, zoneId string, instanceChargeType string, ...) (ecs.AvailableZonesInDescribeAvailableResource, error)
- func DescribeDescribeEcsTags(client *ecs.Client, regionInfo idrv.RegionInfo, resType irs.RSType, ...) (*responses.CommonResponse, error)
- func DescribeDescribeNlbTags(client *slb.Client, regionInfo idrv.RegionInfo, resType irs.RSType, ...) (*responses.CommonResponse, error)
- func DescribeDescribeVpcTags(client *vpc.Client, regionInfo idrv.RegionInfo, resType irs.RSType, ...) (*responses.CommonResponse, 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 DescribeDisksIdOnly(client *ecs.Client, regionInfo idrv.RegionInfo) ([]*irs.IID, error)
- func DescribeImageByImageId(client *ecs.Client, regionInfo idrv.RegionInfo, imageIID irs.IID, ...) (ecs.Image, error)
- func DescribeImageOsType(client *ecs.Client, regionInfo idrv.RegionInfo, imageIID irs.IID, ...) (string, error)
- func DescribeImageSize(client *ecs.Client, regionInfo idrv.RegionInfo, myImageIID irs.IID) (int64, error)
- func DescribeImageStatus(client *ecs.Client, regionInfo idrv.RegionInfo, myImageIID irs.IID, ...) (string, error)
- func DescribeImages(client *ecs.Client, regionInfo idrv.RegionInfo, imageIIDs []irs.IID, ...) ([]ecs.Image, error)
- func DescribeImagesIdOnly(client *ecs.Client, regionInfo idrv.RegionInfo, isMyImage bool) ([]*irs.IID, 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 DescribeInstancesIdOnly(client *ecs.Client, regionInfo idrv.RegionInfo) ([]*irs.IID, error)
- func DescribeRegions(client *ecs.Client) (*ecs.DescribeRegionsResponse, error)
- func DescribeZonesByRegion(client *ecs.Client, regionId string) (*ecs.DescribeZonesResponse, 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 ExtractMyImageDescribeInfo(aliMyImage *ecs.Image) (irs.MyImageInfo, error)
- func ExtractSubnetDescribeInfo(subnetInfo vpc.VSwitch) irs.SubnetInfo
- func ExtractTagResourceInfo(tagResource *AliTagResource) (irs.TagInfo, error)
- func ExtractTagsDescribeInfo(aliTag *ecs.Tag) (irs.TagInfo, error)
- func ExtractVMSpecInfo(Region string, instanceTypeInfo ecs.InstanceType) irs.VMSpecInfo
- func ExtractVpcDescribeInfo(vpcInfo *vpc.Vpc) irs.VPCInfo
- func GetAliTargetApi(resType irs.RSType) (string, error)
- func GetAlibabaApiEndPoint(regionId string, productCode string) string
- func GetAlibabaApiVPCEndpoint(regionId string, productCode string) string
- func GetAlibabaProductCode(resType irs.RSType) (string, error)
- func GetAlibabaResourceType(resType irs.RSType) (string, error)
- func GetCBResourceGroupName() string
- func GetCBSubnetName() string
- func GetCBVirutalNetworkName() string
- func GetCBVnetDefaultCidr() string
- func GetCallLogScheme(region idrv.RegionInfo, resourceType call.RES_TYPE, resourceName string, ...) call.CLOUDLOGSCHEMA
- func GetDescribeInstanceTypesForPricing(bssClient *bssopenapi.Client, regionName string, instanceType string, ...) (irs.ProductInfo, error)
- func GetImageStatus(ecsImage ecs.Image) string
- func GetOsType(ecsImage ecs.Image) string
- func GetSnapShotIdList(ecsImage ecs.Image) []string
- func GetSubnet(VpcClient *vpc.Client, reqSubnetId string, zone string) (irs.SubnetInfo, error)
- func GetZoneStatus(status string) irs.ZoneStatus
- func HasKey(key string, keyValueList []irs.KeyValue) bool
- func InitLog()
- func LoggingError(hiscallInfo call.CLOUDLOGSCHEMA, err error)
- func LoggingInfo(hiscallInfo call.CLOUDLOGSCHEMA, start time.Time)
- func QueryProductList(bssClient *bssopenapi.Client) (*bssopenapi.QueryProductListResponse, error)
- func SetNameTag(Client *ecs.Client, resourceId string, resourceType string, value string) bool
- func WaitForEcsTagExist(client *ecs.Client, regionInfo idrv.RegionInfo, resType irs.RSType, ...) (bool, error)
- func WaitForImageStatus(client *ecs.Client, regionInfo idrv.RegionInfo, imageIID irs.IID, ...) (irs.MyImageStatus, error)
- func WaitForNlbTagExist(client *slb.Client, regionInfo idrv.RegionInfo, resType irs.RSType, ...) (bool, error)
- func WaitForVpcTagExist(client *vpc.Client, regionInfo idrv.RegionInfo, resType irs.RSType, ...) (bool, error)
- type AliData
- type AliInstanceType
- type AliInstanceTypes
- type AliInstanceTypesResponse
- type AliModuleDetail
- type AliModuleDetails
- type AliPriceInfo
- type AliPromotionDetail
- type AliPromotionDetails
- type AliProudctInstanceTypes
- type AliResourceTypeCount
- type AliTag
- type AliTagResource
- type AliTagResources
- type AliTagResourcesResponse
- type AliTagResponse
- type AlibabaCBNetworkInfo
- type AlibabaClusterHandler
- func (ach *AlibabaClusterHandler) AddNodeGroup(clusterIID irs.IID, nodeGroupReqInfo irs.NodeGroupInfo) (irs.NodeGroupInfo, error)
- func (ach *AlibabaClusterHandler) ChangeNodeGroupScaling(clusterIID irs.IID, nodeGroupIID irs.IID, desiredNodeSize int, minNodeSize int, ...) (irs.NodeGroupInfo, error)
- func (ach *AlibabaClusterHandler) CreateCluster(clusterReqInfo irs.ClusterInfo) (irs.ClusterInfo, error)
- func (ach *AlibabaClusterHandler) DeleteCluster(clusterIID irs.IID) (bool, error)
- func (ach *AlibabaClusterHandler) GetCluster(clusterIID irs.IID) (irs.ClusterInfo, error)
- func (ach *AlibabaClusterHandler) ListCluster() ([]*irs.ClusterInfo, error)
- func (alibabaClusterHandler *AlibabaClusterHandler) ListIID() ([]*irs.IID, error)
- func (ach *AlibabaClusterHandler) RemoveNodeGroup(clusterIID irs.IID, nodeGroupIID irs.IID) (bool, error)
- func (ach *AlibabaClusterHandler) SetNodeGroupAutoScaling(clusterIID irs.IID, nodeGroupIID irs.IID, on bool) (bool, error)
- func (ach *AlibabaClusterHandler) UpgradeCluster(clusterIID irs.IID, newVersion string) (irs.ClusterInfo, error)
- 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)
- func (diskHandler *AlibabaDiskHandler) ListIID() ([]*irs.IID, error)
- type AlibabaImageHandler
- func (imageHandler *AlibabaImageHandler) CheckWindowsImage(imageIID irs.IID) (bool, error)
- 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) ListIID() ([]*irs.IID, error)
- func (keyPairHandler *AlibabaKeyPairHandler) ListKey() ([]*irs.KeyPairInfo, error)
- type AlibabaMyImageHandler
- func (myImageHandler AlibabaMyImageHandler) CheckWindowsImage(myImageIID irs.IID) (bool, error)
- func (myImageHandler AlibabaMyImageHandler) DeleteMyImage(myImageIID irs.IID) (bool, error)
- func (myImageHandler *AlibabaMyImageHandler) DeleteSnapshotBySnapshotID(snapshotIID irs.IID) (bool, error)
- func (myImageHandler AlibabaMyImageHandler) GetMyImage(myImageIID irs.IID) (irs.MyImageInfo, error)
- func (myImageHandler *AlibabaMyImageHandler) ListIID() ([]*irs.IID, error)
- func (myImageHandler AlibabaMyImageHandler) ListMyImage() ([]*irs.MyImageInfo, error)
- func (myImageHandler AlibabaMyImageHandler) SnapshotVM(snapshotReqInfo irs.MyImageInfo) (irs.MyImageInfo, 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) ListIID() ([]*irs.IID, error)
- func (NLBHandler *AlibabaNLBHandler) ListNLB() ([]*irs.NLBInfo, error)
- func (NLBHandler *AlibabaNLBHandler) RemoveVMs(nlbIID irs.IID, vmIIDs *[]irs.IID) (bool, error)
- type AlibabaPriceInfoHandler
- type AlibabaRegionZoneHandler
- func (regionZoneHandler AlibabaRegionZoneHandler) GetRegionZone(reqRegionId string) (irs.RegionZoneInfo, error)
- func (regionZoneHandler AlibabaRegionZoneHandler) ListOrgRegion() (string, error)
- func (regionZoneHandler AlibabaRegionZoneHandler) ListOrgZone() (string, error)
- func (regionZoneHandler AlibabaRegionZoneHandler) ListRegionZone() ([]*irs.RegionZoneInfo, 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) ListIID() ([]*irs.IID, error)
- func (securityHandler *AlibabaSecurityHandler) ListSecurity() ([]*irs.SecurityInfo, error)
- func (securityHandler *AlibabaSecurityHandler) RemoveRules(securityIID irs.IID, reqSecurityRules *[]irs.SecurityRuleInfo) (bool, error)
- type AlibabaTagHandler
- func (tagHandler *AlibabaTagHandler) AddTag(resType irs.RSType, resIID irs.IID, tag irs.KeyValue) (irs.KeyValue, error)
- func (tagHandler *AlibabaTagHandler) FindTag(resType irs.RSType, keyword string) ([]*irs.TagInfo, error)
- func (tagHandler *AlibabaTagHandler) GetTag(resType irs.RSType, resIID irs.IID, key string) (irs.KeyValue, error)
- func (tagHandler *AlibabaTagHandler) ListTag(resType irs.RSType, resIID irs.IID) ([]irs.KeyValue, error)
- func (tagHandler *AlibabaTagHandler) RemoveTag(resType irs.RSType, resIID irs.IID, key string) (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) ListIID() ([]*irs.IID, 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) GetVPC(vpcIID irs.IID) (irs.VPCInfo, error)
- func (VPCHandler *AlibabaVPCHandler) ListIID() ([]*irs.IID, 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 DescribeTagsResponse
- type DescribeVSwitchesResponse
- type DescribeVpcsResponse
- type DiskSize
- type NatGatewayIds
- type RouteTable
- type RouterTableIds
- type RuleAction
- type SecondaryCidrBlocks
- type Tag
- type Tags
- type UserCidrs
- type VSwitch
- type VSwitchIds
- type VSwitches
- type Vpc
- type Vpcs
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 ( ALIBABA_IMAGE_STATE_CREATING = "Creating" ALIBABA_IMAGE_STATE_WAITING = "Waiting" ALIBABA_IMAGE_STATE_AVAILABLE = "Available" ALIBABA_IMAGE_STATE_UNAVAILABLE = "Unavailable" ALIBABA_IMAGE_STATE_CREATEFAILED = "Createfailed" ALIBABA_IMAGE_STATE_DEPRECATED = "Deprecated" ALIBABA_IMAGE_STATE_ERROR = "Error" RESOURCE_TYPE_MYIMAGE = "image" IMAGE_TAG_DEFAULT = "Name" IMAGE_TAG_SOURCE_VM = "CB-VMSNAPSHOT-SOURCEVM-ID" )
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 AddEcsTags ¶ added in v0.9.2
func AddVpcTags ¶ added in v0.9.2
func AddVpcTags(client *vpc.Client, regionInfo idrv.RegionInfo, resType irs.RSType, resIID irs.IID, tag irs.KeyValue) (*responses.CommonResponse, error)
//////// VPC begin /////////////
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 BindpricingPolicy ¶ added in v0.8.2
func BindpricingPolicy(priceResp AliPriceInfo, subscriptionType string, pricingModulePriceType string, regionName string, instanceType string) (irs.PricingPolicies, error)
func CallEcsRequest ¶ added in v0.9.2
func CallEcsRequest(resType irs.RSType, client *ecs.Client, regionInfo idrv.RegionInfo, apiName string, queryParams map[string]string) (*responses.CommonResponse, error)
//// Call 공통 /////////// EcsRequest : Elastic Compute Service(ECS)
func CallNlbRequest ¶ added in v0.9.6
func CallVpcRequest ¶ added in v0.9.2
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 DescribeAvailableSystemDisksByInstanceType ¶ added in v0.8.13
func DescribeAvailableSystemDisksByInstanceType(client *ecs.Client, regionId string, zoneId string, instanceChargeType string, destinationResource string, insTanceType string) (ecs.AvailableZonesInDescribeAvailableResource, error)
리전별로 AvailableResource 중에서 InstanceType 별로 사용 가능한 SystemDisk 목록 조회
func DescribeDescribeEcsTags ¶ added in v0.9.2
func DescribeDescribeNlbTags ¶ added in v0.9.6
func DescribeDescribeVpcTags ¶ added in v0.9.2
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 DescribeDisksIdOnly ¶ added in v0.9.8
* 디스크 목록 조회
func DescribeImageByImageId ¶ added in v0.6.8
func DescribeImageByImageId(client *ecs.Client, regionInfo idrv.RegionInfo, imageIID irs.IID, isMyImage bool) (ecs.Image, error)
* ImageID로 1개 Image의 정보 조회
func DescribeImageOsType ¶ added in v0.6.16
func DescribeImageOsType(client *ecs.Client, regionInfo idrv.RegionInfo, imageIID irs.IID, isMyImage bool) (string, error)
Image의 OS Type을 string으로 반환
func DescribeImageSize ¶ added in v0.6.8
func DescribeImageSize(client *ecs.Client, regionInfo idrv.RegionInfo, myImageIID irs.IID) (int64, error)
* 이미지의 크기 조회
func DescribeImageStatus ¶ added in v0.6.8
func DescribeImageStatus(client *ecs.Client, regionInfo idrv.RegionInfo, myImageIID irs.IID, aliImageStatus string) (string, error)
* 이미지의 상태 조회 조회하고 싶은 상태값을 줘야 정상적으로 조회가 됨.(default = available ) 그래서 request 객체에 status를 set하고 DescribeImage를 직접호출함.
func DescribeImages ¶ added in v0.6.8
func DescribeImages(client *ecs.Client, regionInfo idrv.RegionInfo, imageIIDs []irs.IID, isMyImage bool) ([]ecs.Image, error)
* Image 목록 조회
imageOwnerAlias 종류 : self, system, others, marketplace myimage 는 imageOwnerAlias = self 로 isMyImage로 구분 향후 system, others, marketplace 등이 추가되면 해당 구분자 변경필요.
func DescribeImagesIdOnly ¶ added in v0.9.8
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 DescribeInstancesIdOnly ¶ added in v0.9.8
* Instance ID 목록 조회
func DescribeRegions ¶ added in v0.7.6
func DescribeRegions(client *ecs.Client) (*ecs.DescribeRegionsResponse, error)
func DescribeZonesByRegion ¶ added in v0.7.6
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 ExtractMyImageDescribeInfo ¶ added in v0.6.8
func ExtractMyImageDescribeInfo(aliMyImage *ecs.Image) (irs.MyImageInfo, error)
func ExtractSubnetDescribeInfo ¶
func ExtractSubnetDescribeInfo(subnetInfo vpc.VSwitch) irs.SubnetInfo
Subnet(VSwitch) 정보를 추출함
func ExtractTagResourceInfo ¶ added in v0.9.2
func ExtractTagResourceInfo(tagResource *AliTagResource) (irs.TagInfo, error)
FindTag의 경우 Tag가 아닌 TagResource 를 추출해야 함. func ExtractTagResourceInfo(tagResource *ecs.TagResource) (irs.TagInfo, error) {
func ExtractTagsDescribeInfo ¶ added in v0.9.2
tag 자체가 arr임.
func ExtractVMSpecInfo ¶
func ExtractVMSpecInfo(Region string, instanceTypeInfo ecs.InstanceType) irs.VMSpecInfo
인스턴스 스펙 정보를 추출함
func GetAliTargetApi ¶ added in v0.9.2
resource Type별로 바라보는 api가 다름. ( ecs, bss, ... )
func GetAlibabaApiEndPoint ¶ added in v0.9.2
Endpoint format:[product_code].[region_id].aliyuncs.com
func GetAlibabaApiVPCEndpoint ¶ added in v0.9.2
func GetAlibabaProductCode ¶ added in v0.9.2
Alibaba에서 사용되는 리소스별 api product type
func GetAlibabaResourceType ¶ added in v0.9.2
cb-spider의 resourceType 을 alibaba의 resourceType으로
func GetCBResourceGroupName ¶
func GetCBResourceGroupName() string
func GetCBVnetDefaultCidr ¶
func GetCBVnetDefaultCidr() string
func GetCallLogScheme ¶ added in v0.7.3
func GetCallLogScheme(region idrv.RegionInfo, resourceType call.RES_TYPE, resourceName string, apiName string) call.CLOUDLOGSCHEMA
func GetDescribeInstanceTypesForPricing ¶ added in v0.8.2
func GetDescribeInstanceTypesForPricing(bssClient *bssopenapi.Client, regionName string, instanceType string, filter map[string]*string, productFamily string) (irs.ProductInfo, error)
region의 특정 instanceType의 내용조회 func GetDescribeInstanceTypesForPricing(bssClient *bssopenapi.Client, instanceType string) (map[string]interface{}, error) {
func GetImageStatus ¶ added in v0.6.16
Image에서 상태만 추출
func GetSnapShotIdList ¶ added in v0.6.16
Image에서 SnapShotID 목록 추출
func GetZoneStatus ¶ added in v0.7.6
func GetZoneStatus(status string) irs.ZoneStatus
Alibaba에서 Zone에 대한 status는 관리하고 있지 않음
func LoggingError ¶ added in v0.7.3
func LoggingError(hiscallInfo call.CLOUDLOGSCHEMA, err error)
func LoggingInfo ¶ added in v0.7.3
func LoggingInfo(hiscallInfo call.CLOUDLOGSCHEMA, start time.Time)
func QueryProductList ¶ added in v0.8.2
func QueryProductList(bssClient *bssopenapi.Client) (*bssopenapi.QueryProductListResponse, error)
Alibaba 가용한 모든 서비스 호출
func SetNameTag ¶
func WaitForEcsTagExist ¶ added in v0.9.2
func WaitForEcsTagExist(client *ecs.Client, regionInfo idrv.RegionInfo, resType irs.RSType, resIID irs.IID, tag string, expectStatus bool) (bool, error)
해당 ECS Resource에 특정 tag가 있는지 조회 :
func WaitForImageStatus ¶ added in v0.6.8
func WaitForImageStatus(client *ecs.Client, regionInfo idrv.RegionInfo, imageIID irs.IID, requestStatus string) (irs.MyImageStatus, error)
* 상태조회 처리 : DescribeImages에서 status값이 필수임. 없는 경우 default available이므로 다른 상태값이 조회되게 하려면 콤마(,)를 구분자로 여러개 넣을 수 있음.
요청시 상태 -> 원하는 상태 또는 실패상태를 Return
Types ¶
type AliData ¶ added in v0.8.4
type AliData struct { OriginalPrice float64 DiscountPrice float64 Currency string `json:"Currency,omitempty"` Quantity int64 ModuleDetails AliModuleDetails `json:"ModuleDetails"` PromotionDetails AliPromotionDetails `json:"PromotionDetails"` TradePrice float64 }
Alibaba GetSubscriptionPrice ModuleDetails, PromotionDetails 배열 데이터 존재
type AliInstanceType ¶ added in v0.8.4
type AliInstanceType struct { InstanceType string `json:"InstanceTypeId,omitempty"` Vcpu int64 `json:"CpuCoreCount,omitempty"` Memory float64 `json:"MemorySize,omitempty"` // Storage string `json:"LocalStorageCategory,omitempty"` 잘못된 데이터 맵핑 Gpu string `json:"GPUSpec,omitempty"` GpuMemory int64 `json:"GPUAmount,omitempty"` }
type AliInstanceTypes ¶ added in v0.8.4
type AliInstanceTypes struct {
InstanceType []AliInstanceType `json:"InstanceType"`
}
type AliInstanceTypesResponse ¶ added in v0.8.4
type AliInstanceTypesResponse struct { RequestId string `json:"RequestId"` NextToken string `json:"NextToken"` InstanceTypes struct { InstanceType []ecs.InstanceType `json:"InstanceType"` } `json:"InstanceTypes"` }
type AliModuleDetail ¶ added in v0.8.4
type AliModuleDetails ¶ added in v0.8.4
type AliModuleDetails struct {
ModuleDetail []AliModuleDetail `json:"ModuleDetail"`
}
type AliPriceInfo ¶ added in v0.8.4
Alibaba GetSubscriptionPrice Response Data 최상위
type AliPromotionDetail ¶ added in v0.8.4
type AliPromotionDetails ¶ added in v0.8.4
type AliPromotionDetails struct {
PromotionDetail []AliPromotionDetail
}
Alibaba ServicePeriodUnit par 값을 Year로 넘길시 프로모션 관련 정보도 리턴을 해줌.
type AliProudctInstanceTypes ¶ added in v0.8.4
type AliProudctInstanceTypes struct {
InstanceTypes AliInstanceTypes `json:"InstanceTypes"`
}
Alibaba DescribeInstanceTypes Response start
type AliResourceTypeCount ¶ added in v0.9.2
type AliResourceTypeCount struct { Instance int `json:"Instance"` Image int `json:"Image"` Ddh int `json:"Ddh"` SnapshotPolicy int `json:"SnapshotPolicy"` Snapshot int `json:"Snapshot"` ReservedInstance int `json:"ReservedInstance"` LaunchTemplate int `json:"LaunchTemplate"` Eni int `json:"Eni"` Disk int `json:"Disk"` KeyPair int `json:"KeyPair"` Volume int `json:"Volume"` }
type AliTag ¶ added in v0.9.2
type AliTag struct { TagKey string `json:"TagKey"` TagValue string `json:"TagValue"` ResourceTypeCount AliResourceTypeCount `json:"ResourceTypeCount"` }
type AliTagResource ¶ added in v0.9.2
type AliTagResources ¶ added in v0.9.2
type AliTagResources struct {
Resources []AliTagResource `json:"Resource" xml:"Resource"`
}
type AliTagResourcesResponse ¶ added in v0.9.2
type AliTagResourcesResponse struct { RequestId string `json:"RequestId" xml:"RequestId"` PageSize int `json:"PageSize" xml:"PageSize"` PageNumber int `json:"PageNumber" xml:"PageNumber"` TotalCount int `json:"TotalCount" xml:"TotalCount"` AliTagResources AliTagResources `json:"Resources" xml:"Resources"` }
type AliTagResponse ¶ added in v0.9.2
type AlibabaCBNetworkInfo ¶
type AlibabaClusterHandler ¶ added in v0.6.9
type AlibabaClusterHandler struct { RegionInfo idrv.RegionInfo CredentialInfo idrv.CredentialInfo VpcClient *vpc2016.Client CsClient *cs2015.Client EcsClient *ecs2014.Client }
func (*AlibabaClusterHandler) AddNodeGroup ¶ added in v0.6.9
func (ach *AlibabaClusterHandler) AddNodeGroup(clusterIID irs.IID, nodeGroupReqInfo irs.NodeGroupInfo) (irs.NodeGroupInfo, error)
func (*AlibabaClusterHandler) ChangeNodeGroupScaling ¶ added in v0.6.9
func (*AlibabaClusterHandler) CreateCluster ¶ added in v0.6.9
func (ach *AlibabaClusterHandler) CreateCluster(clusterReqInfo irs.ClusterInfo) (irs.ClusterInfo, error)
func (*AlibabaClusterHandler) DeleteCluster ¶ added in v0.6.9
func (ach *AlibabaClusterHandler) DeleteCluster(clusterIID irs.IID) (bool, error)
func (*AlibabaClusterHandler) GetCluster ¶ added in v0.6.9
func (ach *AlibabaClusterHandler) GetCluster(clusterIID irs.IID) (irs.ClusterInfo, error)
func (*AlibabaClusterHandler) ListCluster ¶ added in v0.6.9
func (ach *AlibabaClusterHandler) ListCluster() ([]*irs.ClusterInfo, error)
func (*AlibabaClusterHandler) ListIID ¶ added in v0.9.6
func (alibabaClusterHandler *AlibabaClusterHandler) ListIID() ([]*irs.IID, error)
func (*AlibabaClusterHandler) RemoveNodeGroup ¶ added in v0.6.9
func (*AlibabaClusterHandler) SetNodeGroupAutoScaling ¶ added in v0.6.9
func (*AlibabaClusterHandler) UpgradeCluster ¶ added in v0.6.9
func (ach *AlibabaClusterHandler) UpgradeCluster(clusterIID irs.IID, newVersion string) (irs.ClusterInfo, error)
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) CheckWindowsImage ¶ added in v0.6.15
func (imageHandler *AlibabaImageHandler) CheckWindowsImage(imageIID irs.IID) (bool, error)
WindowOS 여부
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) ListIID ¶ added in v0.9.6
func (keyPairHandler *AlibabaKeyPairHandler) ListIID() ([]*irs.IID, error)
func (*AlibabaKeyPairHandler) ListKey ¶
func (keyPairHandler *AlibabaKeyPairHandler) ListKey() ([]*irs.KeyPairInfo, error)
type AlibabaMyImageHandler ¶ added in v0.6.8
type AlibabaMyImageHandler struct { Region idrv.RegionInfo Client *ecs.Client }
func (AlibabaMyImageHandler) CheckWindowsImage ¶ added in v0.6.15
func (myImageHandler AlibabaMyImageHandler) CheckWindowsImage(myImageIID irs.IID) (bool, error)
MyImage 의 window 여부 return
func (AlibabaMyImageHandler) DeleteMyImage ¶ added in v0.6.8
func (myImageHandler AlibabaMyImageHandler) DeleteMyImage(myImageIID irs.IID) (bool, error)
MyImage 삭제 Image 삭제 후 Snapshot 삭제 가능 : - A snapshot that has been used to create custom images cannot be deleted. The snapshot can be deleted only after the created custom images are deleted Image를 Instance가 사용중이면 삭제 불가. image로 작업중이면 삭제 불가 A custom image cannot be deleted in the following scenarios:
The image is being imported. You can go to the Task Logs page in the Elastic Compute Service (ECS) console to cancel the image import task. After the image import task is canceled, you can delete the image. For more information, see Import custom images. The image is being exported. You can go to the Task Logs page in the ECS console to cancel the image export task. After the image export task is canceled, you can delete the image. For more information, see Export a custom image. The image is being used by ECS instances
func (*AlibabaMyImageHandler) DeleteSnapshotBySnapshotID ¶ added in v0.6.16
func (myImageHandler *AlibabaMyImageHandler) DeleteSnapshotBySnapshotID(snapshotIID irs.IID) (bool, error)
MyImage에 대한 snap 삭제 If the specified snapshot ID does not exist, the request is ignored. A snapshot that has been used to create custom images cannot be deleted. The snapshot can be deleted only after the created custom images are deleted
func (AlibabaMyImageHandler) GetMyImage ¶ added in v0.6.8
func (myImageHandler AlibabaMyImageHandler) GetMyImage(myImageIID irs.IID) (irs.MyImageInfo, error)
func (*AlibabaMyImageHandler) ListIID ¶ added in v0.9.6
func (myImageHandler *AlibabaMyImageHandler) ListIID() ([]*irs.IID, error)
func (AlibabaMyImageHandler) ListMyImage ¶ added in v0.6.8
func (myImageHandler AlibabaMyImageHandler) ListMyImage() ([]*irs.MyImageInfo, error)
* owner=self인 Image목록 조회 공통으로 DescribeImages를 사용하기 때문에 구분으로 isMyImage = true 로 전송 필요
func (AlibabaMyImageHandler) SnapshotVM ¶ added in v0.6.8
func (myImageHandler AlibabaMyImageHandler) SnapshotVM(snapshotReqInfo irs.MyImageInfo) (irs.MyImageInfo, 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)
func (*AlibabaNLBHandler) ListIID ¶ added in v0.9.6
func (NLBHandler *AlibabaNLBHandler) ListIID() ([]*irs.IID, error)
type AlibabaPriceInfoHandler ¶ added in v0.8.2
type AlibabaPriceInfoHandler struct {
BssClient *bssopenapi.Client
}
func (*AlibabaPriceInfoHandler) GetPriceInfo ¶ added in v0.8.2
func (*AlibabaPriceInfoHandler) ListProductFamily ¶ added in v0.8.2
func (priceInfoHandler *AlibabaPriceInfoHandler) ListProductFamily(regionName string) ([]string, error)
type AlibabaRegionZoneHandler ¶ added in v0.7.6
type AlibabaRegionZoneHandler struct { Region idrv.RegionInfo Client *ecs.Client }
func (AlibabaRegionZoneHandler) GetRegionZone ¶ added in v0.7.6
func (regionZoneHandler AlibabaRegionZoneHandler) GetRegionZone(reqRegionId string) (irs.RegionZoneInfo, error)
특정 Region에 대한 정보 조회.
func (AlibabaRegionZoneHandler) ListOrgRegion ¶ added in v0.7.6
func (regionZoneHandler AlibabaRegionZoneHandler) ListOrgRegion() (string, error)
모든 Region 정보 조회(json return)
func (AlibabaRegionZoneHandler) ListOrgZone ¶ added in v0.7.6
func (regionZoneHandler AlibabaRegionZoneHandler) ListOrgZone() (string, error)
모든 Zone 정보 조회(json return) Region에 따라 zone 정보가 달려있으므로 region 조회 후 -> zone 정보 조회
func (AlibabaRegionZoneHandler) ListRegionZone ¶ added in v0.7.6
func (regionZoneHandler AlibabaRegionZoneHandler) ListRegionZone() ([]*irs.RegionZoneInfo, error)
모든 Region 및 Zone 정보 조회
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) ListIID ¶ added in v0.9.6
func (securityHandler *AlibabaSecurityHandler) ListIID() ([]*irs.IID, 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 AlibabaTagHandler ¶ added in v0.9.2
type AlibabaTagHandler struct { Region idrv.RegionInfo Client *ecs.Client CsClient *cs.Client VpcClient *vpc.Client SlbClient *slb.Client }
func (*AlibabaTagHandler) AddTag ¶ added in v0.9.2
func (tagHandler *AlibabaTagHandler) AddTag(resType irs.RSType, resIID irs.IID, tag irs.KeyValue) (irs.KeyValue, error)
* ECS Instances 아래에 Tags and ResourceGroup이 있음. AddTag(resType RSType, resIID IID, tag KeyValue) (KeyValue, error)
func (*AlibabaTagHandler) FindTag ¶ added in v0.9.2
func (tagHandler *AlibabaTagHandler) FindTag(resType irs.RSType, keyword string) ([]*irs.TagInfo, error)
Find tags by tag key or value resType: ALL | VPC, SUBNET, etc.,. ecs기준 : Ddh, Disk, Eni, Image, Instance, KeyPair, LaunchTemplate, ReservedInstance, Securitygroup, Snapshot, SnapshotPolicy, Volume, keyword: The keyword to search for in the tag key or value. if you want to find all tags, set keyword to "" or "*". 해당 Resource Type에 tag가 있는 것들. ListTag는 resourceId가 있으나 당 function은 더 넒음
type AlibabaVMHandler ¶
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 : 정보 조회 실패 deprecated
func (*AlibabaVMHandler) GetVMStatus ¶
SHUTTING-DOWN / TERMINATED
func (*AlibabaVMHandler) ListIID ¶ added in v0.9.6
func (vmHandler *AlibabaVMHandler) ListIID() ([]*irs.IID, error)
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) ListIID ¶ added in v0.9.6
func (VPCHandler *AlibabaVPCHandler) ListIID() ([]*irs.IID, 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 DescribeTagsResponse ¶ added in v0.9.2
type DescribeVSwitchesResponse ¶ added in v0.9.2
type DescribeVpcsResponse ¶ added in v0.9.2
type NatGatewayIds ¶ added in v0.9.2
type NatGatewayIds struct {
NatGatewayIds []string `json:"NatGatewayIds"`
}
type RouteTable ¶ added in v0.9.2
type RouterTableIds ¶ added in v0.9.2
type RouterTableIds struct {
RouterTableIds []string `json:"RouterTableIds"`
}
type RuleAction ¶ added in v0.5.5
type RuleAction string
const ( Add RuleAction = "Add" Remove RuleAction = "Remove" )
type SecondaryCidrBlocks ¶ added in v0.9.2
type SecondaryCidrBlocks struct {
SecondaryCidrBlock []string `json:"SecondaryCidrBlock"`
}
type VSwitch ¶ added in v0.9.2
type VSwitch struct { Status string `json:"Status"` IsDefault bool `json:"IsDefault"` Description string `json:"Description"` ResourceGroupId string `json:"ResourceGroupId"` ZoneId string `json:"ZoneId"` NetworkAclId string `json:"NetworkAclId"` AvailableIpAddressCount int `json:"AvailableIpAddressCount"` VSwitchId string `json:"VSwitchId"` CidrBlock string `json:"CidrBlock"` RouteTable RouteTable `json:"RouteTable"` VpcId string `json:"VpcId"` OwnerId int64 `json:"OwnerId"` CreationTime string `json:"CreationTime"` VSwitchName string `json:"VSwitchName"` Ipv6CidrBlock string `json:"Ipv6CidrBlock"` Tags Tags `json:"Tags"` }
type VSwitchIds ¶ added in v0.9.2
type VSwitchIds struct {
VSwitchId []string `json:"VSwitchId"`
}
type Vpc ¶ added in v0.9.2
type Vpc struct { Status string `json:"Status"` IsDefault bool `json:"IsDefault"` CenStatus string `json:"CenStatus"` Description string `json:"Description"` ResourceGroupId string `json:"ResourceGroupId"` VSwitchIds VSwitchIds `json:"VSwitchIds"` SecondaryCidrBlocks SecondaryCidrBlocks `json:"SecondaryCidrBlocks"` CidrBlock string `json:"CidrBlock"` RouterTableIds RouterTableIds `json:"RouterTableIds"` UserCidrs UserCidrs `json:"UserCidrs"` NetworkAclNum int `json:"NetworkAclNum"` AdvancedResource bool `json:"AdvancedResource"` VRouterId string `json:"VRouterId"` NatGatewayIds NatGatewayIds `json:"NatGatewayIds"` VpcId string `json:"VpcId"` OwnerId int64 `json:"OwnerId"` CreationTime string `json:"CreationTime"` VpcName string `json:"VpcName"` EnabledIpv6 bool `json:"EnabledIpv6"` RegionId string `json:"RegionId"` Ipv6CidrBlock string `json:"Ipv6CidrBlock"` Tags Tags `json:"Tags"` }