client

package
v1.24.3 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: Apache-2.0, MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultInternetChargeType = "PayByTraffic"

DefaultInternetChargeType is used for EIP

Variables

This section is empty.

Functions

func ComputeStorageEndpoint

func ComputeStorageEndpoint(region string) string

ComputeStorageEndpoint computes the OSS storage endpoint based on the given region.

Types

type ClientFactory

type ClientFactory interface {
	NewECSClient(region, accessKeyID, accessKeySecret string) (ECS, error)
	NewSTSClient(region, accessKeyID, accessKeySecret string) (STS, error)
	NewSLBClient(region, accessKeyID, accessKeySecret string) (SLB, error)
	NewVPCClient(region, accessKeyID, accessKeySecret string) (VPC, error)
	NewRAMClient(region, accessKeyID, accessKeySecret string) (RAM, error)
	NewOSSClient(endpoint, accessKeyID, accessKeySecret string) (OSS, error)
	NewOSSClientFromSecretRef(ctx context.Context, client client.Client, secretRef *corev1.SecretReference, region string) (OSS, error)
}

ClientFactory is the new factory to instantiate Alicloud clients.

func NewClientFactory

func NewClientFactory() ClientFactory

NewClientFactory creates a new clientFactory instance that can be used to instantiate Alicloud clients.

type ECS

type ECS interface {
	CheckIfImageExists(ctx context.Context, imageID string) (bool, error)
	ShareImageToAccount(ctx context.Context, regionID, imageID, accountID string) error
	DescribeSecurityGroups(request *ecs.DescribeSecurityGroupsRequest) (response *ecs.DescribeSecurityGroupsResponse, err error)
	DescribeSecurityGroupAttribute(request *ecs.DescribeSecurityGroupAttributeRequest) (response *ecs.DescribeSecurityGroupAttributeResponse, err error)
	DescribeKeyPairs(request *ecs.DescribeKeyPairsRequest) (response *ecs.DescribeKeyPairsResponse, err error)
}

ECS is an interface which declares ECS related methods.

type OSS added in v1.24.0

type OSS interface {
	DeleteObjectsWithPrefix(ctx context.Context, bucketName, prefix string) error
	CreateBucketIfNotExists(ctx context.Context, bucketName string) error
	DeleteBucketIfExists(ctx context.Context, bucketName string) error
}

OSS is an interface which declares OSS related methods.

type RAM added in v1.21.0

type RAM interface {
	CreateServiceLinkedRole(regionID, serviceName string) error
	GetServiceLinkedRole(roleName string) (*ram.Role, error)
}

RAM is an interface which declares RAM related methods.

type SLB

type SLB interface {
	GetLoadBalancerIDs(ctx context.Context, region string) ([]string, error)
	GetFirstVServerGroupName(ctx context.Context, region, loadBalancerID string) (string, error)
	DeleteLoadBalancer(ctx context.Context, region, loadBalancerID string) error
	SetLoadBalancerDeleteProtection(ctx context.Context, region, loadBalancerID string, protection bool) error
}

SLB is an interface which declares SLB related methods.

type STS

type STS interface {
	GetAccountIDFromCallerIdentity(ctx context.Context) (string, error)
}

STS is an interface which declares STS related methods.

type VPC

type VPC interface {
	GetVPCWithID(ctx context.Context, vpcID string) ([]vpc.Vpc, error)
	GetNatGatewaysWithVPCID(ctx context.Context, vpcID string) ([]vpc.NatGateway, error)
	GetEIPWithID(ctx context.Context, eipID string) ([]vpc.EipAddress, error)
	GetVPCInfo(ctx context.Context, vpcID string) (*VPCInfo, error)
	FetchEIPInternetChargeType(ctx context.Context, natGateway *vpc.NatGateway, vpcID string) (string, error)

	CreateVpc(request *vpc.CreateVpcRequest) (response *vpc.CreateVpcResponse, err error)
	DescribeVpcs(request *vpc.DescribeVpcsRequest) (response *vpc.DescribeVpcsResponse, err error)
	DeleteVpc(request *vpc.DeleteVpcRequest) (response *vpc.DeleteVpcResponse, err error)
	CreateVSwitch(request *vpc.CreateVSwitchRequest) (response *vpc.CreateVSwitchResponse, err error)
	DescribeVSwitches(request *vpc.DescribeVSwitchesRequest) (response *vpc.DescribeVSwitchesResponse, err error)
	DeleteVSwitch(request *vpc.DeleteVSwitchRequest) (response *vpc.DeleteVSwitchResponse, err error)
	CreateNatGateway(request *vpc.CreateNatGatewayRequest) (response *vpc.CreateNatGatewayResponse, err error)
	DescribeNatGateways(request *vpc.DescribeNatGatewaysRequest) (response *vpc.DescribeNatGatewaysResponse, err error)
	DeleteNatGateway(request *vpc.DeleteNatGatewayRequest) (response *vpc.DeleteNatGatewayResponse, err error)
	DescribeSnatTableEntries(request *vpc.DescribeSnatTableEntriesRequest) (response *vpc.DescribeSnatTableEntriesResponse, err error)
	DescribeEipAddresses(request *vpc.DescribeEipAddressesRequest) (response *vpc.DescribeEipAddressesResponse, err error)
}

VPC is an interface which declares VPC related methods.

type VPCInfo added in v1.24.0

type VPCInfo struct {
	CIDR               string
	NATGatewayID       string
	SNATTableIDs       string
	InternetChargeType string
}

VPCInfo contains info about an existing VPC.

Jump to

Keyboard shortcuts

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