resources

package
v0.8.18 Latest Latest
Warning

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

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

Documentation

Overview

Proof of Concepts for the Cloud-Barista Multi-Cloud Project.

by CB-Spider Team, 2019.03.

Index

Constants

View Source
const (
	Disk_Status_Attached   = "ATTACHED"
	Disk_Status_Unattached = "UNATTACHED"
)
View Source
const (
	TENCENT_IMAGE_STATE_CREATING = "CREATING"
	TENCENT_IMAGE_STATE_NORMAL   = "NORMAL"
	TENCENT_IMAGE_STATE_USING    = "USING"

	TENCENT_IMAGE_STATE_ERROR = "Error"

	TENCENT_SNAPSHOT_STATE_NORMAL      = "NORMAL"
	TENCENT_SNAPSHOT_STATE_CREATING    = "CREATING"
	TENCENT_SNAPSHOT_STATE_ROLLBACKING = "ROLLBACKING"

	RESOURCE_TYPE_MYIMAGE = "image"
	IMAGE_TAG_DEFAULT     = "Name"
	IMAGE_TAG_SOURCE_VM   = "CB-VMSNAPSHOT-SOURCEVM-ID"
)
View Source
const (
	//
	LoadBalancerSet_Status_Creating uint64 = 0
	LoadBalancerSet_Status_Running  uint64 = 1

	Tencent_LoadBalancerType_Open     string = "OPEN" // to Spider "PUBLIC
	Tencent_LoadBalancerType_INTERNAL string = "INTERNAL"
	Spider_LoadBalancerType_PUBLIC    string = "PUBLIC" // to Tencent "OPEN"
	Spider_LoadBalancerType_INTERNAL  string = "INTERNAL"

	// Request Status : Succeeded, Failed, Progress
	Request_Status_Succeeded int64 = 0
	Request_Status_Failed    int64 = 1
	Request_Status_Progress  int64 = 2

	// Request Status : Running, Done
	Request_Status_Running string = "Running"
	Request_Status_Done    string = "Done"

	Protocol_TCP string = "TCP"
	Protocol_UDP string = "UDP"
)
View Source
const CBCloudInitFilePath string = "/cloud-driver-libs/.cloud-init-tencent/cloud-init"

2021-10-27 이슈#480에 의해 Local Key 로직 제거 const CBKeyPairPath string = "/meta_db/.ssh-tencent/"

View Source
const CBDefaultCidrBlock string = "192.168.0.0/16" // CB Default CidrBlock
View Source
const CBDefaultSubnetName string = "CB-VNet-Subnet" // CB Default Subnet Name
View Source
const CBDefaultVNetName string = "CB-VNet" // CB Default Virtual Network Name
View Source
const CBDefaultVmUserName string = "cb-user" // default VM User Name
View Source
const CUSTOM_ERR_CODE_NOTFOUND string = "404" //"XXX 정보가 존재하지 않습니다."
View Source
const CUSTOM_ERR_CODE_TOOMANY string = "600" //"n개 이상의 xxxx 정보가 존재합니다."

Variables

This section is empty.

Functions

func AttachDisk added in v0.6.8

func AttachDisk(client *cbs.Client, diskIID irs.IID, ownerVM irs.IID) (irs.DiskInfo, error)

func ContainString added in v0.6.10

func ContainString(s []string, str string) bool

array에 주어진 string이 있는지 체크

func ConvertJsonString

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

Cloud Object를 JSON String 타입으로 변환

func ConvertJsonStringNoEscape

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

Cloud Object를 JSON String 타입으로 변환

func ConvertKeyValueList

func ConvertKeyValueList(v interface{}) ([]irs.KeyValue, error)

Cloud Object를 CB-KeyValue 형식으로 변환이 필요할 경우 이용

func ConvertToString

func ConvertToString(value interface{}) (string, error)

CB-KeyValue 등을 위해 String 타입으로 변환

