aliyun

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAliyunImpl added in v1.1.0

func NewAliyunImpl(openAPI *client.OpenAPI, needENITypeAttr bool, ipFamily *types.IPFamily, tagFilter map[string]string) ipam.API

NewAliyunImpl return new API implement object

Types

type ENIInfoGetter

type ENIInfoGetter interface {
	GetENIByMac(mac string) (*types.ENI, error)
	GetENIPrivateAddressesByMAC(mac string) ([]net.IP, error)
	GetENIPrivateIPv6AddressesByMAC(mac string) ([]net.IP, error)
	GetENIs(containsMainENI bool) ([]*types.ENI, error)
	GetSecondaryENIMACs() ([]string, error)
}

ENIInfoGetter interface to get eni information

type ENIMetadata

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

func NewENIMetadata added in v1.1.0

func NewENIMetadata(ipFamily *types.IPFamily) *ENIMetadata

func (*ENIMetadata) GetENIByMac added in v1.1.0

func (e *ENIMetadata) GetENIByMac(mac string) (*types.ENI, error)

func (*ENIMetadata) GetENIPrivateAddressesByMAC added in v1.1.0

func (e *ENIMetadata) GetENIPrivateAddressesByMAC(mac string) ([]net.IP, error)

func (*ENIMetadata) GetENIPrivateIPv6AddressesByMAC added in v1.1.0

func (e *ENIMetadata) GetENIPrivateIPv6AddressesByMAC(mac string) ([]net.IP, error)

func (*ENIMetadata) GetENIs added in v1.1.0

func (e *ENIMetadata) GetENIs(containsMainENI bool) ([]*types.ENI, error)

func (*ENIMetadata) GetSecondaryENIMACs added in v1.1.0

func (e *ENIMetadata) GetSecondaryENIMACs() ([]string, error)

GetSecondaryENIMACs return secondary ENI macs

type Impl added in v1.1.0

type Impl struct {
	*client.OpenAPI
	// contains filtered or unexported fields
}

func (*Impl) AllocateENI added in v1.1.0

func (e *Impl) AllocateENI(ctx context.Context, vSwitch string, securityGroups []string, instanceID string, trunk bool, ipCount int, eniTags map[string]string) (*types.ENI, error)

AllocateENI for instance

func (*Impl) AllocateEipAddress added in v1.1.0

func (e *Impl) AllocateEipAddress(ctx context.Context, bandwidth int, chargeType types.InternetChargeType, eipID, eniID string, eniIP net.IP, allowRob bool, isp, bandwidthPackageID, eipPoolID string) (*types.EIP, error)

func (*Impl) AssignNIPsForENI added in v1.1.0

func (e *Impl) AssignNIPsForENI(ctx context.Context, eniID, mac string, count int) ([]net.IP, []net.IP, error)

func (*Impl) CheckEniSecurityGroup added in v1.1.0

func (e *Impl) CheckEniSecurityGroup(ctx context.Context, sg []string) error

CheckEniSecurityGroup will sync eni's security with ecs's security group

func (*Impl) FreeENI added in v1.1.0

func (e *Impl) FreeENI(ctx context.Context, eniID, instanceID string) error

func (*Impl) GetAttachedENIs added in v1.1.0

func (e *Impl) GetAttachedENIs(ctx context.Context, containsMainENI bool, trunkENIID string) ([]*types.ENI, error)

GetAttachedENIs of instanceId containsMainENI is contains the main interface(eth0) of instance

func (*Impl) GetAttachedSecurityGroups added in v1.1.0

func (e *Impl) GetAttachedSecurityGroups(ctx context.Context, instanceID string) ([]string, error)

func (*Impl) GetENIByMac added in v1.1.0

func (e *Impl) GetENIByMac(ctx context.Context, mac string) (*types.ENI, error)

func (*Impl) GetENIIPs added in v1.1.0

func (e *Impl) GetENIIPs(ctx context.Context, mac string) ([]net.IP, []net.IP, error)

func (*Impl) GetInstanceAttributesType added in v1.1.0

func (e *Impl) GetInstanceAttributesType(ctx context.Context, instanceID string) (*ecs.Instance, error)

func (*Impl) GetSecondaryENIMACs added in v1.1.0

func (e *Impl) GetSecondaryENIMACs(ctx context.Context) ([]string, error)

func (*Impl) QueryEniIDByIP added in v1.1.0

func (e *Impl) QueryEniIDByIP(ctx context.Context, vpcID string, address net.IP) (string, error)

func (*Impl) ReleaseEipAddress added in v1.1.0

func (e *Impl) ReleaseEipAddress(ctx context.Context, eipID, eniID string, eniIP net.IP) error

func (*Impl) UnAssignIPsForENI added in v1.1.0

func (e *Impl) UnAssignIPsForENI(ctx context.Context, eniID, mac string, ipv4s []net.IP, ipv6s []net.IP) error

func (*Impl) UnassociateEipAddress added in v1.1.0

func (e *Impl) UnassociateEipAddress(ctx context.Context, eipID, eniID, eniIP string) error

UnassociateEipAddress un associate eip 1. if eni is deleted eip auto unassociated 2. if eip is deleted , return code is InvalidAllocationId.NotFound 3. if eip is not bind ,return code is IncorrectEipStatus

func (*Impl) WaitForEIP added in v1.1.0

func (e *Impl) WaitForEIP(eipID string, status string, backoff wait.Backoff) (*vpc.EipAddress, error)

WaitForEIP wait status of eni, ignore status if is empty

type Instance added in v1.1.0

type Instance struct {
	RegionID   string
	ZoneID     string
	VPCID      string
	VSwitchID  string
	PrimaryMAC string

	InstanceID   string
	InstanceType string
}

func GetInstanceMeta added in v1.1.0

func GetInstanceMeta() *Instance

type Limits added in v1.1.0

type Limits struct {
	// Adapters specifies the maximum number of interfaces that can be
	// attached to the instance
	Adapters int

	// TotalAdapters maximum number of interfaces that can be
	// attached to the instance
	TotalAdapters int

	// IPv4PerAdapter is the maximum number of ipv4 addresses per adapter/interface
	IPv4PerAdapter int

	// IPv6PerAdapter is the maximum number of ipv6 addresses per adapter/interface
	IPv6PerAdapter int

	// MemberAdapterLimit is the number interfaces that type is member
	MemberAdapterLimit int

	// MaxMemberAdapterLimit is the limit to use member
	MaxMemberAdapterLimit int

	InstanceBandwidthRx int

	InstanceBandwidthTx int
}

Limits specifies the IPAM relevant instance limits

func GetLimit added in v1.1.0

func GetLimit(client client.ECS, instanceType string) (*Limits, error)

GetLimit returns the instance limits of a particular instance type. // https://www.alibabacloud.com/help/doc-detail/25620.htm if instanceType is empty will list all instanceType and warm the cache, no error and Limits will return

func (*Limits) ExclusiveENIPod added in v1.3.0

func (l *Limits) ExclusiveENIPod() int

func (*Limits) MaximumTrunkPod added in v1.3.0

func (l *Limits) MaximumTrunkPod() int

func (*Limits) MultiIPPod added in v1.3.0

func (l *Limits) MultiIPPod() int

func (*Limits) SupportIPv6 added in v1.1.0

func (l *Limits) SupportIPv6() bool

func (*Limits) SupportMultiIPIPv6 added in v1.3.0

func (l *Limits) SupportMultiIPIPv6() bool

func (*Limits) TrunkPod added in v1.1.0

func (l *Limits) TrunkPod() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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