client

package
v1.49.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: Apache-2.0, MIT Imports: 25 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.

func IsThrottlingError added in v1.32.0

func IsThrottlingError(err error) bool

IsThrottlingError returns true if the error is a throttling error.

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.

func NewClientFactoryWithRateLimit added in v1.32.0

func NewClientFactoryWithRateLimit(limit rate.Limit, burst int, waitTimeout time.Duration) ClientFactory

NewClientFactoryWithRateLimit creates a new clientFactory instance that can be used to instantiate Alicloud dns 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(imageID string) (bool, error)
	CheckIfImageOwnedByAliCloud(imageID string) (bool, error)
	ShareImageToAccount(ctx context.Context, regionID, imageID, accountID string) error
	GetSecurityGroup(name string) (*ecs.DescribeSecurityGroupsResponse, error)
	GetSecurityGroupWithID(id string) (*ecs.DescribeSecurityGroupsResponse, error)
	DescribeSecurityGroups(request *ecs.DescribeSecurityGroupsRequest) (*ecs.DescribeSecurityGroupsResponse, error)
	DescribeSecurityGroupAttribute(request *ecs.DescribeSecurityGroupAttributeRequest) (*ecs.DescribeSecurityGroupAttributeResponse, error)
	DescribeKeyPairs(request *ecs.DescribeKeyPairsRequest) (*ecs.DescribeKeyPairsResponse, error)
	DetachECSInstancesFromSSHKeyPair(keyName string) error
	GetInstances(name string) (*ecs.DescribeInstancesResponse, error)
	GetInstanceType(core int, zoneID string) (*ecs.DescribeAvailableResourceResponse, error)
	CreateInstances(instanceName, securityGroupID, imageID, vSwitchId, zoneID, instanceTypeID, userData string) (*ecs.RunInstancesResponse, error)
	DeleteInstances(id string, force bool) error
	CreateSecurityGroups(vpcId, name string) (*ecs.CreateSecurityGroupResponse, error)
	DeleteSecurityGroups(id string) error
	AllocatePublicIp(id string) (*ecs.AllocatePublicIpAddressResponse, error)
	CreateIngressRule(request *ecs.AuthorizeSecurityGroupRequest) error
	CreateEgressRule(request *ecs.AuthorizeSecurityGroupEgressRequest) error
	RevokeIngressRule(request *ecs.RevokeSecurityGroupRequest) error
	RevokeEgressRule(request *ecs.RevokeSecurityGroupEgressRequest) 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 RateLimiterWaitError added in v1.32.0

type RateLimiterWaitError struct {
	Cause error
}

RateLimiterWaitError is an error to be reported if waiting for a aliyun dns rate limiter fails. This can only happen if the wait time would exceed the configured wait timeout.

func (*RateLimiterWaitError) Error added in v1.32.0

func (e *RateLimiterWaitError) Error() string

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)
	GetEnhanhcedNatGatewayAvailableZones(ctx context.Context, region string) ([]string, error)
	GetVPCInfo(ctx context.Context, vpcID string) (*VPCInfo, error)
	GetVPCInfoByName(name 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)
	GetVSwitchesInfoByID(name string) (*VSwitchInfo, 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
	VSwitchID          string
	VPCID              string
}

VPCInfo contains info about an existing VPC.

type VSwitchInfo added in v1.35.0

type VSwitchInfo struct {
	ZoneID string
}

VSwitchInfo contains info about an existing VSwitchInfo.

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