func DescribeDisks added in v0.6.8

func DescribeDisks(client *cbs.Client, diskIIDs []irs.IID) ([]*cbs.Disk, error)

func DescribeDisksByDiskID added in v0.6.8

func DescribeDisksByDiskID(client *cbs.Client, diskIID irs.IID) (cbs.Disk, error)

func DescribeImageStatus added in v0.6.16

func DescribeImageStatus(client *cvm.Client, imageIID irs.IID, imageTypes []string) (string, error)

func DescribeImages added in v0.6.9

func DescribeImages(client *cvm.Client, myImageIIDs []irs.IID, imageTypes []string) ([]*cvm.Image, error)

func DescribeImagesByID added in v0.6.9

func DescribeImagesByID(client *cvm.Client, myImageIID irs.IID, imageTypes []string) (cvm.Image, error)

imageTypes : PUBLIC_IMAGE, SHARED_IMAGE, PRIVATE_IMAGE

func DescribeRegions added in v0.7.6

func DescribeRegions(client *cvm.Client) (*cvm.DescribeRegionsResponse, error)

ListOrgRegion

func DescribeSnapshotByID added in v0.7.3

func DescribeSnapshotByID(client *cbs.Client, snapshotIID irs.IID) (cbs.Snapshot, error)

func DescribeSnapshotStatus added in v0.7.3

func DescribeSnapshotStatus(client *cbs.Client, snapshotIID irs.IID) (string, error)

func DescribeZones added in v0.7.6

func DescribeZones(client *cvm.Client) (*cvm.DescribeZonesResponse, error)

ListOrgZone : 클라이언트가 Region 정보를 갖고 있음.

func ExtractImageDescribeInfo

func ExtractImageDescribeInfo(image *cvm.Image) irs.ImageInfo

func ExtractKeyPairDescribeInfo

func ExtractKeyPairDescribeInfo(keyPair *cvm.KeyPair) (irs.KeyPairInfo, error)

2021-10-27 이슈#480에 의해 Local Key 로직 제거 KeyPair 정보를 추출함

func ExtractVMSpecInfo

func ExtractVMSpecInfo(instanceTypeInfo *cvm.InstanceTypeConfig) irs.VMSpecInfo

인스턴스 스펙 정보를 추출함

func ExtractVpcDescribeInfo

func ExtractVpcDescribeInfo(vpcInfo *vpc.Vpc) irs.VPCInfo

VPC 정보를 추출함

func GetCBDefaultCidrBlock

func GetCBDefaultCidrBlock() string

func GetCBDefaultSubnetName

func GetCBDefaultSubnetName() string

Subnet

func GetCBDefaultVNetName

func GetCBDefaultVNetName() string

VPC

func GetCallLogScheme added in v0.7.3

func GetCallLogScheme(region idrv.RegionInfo, resourceType call.RES_TYPE, resourceName string, apiName string) call.CLOUDLOGSCHEMA

func GetOsType added in v0.6.16

func GetOsType(cvmImage cvm.Image) string

Image에서 OS Type 추출 "OsName": "TencentOS Server 3.1 (TK4)", "Platform": "TencentOS",

func GetSnapshotIdsFromImage added in v0.7.3

func GetSnapshotIdsFromImage(myImage cvm.Image) []string

func GetSubnet added in v0.8.12

func GetSubnet(client *vpc.Client, reqVpcId string, reqSubnetId string) (irs.SubnetInfo, error)

subnet 단건 조회

func GetZoneStatus added in v0.7.6

func GetZoneStatus(status string) irs.ZoneStatus

ZoneStatus 일반화

func InitLog added in v0.7.3

func InitLog()

func JSONMarshal

func JSONMarshal(t interface{}) ([]byte, error)

func ListSubnet added in v0.8.12

func ListSubnet(client *vpc.Client, reqVpcId string) ([]irs.SubnetInfo, error)

