aliclient

package
v1.52.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor interface {
	ListEnhanhcedNatGatewayAvailableZones(ctx context.Context, region string) ([]string, error)

	CreateVpc(ctx context.Context, vpc *VPC) (*VPC, error)
	GetVpc(ctx context.Context, id string) (*VPC, error)
	ListVpcs(ctx context.Context, ids []string) ([]*VPC, error)
	FindVpcsByTags(ctx context.Context, tags Tags) ([]*VPC, error)
	DeleteVpc(ctx context.Context, id string) error

	CreateVSwitch(ctx context.Context, vsw *VSwitch) (*VSwitch, error)
	GetVSwitch(ctx context.Context, id string) (*VSwitch, error)
	ListVSwitches(ctx context.Context, ids []string) ([]*VSwitch, error)
	FindVSwitchesByTags(ctx context.Context, tags Tags) ([]*VSwitch, error)
	DeleteVSwitch(ctx context.Context, id string) error

	CreateNatGateway(ctx context.Context, ngw *NatGateway) (*NatGateway, error)
	GetNatGateway(ctx context.Context, id string) (*NatGateway, error)
	ListNatGateways(ctx context.Context, ids []string) ([]*NatGateway, error)
	FindNatGatewayByTags(ctx context.Context, tags Tags) ([]*NatGateway, error)
	FindNatGatewayByVPC(ctx context.Context, vpcId string) (*NatGateway, error)
	DeleteNatGateway(ctx context.Context, id string) error

	CreateEIP(ctx context.Context, eip *EIP) (*EIP, error)
	GetEIP(ctx context.Context, id string) (*EIP, error)
	GetEIPByAddress(ctx context.Context, ipAddress string) (*EIP, error)
	ListEIPs(ctx context.Context, ids []string) ([]*EIP, error)
	FindEIPsByTags(ctx context.Context, tags Tags) ([]*EIP, error)
	DeleteEIP(ctx context.Context, id string) error
	ModifyEIP(ctx context.Context, id string, eip *EIP) error
	AssociateEIP(ctx context.Context, id, to, insType string) error
	UnAssociateEIP(ctx context.Context, eip *EIP) error

	CreateSNatEntry(ctx context.Context, entry *SNATEntry) (*SNATEntry, error)
	GetSNatEntry(ctx context.Context, id, snatTableId string) (*SNATEntry, error)
	FindSNatEntriesByNatGateway(ctx context.Context, ngwId string) ([]*SNATEntry, error)
	DeleteSNatEntry(ctx context.Context, id, snatTableId string) error

	CreateTags(ctx context.Context, resources []string, tags Tags, resourceType string) error
	DeleteTags(ctx context.Context, resources []string, tags Tags, resourceType string) error

	CreateSecurityGroup(ctx context.Context, sg *SecurityGroup) (*SecurityGroup, error)
	GetSecurityGroup(ctx context.Context, id string) (*SecurityGroup, error)
	ListSecurityGroups(ctx context.Context, ids []string) ([]*SecurityGroup, error)
	FindSecurityGroupsByTags(ctx context.Context, tags Tags) ([]*SecurityGroup, error)
	DeleteSecurityGroup(ctx context.Context, id string) error

	AuthorizeSecurityGroupRule(ctx context.Context, sgId string, rule SecurityGroupRule) error
	RevokeSecurityGroupRule(ctx context.Context, sgId, ruleId, direction string) error
}

Actor ia a interface to package alicloud api call

func NewActor

func NewActor(accessKeyID, secretAccessKey, region string) (Actor, error)

NewActor is to create a Actor object

type EIP

type EIP struct {
	Tags
	Name               string
	Bandwidth          string
	InternetChargeType string
	ZoneId             string
	Status             *string
	EipId              string
	InstanceType       *string
	InstanceId         *string
	IpAddress          string
}

EIP is the struct for a eip object

type Factory added in v1.51.0

type Factory interface {
	// NewClient creates a new instance of Actor for the given alicloud credentials and region.
	NewActor(accessKeyID, secretAccessKey, region string) (Actor, error)
}

Factory creates instances of Interface.

type FactoryFunc added in v1.51.0

type FactoryFunc func(accessKeyID, secretAccessKey, region string) (Actor, error)

FactoryFunc is a function that implements Factory.

func (FactoryFunc) NewActor added in v1.51.0

func (f FactoryFunc) NewActor(accessKeyID, secretAccessKey, region string) (Actor, error)

NewActor creates a new instance of Actor for the given Alicloud credentials and region.

type NatGateway

type NatGateway struct {
	Tags
	Name               string
	NatGatewayId       string
	VpcId              *string
	VswitchId          *string
	Status             *string
	AvailableVSwitches []string
	SNATTableIDs       []string
}

NatGateway is the struct for a nat gateway object

type SNATEntry

type SNATEntry struct {
	Name         string
	NatGatewayId string
	VSwitchId    string
	IpAddress    string
	SnatTableId  string
	SnatEntryId  string
	Status       *string
}

SNATEntry is the struct for a snat entry object

type SecurityGroup

type SecurityGroup struct {
	Tags
	Name            string
	VpcId           string
	Description     string
	SecurityGroupId string
	Status          *string
	Rules           []*SecurityGroupRule
}

SecurityGroup is the struct for a SecurityGroup object

type SecurityGroupRule

type SecurityGroupRule struct {
	SecurityGroupRuleId string
	Policy              string
	Priority            string
	IpProtocol          string
	PortRange           string
	DestCidrIp          string
	SourceCidrIp        string
	Direction           string
}

SecurityGroupRule is the struct for a SecurityGroupRule object

type Tags

type Tags map[string]string

Tags is map of string key to string values. Duplicate keys are not supported in AWS.

func (Tags) Clone

func (tags Tags) Clone() Tags

Clone creates a copy of the tags aps

type Updater

type Updater interface {
	UpdateVpc(ctx context.Context, desired, current *VPC) (modified bool, err error)
	UpdateVSwitch(ctx context.Context, desired, current *VSwitch) (modified bool, err error)
	UpdateNatgateway(ctx context.Context, desired, current *NatGateway) (modified bool, err error)
	UpdateEIP(ctx context.Context, desired, current *EIP) (modified bool, err error)
	UpdateSNATEntry(ctx context.Context, desired, current *SNATEntry) (modified bool, err error)
	UpdateSecurityGroup(ctx context.Context, desired, current *SecurityGroup) (modified bool, err error)
}

Updater is used for reconcile based with flow

func NewUpdater

func NewUpdater(actor Actor) Updater

NewUpdater creates a new updater instance.

type VPC

type VPC struct {
	Tags
	Name      string
	VpcId     string
	CidrBlock string
	Status    *string
}

VPC is the struct for a vpc object

type VSwitch

type VSwitch struct {
	Tags
	Name      string
	VSwitchId string
	VpcId     *string
	CidrBlock string
	ZoneId    string
	Status    *string
}

VSwitch is the struct for a vswitch object

Directories

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

Jump to

Keyboard shortcuts

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