client

package
v1.31.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: Apache-2.0, MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultInternetChargeType = "PayByTraffic"

DefaultInternetChargeType is used for EIP

Variables

This section is empty.

Functions

func CompositeDomainName added in v1.31.0

func CompositeDomainName(domainName, domainId string) string

CompositeDomainName composes and returns a composite domain name from the given domain name and id, in the format <domainName>:<domainId>

func ComputeStorageEndpoint

func ComputeStorageEndpoint(region string) string

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

func DomainNameAndId added in v1.31.0

func DomainNameAndId(compositeDomainName string) (string, string)

DomainNameAndId decomposes the given composite domain name in the format <domainName>:<domainId> into its constituent domain name and id.

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)
	NewROSClient(region, accessKeyID, accessKeySecret string) (ROS, error)
	NewOSSClient(endpoint, accessKeyID, accessKeySecret string) (OSS, error)
	NewOSSClientFromSecretRef(ctx context.Context, client client.Client, secretRef *corev1.SecretReference, region string) (OSS, error)
	NewDNSClient(region, accessKeyID, accessKeySecret string) (DNS, 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 DNS added in v1.26.0

type DNS interface {
	GetDomainNames(context.Context) (map[string]string, error)
	GetDomainName(context.Context, string) (string, error)
	CreateOrUpdateDomainRecords(context.Context, string, string, string, []string, int64) error
	DeleteDomainRecords(context.Context, string, string, string) error
}

DNS is an interface which declares DNS related methods.

type ECS

type ECS interface {
	CheckIfImageExists(ctx context.Context, imageID string) (bool, error)
	CheckIfImageOwnedByAliCloud(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)
	DetachECSInstancesFromSSHKeyPair(keyName string) 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 ROS added in v1.25.0

type ROS interface {
	ListStacks(request *ros.ListStacksRequest) (response *ros.ListStacksResponse, err error)
	GetStack(request *ros.GetStackRequest) (response *ros.GetStackResponse, err error)
	CreateStack(request *ros.CreateStackRequest) (response *ros.CreateStackResponse, err error)
	DeleteStack(request *ros.DeleteStackRequest) (response *ros.DeleteStackResponse, err error)
}

ROS is an interface which declares ROS 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.

Directories

Path Synopsis
Package client is a generated GoMock package.
Package client is a generated GoMock package.

Jump to

Keyboard shortcuts

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