subnet 목록 조회 by vpc

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 WaitForDelete added in v0.7.3

func WaitForDelete(client *cvm.Client, imageIID irs.IID) (bool, error)

func WaitForDone added in v0.6.8

func WaitForDone(client *cbs.Client, diskIID irs.IID, status string) (string, error)

Types

type RuleAction added in v0.5.5

type RuleAction string
const (
	Add    RuleAction = "Add"
	Remove RuleAction = "Remove"
)

type TencentCBNetworkInfo

type TencentCBNetworkInfo struct {
	VpcName   string
	VpcId     string
	CidrBlock string
	IsDefault bool
	State     string

	SubnetName string
	SubnetId   string
}

type TencentClusterHandler added in v0.6.9

type TencentClusterHandler struct {
	RegionInfo     idrv.RegionInfo
	CredentialInfo idrv.CredentialInfo
}

func (*TencentClusterHandler) AddNodeGroup added in v0.6.9

func (clusterHandler *TencentClusterHandler) AddNodeGroup(clusterIID irs.IID, nodeGroupReqInfo irs.NodeGroupInfo) (irs.NodeGroupInfo, error)

func (*TencentClusterHandler) ChangeNodeGroupScaling added in v0.6.9

func (clusterHandler *TencentClusterHandler) ChangeNodeGroupScaling(clusterIID irs.IID, nodeGroupIID irs.IID, desiredNodeSize int, minNodeSize int, maxNodeSize int) (irs.NodeGroupInfo, error)

func (*TencentClusterHandler) CreateCluster added in v0.6.9

func (clusterHandler *TencentClusterHandler) CreateCluster(clusterReqInfo irs.ClusterInfo) (irs.ClusterInfo, error)

func (*TencentClusterHandler) DeleteCluster added in v0.6.9

func (clusterHandler *TencentClusterHandler) DeleteCluster(clusterIID irs.IID) (bool, error)

func (*TencentClusterHandler) GetCluster added in v0.6.9

func (clusterHandler *TencentClusterHandler) GetCluster(clusterIID irs.IID) (irs.ClusterInfo, error)

func (*TencentClusterHandler) ListCluster added in v0.6.9

func (clusterHandler *TencentClusterHandler) ListCluster() ([]*irs.ClusterInfo, error)

func (*TencentClusterHandler) RemoveNodeGroup added in v0.6.9

func (clusterHandler *TencentClusterHandler) RemoveNodeGroup(clusterIID irs.IID, nodeGroupIID irs.IID) (bool, error)

func (*TencentClusterHandler) SetNodeGroupAutoScaling added in v0.6.9

func (clusterHandler *TencentClusterHandler) SetNodeGroupAutoScaling(clusterIID irs.IID, nodeGroupIID irs.IID, on bool) (bool, error)

func (*TencentClusterHandler) UpgradeCluster added in v0.6.9

func (clusterHandler *TencentClusterHandler) UpgradeCluster(clusterIID irs.IID, newVersion string) (irs.ClusterInfo, error)

type TencentCommonInstancePrice added in v0.8.2

type TencentCommonInstancePrice struct {
	InstanceChargeType *string
	Price              *cvm.ItemPrice
}

type TencentDiskHandler added in v0.6.8

type TencentDiskHandler struct {
	Region idrv.RegionInfo
	Client *cbs.Client
}

func (*TencentDiskHandler) AttachDisk added in v0.6.8

func (DiskHandler *TencentDiskHandler) AttachDisk(diskIID irs.IID, ownerVM irs.IID) (irs.DiskInfo, error)

func (*TencentDiskHandler) ChangeDiskSize added in v0.6.8

func (DiskHandler *TencentDiskHandler) ChangeDiskSize(diskIID irs.IID, size string) (bool, error)

func (*TencentDiskHandler) CreateDisk added in v0.6.8

func (DiskHandler *TencentDiskHandler) CreateDisk(diskReqInfo irs.DiskInfo) (irs.DiskInfo, error)

CreateDisk 이후에 DescribeDisks 호출하여 상태가 UNATTACHED 또는 ATTACHED면 정상적으로 생성된 것임 비동기로 처리되기는 하나 생성 직후 호출해도 정상적으로 상태값을 받아옴 따라서 Operation이 완료되길 기다리는 function(WaitForXXX)은 만들지 않음

func (*TencentDiskHandler) DeleteDisk added in v0.6.8

func (DiskHandler *TencentDiskHandler) DeleteDisk(diskIID irs.IID) (bool, error)

func (*TencentDiskHandler) DetachDisk added in v0.6.8

func (DiskHandler *TencentDiskHandler) DetachDisk(diskIID irs.IID, ownerVM irs.IID) (bool, error)

func (*TencentDiskHandler) GetDisk added in v0.6.8

func (DiskHandler *TencentDiskHandler) GetDisk(diskIID irs.IID) (irs.DiskInfo, error)

func (*TencentDiskHandler) ListDisk added in v0.6.8

func (DiskHandler *TencentDiskHandler) ListDisk() ([]*irs.DiskInfo, error)

type TencentImageHandler

type TencentImageHandler struct {
	Region idrv.RegionInfo
	Client *cvm.Client
}

func (*TencentImageHandler) CheckWindowsImage added in v0.6.15

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

windows 여부 return imate-type : PUBLIC_IMAGE, SHARED_IMAGE, PRIVATE_IMAGE

func (*TencentImageHandler) CreateImage

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

@TODO - 이미지 생성에 따른 구조체 정의 필요 - 현재는 IID뿐이 없어서 이미지 이름으로만 생성하도록 했음.(인스턴스Id가 없어서 에러 발생함.)

func (*TencentImageHandler) DeleteImage

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

func (*TencentImageHandler) GetImage

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

func (*TencentImageHandler) ListImage

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

type TencentInstanceInformation added in v0.8.2

type TencentInstanceInformation struct {
	PriceList      *irs.Price
	StandardPrices *[]TencentCommonInstancePrice
	ReservedPrices *[]TencentReservedInstancePrice
}

type TencentInstanceModel added in v0.8.2

type TencentInstanceModel struct {
	// contains filtered or unexported fields
}

type TencentKeyPairHandler

type TencentKeyPairHandler struct {
	Region idrv.RegionInfo
	Client *cvm.Client
}

func (*TencentKeyPairHandler) CreateKey

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

2021-10-27 이슈#480에 의해 Local Key 로직 제거 KeyPair 생성시 이름은 알파벳, 숫자 또는 밑줄 "_"만 지원

func (*TencentKeyPairHandler) DeleteKey

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

2021-10-27 이슈#480에 의해 Local Key 로직 제거

func (*TencentKeyPairHandler) GetKey

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

2021-10-27 이슈#480에 의해 Local Key 로직 제거

func (*TencentKeyPairHandler) ListKey

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

type TencentMyImageHandler added in v0.6.9

type TencentMyImageHandler struct {
	Region    idrv.RegionInfo
	Client    *cvm.Client
	CbsClient *cbs.Client
}

func (*TencentMyImageHandler) CheckWindowsImage added in v0.6.15

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

https://console.tencentcloud.com/api/explorer?Product=cvm&Version=2017-03-12&Action=DescribeImages Window OS 여부 imageType : MyImage는 PRIVATE, PRIVATE_IMAGE, PUBLIC_IMAGE, SHARED_IMAGE

func (*TencentMyImageHandler) DeleteMyImage added in v0.6.9

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

* If the ImageState of an image is CREATING or USING, the image cannot be deleted. Call the DescribeImages API to query the image status. Up to 10 custom images are allowed in each region. If you have run out of the quota, delete unused images to create new ones. A shared image cannot be deleted.

func (*TencentMyImageHandler) DeleteSnapshotById added in v0.7.3

func (myImageHandler *TencentMyImageHandler) DeleteSnapshotById(snapshotIds []string) (bool, error)

Image에 대한 snap 삭제

func (*TencentMyImageHandler) GetMyImage added in v0.6.9

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

func (*TencentMyImageHandler) ListMyImage added in v0.6.9

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

* TODO : CommonHandlerm에 DescribeImages, DescribeImageById, DescribeImageStatus 추가할 것.

func (*TencentMyImageHandler) SnapshotVM added in v0.6.9

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

type TencentNLBHandler added in v0.5.10

type TencentNLBHandler struct {
	Region    idrv.RegionInfo
	Client    *clb.Client
	VpcClient *tencentvpc.Client
}

func (*TencentNLBHandler) AddVMs added in v0.5.10

func (NLBHandler *TencentNLBHandler) AddVMs(nlbIID irs.IID, vmIIDs *[]irs.IID) (irs.VMGroupInfo, error)

func (*TencentNLBHandler) ChangeHealthCheckerInfo added in v0.5.10

func (NLBHandler *TencentNLBHandler) ChangeHealthCheckerInfo(nlbIID irs.IID, healthChecker irs.HealthCheckerInfo) (irs.HealthCheckerInfo, error)

func (*TencentNLBHandler) ChangeListener added in v0.5.10

func (NLBHandler *TencentNLBHandler) ChangeListener(nlbIID irs.IID, listener irs.ListenerInfo) (irs.ListenerInfo, error)

func (*TencentNLBHandler) ChangeVMGroupInfo added in v0.5.10

func (NLBHandler *TencentNLBHandler) ChangeVMGroupInfo(nlbIID irs.IID, vmGroup irs.VMGroupInfo) (irs.VMGroupInfo, error)

func (*TencentNLBHandler) CreateNLB added in v0.5.10

func (NLBHandler *TencentNLBHandler) CreateNLB(nlbReqInfo irs.NLBInfo) (irs.NLBInfo, error)

NLB 생성 vpc required

func (*TencentNLBHandler) DeleteNLB added in v0.5.10

func (NLBHandler *TencentNLBHandler) DeleteNLB(nlbIID irs.IID) (bool, error)

func (*TencentNLBHandler) ExtractHealthCheckerInfo added in v0.5.10

func (NLBHandler *TencentNLBHandler) ExtractHealthCheckerInfo(nlbIID irs.IID) (irs.HealthCheckerInfo, error)

Health Checker 정보 조회

func (*TencentNLBHandler) ExtractListenerInfo added in v0.5.10

func (NLBHandler *TencentNLBHandler) ExtractListenerInfo(nlbIID irs.IID) (irs.ListenerInfo, error)

NLB Name으로 Listener를 조회하여 NLBInfo.Listener 값으로 변환 NLB 를 조회하여 Listener에 사용할 IP인 VIP 추출

func (*TencentNLBHandler) ExtractNLBDescribeInfo added in v0.5.11

func (NLBHandler *TencentNLBHandler) ExtractNLBDescribeInfo(nlbInfo *clb.LoadBalancer) (irs.NLBInfo, error)

조회한 결과에서 Spider의 NLBInfo 값으로 변환

func (*TencentNLBHandler) ExtractVMGroupInfo added in v0.5.10

func (NLBHandler *TencentNLBHandler) ExtractVMGroupInfo(nlbIID irs.IID) (irs.VMGroupInfo, error)

VM Group 정보 조회

func (*TencentNLBHandler) GetNLB added in v0.5.10

func (NLBHandler *TencentNLBHandler) GetNLB(nlbIID irs.IID) (irs.NLBInfo, error)

NLB 조회

func (*TencentNLBHandler) GetVMGroupHealthInfo added in v0.5.10

func (NLBHandler *TencentNLBHandler) GetVMGroupHealthInfo(nlbIID irs.IID) (irs.HealthInfo, error)

func (*TencentNLBHandler) ListNLB added in v0.5.10

func (NLBHandler *TencentNLBHandler) ListNLB() ([]*irs.NLBInfo, error)

NLB 모든 목록 조회 : TCP/UDP

func (*TencentNLBHandler) RemoveVMs added in v0.5.10

func (NLBHandler *TencentNLBHandler) RemoveVMs(nlbIID irs.IID, vmIIDs *[]irs.IID) (bool, error)

func (*TencentNLBHandler) WaitForDone added in v0.5.10

func (NLBHandler *TencentNLBHandler) WaitForDone(requestId string) (string, error)

Current status of a task (succeeded==Done, failed, in progress)

func (*TencentNLBHandler) WaitForRun added in v0.5.10

func (NLBHandler *TencentNLBHandler) WaitForRun(nlbIID irs.IID) (string, error)

CLB instance status (creating, running)

type TencentPriceInfoHandler added in v0.8.2

type TencentPriceInfoHandler struct {
	Region idrv.RegionInfo
	Client *cvm.Client
}

func (*TencentPriceInfoHandler) GetPriceInfo added in v0.8.2

func (t *TencentPriceInfoHandler) GetPriceInfo(productFamily string, regionName string, additionalFilters []irs.KeyValue) (string, error)

func (*TencentPriceInfoHandler) ListProductFamily added in v0.8.2

func (t *TencentPriceInfoHandler) ListProductFamily(regionName string) ([]string, error)

ListProductFamily tencent 에서 제공해주는 product family 관련한 api 가 존재하지 않아 코드 레벨에서 관리하도록 1차 논의 완료 2023.12.14.driver 내부에서 array 등으로 관리하는 방침으로 변경

type TencentRegionZoneHandler added in v0.7.6

type TencentRegionZoneHandler struct {
	Region idrv.RegionInfo
	Client *cvm.Client
}

func (*TencentRegionZoneHandler) GetRegionZone added in v0.7.6

func (regionZoneHandler *TencentRegionZoneHandler) GetRegionZone(Name string) (irs.RegionZoneInfo, error)

func (*TencentRegionZoneHandler) ListOrgRegion added in v0.7.6

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

func (*TencentRegionZoneHandler) ListOrgZone added in v0.7.6

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

func (*TencentRegionZoneHandler) ListRegionZone added in v0.7.6

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

type TencentReservedInstancePrice added in v0.8.2

type TencentReservedInstancePrice struct {
	Price *cvm.ReservedInstancePriceItem
}

type TencentSecurityHandler

type TencentSecurityHandler struct {
	Region idrv.RegionInfo
	Client *vpc.Client
}

func (*TencentSecurityHandler) AddRules added in v0.5.4

func (securityHandler *TencentSecurityHandler) AddRules(securityIID irs.IID, reqSecurityRules *[]irs.SecurityRuleInfo) (irs.SecurityInfo, error)

SecurityGroupRule추가 추가 후 SecurityGroup return CreateSecurityGroupPolicies inbound, outbound 동시 호출 불가 > 각각 호출 ModifySecurityGroupPolicies Version을 0으로 set하면 초기화(모든 룰 사라짐), 설정하지 않으면 모두 삭제 후 insert(기존 값 사라짐, 넘어온 값만 사용)

func (*TencentSecurityHandler) CreateSecurity

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

https://intl.cloud.tencent.com/document/product/213/34272 https://intl.cloud.tencent.com/ko/document/api/215/36083

@TODO 포트 다양하게 처리 가능해야 함. - 현재는 콤머는 에러 처리

사용가능 포트 규칙 : 콤머(,) / 대쉬(-) / ALL(전체)

Port: A single port number, or a port range in the format of “8000-8010”. The Port field is accepted only if the value of the Protocol field is TCP or UDP. Otherwise Protocol and Port are mutually exclusive. Action : ACCEPT or DROP

Tencent의 경우 : If no rules are set, all traffic is rejected by default CB Spider의 outbound default는 All Open이므로 기본 Egress는 모두 open : CreateSecurityGroupWithPolicies 사용자의 policy를 추가로 적용 : CreateSecurityGroupPolicies 1번의 request는 한반향만 가능(두가지 동시에 불가)

func (*TencentSecurityHandler) DeleteSecurity

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

func (*TencentSecurityHandler) ExtractPolicyGroups

func (securityHandler *TencentSecurityHandler) ExtractPolicyGroups(policyGroups []*vpc.SecurityGroupPolicy, direction string) ([]irs.SecurityRuleInfo, error)

@TODO Port에 콤머가 사용된 정책 처리해야 함. direction : inbound / outbound

func (*TencentSecurityHandler) GetSecurity

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

func (*TencentSecurityHandler) GetSecurityRuleInfo

func (securityHandler *TencentSecurityHandler) GetSecurityRuleInfo(securityIID irs.IID) (*[]irs.SecurityRuleInfo, error)

func (*TencentSecurityHandler) ListSecurity

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

func (*TencentSecurityHandler) RemoveRules added in v0.5.4

func (securityHandler *TencentSecurityHandler) RemoveRules(securityIID irs.IID, reqSecurityRules *[]irs.SecurityRuleInfo) (bool, error)

DeleteSecurityGroupPolicies inbound, outbound 동시 호출 불가 > 각각 호출

type TencentVMHandler

type TencentVMHandler struct {
	Region     idrv.RegionInfo
	Client     *cvm.Client
	DiskClient *tencentcbs.Client
	VPCClient  *tencentvpc.Client
}

func (*TencentVMHandler) ExtractDescribeInstances

func (vmHandler *TencentVMHandler) ExtractDescribeInstances(curVm *cvm.Instance) (irs.VMInfo, error)

func (*TencentVMHandler) GetVM

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

func (*TencentVMHandler) GetVMStatus

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

func (*TencentVMHandler) ListVM

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

func (*TencentVMHandler) ListVMStatus

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

func (*TencentVMHandler) RebootVM

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

func (*TencentVMHandler) ResumeVM

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

func (*TencentVMHandler) StartVM

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

VM생성 시 Zone이 필수라서 Credential의 Zone에만 생성함.

func (*TencentVMHandler) SuspendVM

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

func (*TencentVMHandler) TerminateVM

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

func (*TencentVMHandler) WaitForRun

func (vmHandler *TencentVMHandler) WaitForRun(vmIID irs.IID) (irs.VMStatus, error)

VM 정보를 조회할 수 있을 때까지 최대 30초간 대기

type TencentVPCHandler

type TencentVPCHandler struct {
	Region idrv.RegionInfo
	Client *vpc.Client
}

func (*TencentVPCHandler) AddSubnet

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

func (*TencentVPCHandler) CreateVPC

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

func (*TencentVPCHandler) DeleteVPC

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

func (*TencentVPCHandler) GetVPC

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

func (*TencentVPCHandler) ListSubnet

func (VPCHandler *TencentVPCHandler) ListSubnet(reqVpcId string) ([]irs.SubnetInfo, error)

func (*TencentVPCHandler) ListVPC

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

func (*TencentVPCHandler) RemoveSubnet

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

type TencentVmSpecHandler

type TencentVmSpecHandler struct {
	Region idrv.RegionInfo
	Client *cvm.Client
}

func (*TencentVmSpecHandler) GetOrgVMSpec

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

func (*TencentVmSpecHandler) GetVMSpec

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

func (*TencentVmSpecHandler) ListOrgVMSpec

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

func (*TencentVmSpecHandler) ListVMSpec

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

@TODO : Region : zone id(Region이 아닌 zone id로 조회해야 함.)

Jump to

Keyboard shortcuts

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