client

package
v1.17.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APICreateNetworkInterface     = "CreateNetworkInterface"
	APIDescribeNetworkInterfaces  = "DescribeNetworkInterfaces"
	APIAttachNetworkInterface     = "AttachNetworkInterface"
	APIDetachNetworkInterface     = "DetachNetworkInterface"
	APIDeleteNetworkInterface     = "DeleteNetworkInterface"
	APIAssignPrivateIPAddress     = "AssignPrivateIpAddresses"
	APIUnAssignPrivateIPAddresses = "UnAssignPrivateIpAddresses"
	APIAssignIPv6Addresses        = "AssignIpv6Addresses"
	APIUnAssignIpv6Addresses      = "UnAssignIpv6Addresses"
	APIDescribeInstanceTypes      = "DescribeInstanceTypes"
)
View Source
const (
	APIDescribeNode     = "DescribeNode"
	APIDescribeNodeType = "DescribeNodeType"
)
View Source
const (
	APICreateElasticNetworkInterface = "CreateElasticNetworkInterface"
	APIAssignLeniPrivateIPAddress    = "AssignLeniPrivateIpAddress"
	APIAttachElasticNetworkInterface = "AttachElasticNetworkInterface"
	APIDetachElasticNetworkInterface = "DetachElasticNetworkInterface"
	APIDeleteElasticNetworkInterface = "DeleteElasticNetworkInterface"
	APIUnassignLeniPrivateIPAddress  = "UnassignLeniPrivateIpAddress"
	APIListLeniPrivateIPAddresses    = "ListLeniPrivateIpAddresses"
	APIListElasticNetworkInterfaces  = "ListElasticNetworkInterfaces"
	APIGetNodeInfoForPod             = "GetNodeInfoForPod"
)
View Source
const (
	LogFieldAPI       = "api"
	LogFieldRequestID = "requestID"
	LogFieldENIID     = "eni"
)

log fields

View Source
const (
	ENIStatusInUse     string = "InUse"
	ENIStatusAvailable string = "Available"
	ENIStatusAttaching string = "Attaching"
	ENIStatusDetaching string = "Detaching"
	ENIStatusDeleting  string = "Deleting"
)

status for eni

View Source
const (
	LENIStatusAvailable    string = "Available"
	LENIStatusUnattached   string = "Unattached"
	LENIStatusExecuting    string = "Executing"
	LENIStatusAttaching    string = "Attaching"
	LENIStatusDetaching    string = "Detaching"
	LENIStatusCreateFailed string = "Create Failed"
	LENIStatusAttachFailed string = "Attach Failed"
	LENIStatusDeleteFailed string = "Delete Failed"
	LENIStatusDetachFailed string = "Detach Failed"
	LENIStatusDeleting     string = "Deleting"

	LENIIPStatusAvailable string = "Available"
)
View Source
const (
	ENITypePrimary   string = "Primary"
	ENITypeSecondary string = "Secondary"
	ENITypeTrunk     string = "Trunk"
	ENITypeMember    string = "Member"
)
View Source
const (
	ENITrafficModeRDMA     string = "HighPerformance"
	ENITrafficModeStandard string = "Standard"
)
View Source
const (
	APIDescribeVSwitches = "DescribeVSwitches"
)
View Source
const EIPInstanceTypeNetworkInterface = "NetworkInterface"

Variables

View Source
var ErrInvalidArgs = errors.New("invalid args")
View Source
var ErrNotImplemented = errors.New("not implemented")

Functions

func ClassifyENILinkCapability added in v1.17.1

func ClassifyENILinkCapability(enis []*NetworkInterface) (hasPrimary, hasMigrationTags bool)

ClassifyENILinkCapability checks whether a list of ENIs indicates ECS link support. hasPrimary is true when a Primary ENI exists (new ENI link instances). hasMigrationTags is true when any non-Primary ENI has both leni_primary=true and acs:ecs:support_eni=true tags (migrated instances).

func FromPtr added in v1.14.3

func FromPtr[V any, T ~*V](ptr T) V

func LogFields added in v1.8.4

func LogFields(l logr.Logger, obj any) logr.Logger

LogFields function enhances the provided logger with key-value pairs extracted from the fields of the given object.

Parameters: l - The original logr.Logger instance to be augmented with object field information. obj - An arbitrary object whose fields will be inspected for logging. Must be of a struct type.

Return Value: Returns an updated logr.Logger instance that includes key-value pairs for non-empty, non-zero fields of the input object. The original logger `l` is modified in place, and the returned logger is a reference to the same instance.

func SetBackendAPI added in v1.14.3

func SetBackendAPI(ctx context.Context, b BackendAPI) context.Context

Types

type APIFacade added in v1.14.3

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

func NewAPIFacade added in v1.14.3

func NewAPIFacade(clientSet credential.Client, limitConfig LimitConfig) *APIFacade

func (*APIFacade) AssignIpv6AddressesV2 added in v1.14.3

func (a *APIFacade) AssignIpv6AddressesV2(ctx context.Context, opts ...AssignIPv6AddressesOption) ([]IPSet, error)

func (*APIFacade) AssignPrivateIPAddressV2 added in v1.14.3

func (a *APIFacade) AssignPrivateIPAddressV2(ctx context.Context, opts ...AssignPrivateIPAddressOption) ([]IPSet, error)

func (*APIFacade) AttachNetworkInterfaceV2 added in v1.14.3

func (a *APIFacade) AttachNetworkInterfaceV2(ctx context.Context, opts ...AttachNetworkInterfaceOption) error

func (*APIFacade) CreateNetworkInterfaceV2 added in v1.14.3

func (a *APIFacade) CreateNetworkInterfaceV2(ctx context.Context, opts ...CreateNetworkInterfaceOption) (*NetworkInterface, error)

func (*APIFacade) DeleteNetworkInterfaceV2 added in v1.14.3

func (a *APIFacade) DeleteNetworkInterfaceV2(ctx context.Context, eniID string) error

func (*APIFacade) DescribeNetworkInterfaceV2 added in v1.14.3

func (a *APIFacade) DescribeNetworkInterfaceV2(ctx context.Context, opts ...DescribeNetworkInterfaceOption) ([]*NetworkInterface, error)

func (*APIFacade) DetachNetworkInterfaceV2 added in v1.14.3

func (a *APIFacade) DetachNetworkInterfaceV2(ctx context.Context, opts ...DetachNetworkInterfaceOption) error

func (*APIFacade) GetECS added in v1.14.3

func (a *APIFacade) GetECS() ECS

func (*APIFacade) GetEFLO added in v1.14.3

func (a *APIFacade) GetEFLO() EFLO

func (*APIFacade) GetEFLOController added in v1.15.1

func (a *APIFacade) GetEFLOController() EFLOControl

func (*APIFacade) GetVPC added in v1.14.3

func (a *APIFacade) GetVPC() VPC

func (*APIFacade) UnAssignIpv6AddressesV2 added in v1.14.3

func (a *APIFacade) UnAssignIpv6AddressesV2(ctx context.Context, eniID string, ips []IPSet) error

func (*APIFacade) UnAssignPrivateIPAddressesV2 added in v1.14.3

func (a *APIFacade) UnAssignPrivateIPAddressesV2(ctx context.Context, eniID string, ips []IPSet) error

func (*APIFacade) WaitForNetworkInterfaceV2 added in v1.14.3

func (a *APIFacade) WaitForNetworkInterfaceV2(ctx context.Context, eniID string, status string, backoff wait.Backoff, ignoreNotExist bool) (*NetworkInterface, error)

type AssignIPv6AddressesOption added in v1.8.4

type AssignIPv6AddressesOption interface {
	ApplyAssignIPv6Addresses(*AssignIPv6AddressesOptions)
}

type AssignIPv6AddressesOptions added in v1.8.4

type AssignIPv6AddressesOptions struct {
	NetworkInterfaceOptions *NetworkInterfaceOptions
	Backoff                 *wait.Backoff
}

func (*AssignIPv6AddressesOptions) ApplyAssignIPv6Addresses added in v1.8.4

func (c *AssignIPv6AddressesOptions) ApplyAssignIPv6Addresses(options *AssignIPv6AddressesOptions)

func (*AssignIPv6AddressesOptions) Finish added in v1.8.4

func (c *AssignIPv6AddressesOptions) Finish(idempotentKeyGen IdempotentKeyGen) (*ecs.AssignIpv6AddressesRequest, func(), error)

type AssignPrivateIPAddressOption added in v1.8.4

type AssignPrivateIPAddressOption interface {
	ApplyAssignPrivateIPAddress(*AssignPrivateIPAddressOptions)
}

type AssignPrivateIPAddressOptions added in v1.8.4

type AssignPrivateIPAddressOptions struct {
	NetworkInterfaceOptions *NetworkInterfaceOptions
	Backoff                 *wait.Backoff
}

func (*AssignPrivateIPAddressOptions) ApplyAssignPrivateIPAddress added in v1.8.4

func (c *AssignPrivateIPAddressOptions) ApplyAssignPrivateIPAddress(options *AssignPrivateIPAddressOptions)

func (*AssignPrivateIPAddressOptions) EFLO added in v1.13.7

func (*AssignPrivateIPAddressOptions) Finish added in v1.8.4

type AttachNetworkInterfaceOption added in v1.13.7

type AttachNetworkInterfaceOption interface {
	ApplyTo(*AttachNetworkInterfaceOptions)
}

type AttachNetworkInterfaceOptions added in v1.13.7

type AttachNetworkInterfaceOptions struct {
	NetworkInterfaceID     *string
	InstanceID             *string
	TrunkNetworkInstanceID *string
	NetworkCardIndex       *int
	Backoff                *wait.Backoff
}

func (*AttachNetworkInterfaceOptions) ApplyTo added in v1.13.7

func (*AttachNetworkInterfaceOptions) ECS added in v1.13.7

func (*AttachNetworkInterfaceOptions) EFLO added in v1.14.3

type BackendAPI added in v1.14.3

type BackendAPI int
const (
	BackendAPIECS BackendAPI = iota
	BackendAPIEFLO
	BackendAPIEFLOHDENI
)

func GetBackendAPI added in v1.14.3

func GetBackendAPI(ctx context.Context) BackendAPI

type CreateNetworkInterfaceOption added in v1.8.4

type CreateNetworkInterfaceOption interface {
	ApplyCreateNetworkInterface(*CreateNetworkInterfaceOptions)
}

type CreateNetworkInterfaceOptions added in v1.8.4

type CreateNetworkInterfaceOptions struct {
	NetworkInterfaceOptions *NetworkInterfaceOptions
	Backoff                 *wait.Backoff
}

func (*CreateNetworkInterfaceOptions) ApplyCreateNetworkInterface added in v1.8.4

func (c *CreateNetworkInterfaceOptions) ApplyCreateNetworkInterface(options *CreateNetworkInterfaceOptions)

func (*CreateNetworkInterfaceOptions) EFLO added in v1.13.7

func (*CreateNetworkInterfaceOptions) Finish added in v1.8.4

type DescribeNetworkInterfaceOption added in v1.13.7

type DescribeNetworkInterfaceOption interface {
	ApplyTo(*DescribeNetworkInterfaceOptions)
}

type DescribeNetworkInterfaceOptions added in v1.13.7

type DescribeNetworkInterfaceOptions struct {
	VPCID               *string
	NetworkInterfaceIDs *[]string
	InstanceID          *string
	InstanceType        *string
	Status              *string
	Tags                *map[string]string

	Backoff *wait.Backoff

	RawStatus *bool
}

func (*DescribeNetworkInterfaceOptions) ApplyTo added in v1.13.7

func (*DescribeNetworkInterfaceOptions) ECS added in v1.13.7

func (*DescribeNetworkInterfaceOptions) EFLO added in v1.13.7

type DescribeNodeRequestOption added in v1.15.1

type DescribeNodeRequestOption interface {
	ApplyTo(*DescribeNodeRequestOptions)
}

type DescribeNodeRequestOptions added in v1.15.1

type DescribeNodeRequestOptions struct {
	NodeID *string
}

func (*DescribeNodeRequestOptions) ApplyTo added in v1.15.1

func (*DescribeNodeRequestOptions) EFLOControl added in v1.15.1

type DescribeNodeResponse added in v1.15.1

type DescribeNodeResponse struct {
	NodeID   string
	ZoneID   string
	NodeType string
}

type DescribeNodeTypeRequestOption added in v1.15.1

type DescribeNodeTypeRequestOption interface {
	ApplyTo(*DescribeNodeTypeRequestOptions)
}

type DescribeNodeTypeRequestOptions added in v1.15.1

type DescribeNodeTypeRequestOptions struct {
	NodeType *string
}

func (*DescribeNodeTypeRequestOptions) ApplyTo added in v1.15.1

func (*DescribeNodeTypeRequestOptions) EFLOControl added in v1.15.1

type DescribeNodeTypeResponse added in v1.15.1

type DescribeNodeTypeResponse struct {
	EniHighDenseQuantity        int
	EniIpv6AddressQuantity      int
	EniPrivateIpAddressQuantity int
	EniQuantity                 int
}

type DetachNetworkInterfaceOption added in v1.14.3

type DetachNetworkInterfaceOption interface {
	ApplyTo(*DetachNetworkInterfaceOptions)
}

type DetachNetworkInterfaceOptions added in v1.14.3

type DetachNetworkInterfaceOptions struct {
	NetworkInterfaceID *string
	InstanceID         *string
	TrunkID            *string
	Backoff            *wait.Backoff
}

func (*DetachNetworkInterfaceOptions) ApplyTo added in v1.14.3

func (*DetachNetworkInterfaceOptions) ECS added in v1.14.3

func (*DetachNetworkInterfaceOptions) EFLO added in v1.14.3

type ECS added in v1.14.3

type ECS interface {
	CreateNetworkInterface(ctx context.Context, opts ...CreateNetworkInterfaceOption) (*NetworkInterface, error)
	DescribeNetworkInterface(ctx context.Context, vpcID string, eniID []string, instanceID string, instanceType string, status string, tags map[string]string) ([]*NetworkInterface, error)
	AttachNetworkInterface(ctx context.Context, opts ...AttachNetworkInterfaceOption) error
	DetachNetworkInterface(ctx context.Context, eniID, instanceID, trunkENIID string) error
	DeleteNetworkInterface(ctx context.Context, eniID string) error
	WaitForNetworkInterface(ctx context.Context, eniID string, status string, backoff wait.Backoff, ignoreNotExist bool) (*NetworkInterface, error)
	AssignPrivateIPAddress(ctx context.Context, opts ...AssignPrivateIPAddressOption) ([]netip.Addr, error)
	UnAssignPrivateIPAddresses(ctx context.Context, eniID string, ips []netip.Addr) error
	AssignIpv6Addresses(ctx context.Context, opts ...AssignIPv6AddressesOption) ([]netip.Addr, error)
	UnAssignIpv6Addresses(ctx context.Context, eniID string, ips []netip.Addr) error
	DescribeInstanceTypes(ctx context.Context, types []string) ([]ecs.InstanceType, error)

	DescribeNetworkInterface2(ctx context.Context, opts ...DescribeNetworkInterfaceOption) ([]*NetworkInterface, error)
	DetachNetworkInterface2(ctx context.Context, opts ...DetachNetworkInterfaceOption) error
	AssignPrivateIPAddress2(ctx context.Context, opts ...AssignPrivateIPAddressOption) ([]IPSet, error)
	UnAssignPrivateIPAddresses2(ctx context.Context, eniID string, ips []IPSet) error
	AssignIpv6Addresses2(ctx context.Context, opts ...AssignIPv6AddressesOption) ([]IPSet, error)
	UnAssignIpv6Addresses2(ctx context.Context, eniID string, ips []IPSet) error
}

type ECSService added in v1.14.3

type ECSService struct {
	ClientSet        credential.Client
	IdempotentKeyGen IdempotentKeyGen
	RateLimiter      *RateLimiter
	Tracer           trace.Tracer
}

func NewECSService added in v1.14.3

func NewECSService(clientSet credential.Client, rateLimiter *RateLimiter, tracer trace.Tracer) *ECSService

func (*ECSService) AssignIpv6Addresses added in v1.14.3

func (a *ECSService) AssignIpv6Addresses(ctx context.Context, opts ...AssignIPv6AddressesOption) ([]netip.Addr, error)

AssignIpv6Addresses assign ipv6 address

func (*ECSService) AssignIpv6Addresses2 added in v1.14.3

func (a *ECSService) AssignIpv6Addresses2(ctx context.Context, opts ...AssignIPv6AddressesOption) ([]IPSet, error)

AssignIpv6Addresses2 assign ipv6 address

func (*ECSService) AssignPrivateIPAddress added in v1.14.3

func (a *ECSService) AssignPrivateIPAddress(ctx context.Context, opts ...AssignPrivateIPAddressOption) ([]netip.Addr, error)

func (*ECSService) AssignPrivateIPAddress2 added in v1.14.3

func (a *ECSService) AssignPrivateIPAddress2(ctx context.Context, opts ...AssignPrivateIPAddressOption) ([]IPSet, error)

func (*ECSService) AttachNetworkInterface added in v1.14.3

func (a *ECSService) AttachNetworkInterface(ctx context.Context, opts ...AttachNetworkInterfaceOption) error

AttachNetworkInterface attach eni

func (*ECSService) CreateNetworkInterface added in v1.14.3

func (a *ECSService) CreateNetworkInterface(ctx context.Context, opts ...CreateNetworkInterfaceOption) (*NetworkInterface, error)

func (*ECSService) DeleteNetworkInterface added in v1.14.3

func (a *ECSService) DeleteNetworkInterface(ctx context.Context, eniID string) error

DeleteNetworkInterface del eni by id

func (*ECSService) DescribeInstanceTypes added in v1.14.3

func (a *ECSService) DescribeInstanceTypes(ctx context.Context, types []string) ([]ecs.InstanceType, error)

func (*ECSService) DescribeNetworkInterface added in v1.14.3

func (a *ECSService) DescribeNetworkInterface(ctx context.Context, vpcID string, eniID []string, instanceID string, instanceType string, status string, tags map[string]string) ([]*NetworkInterface, error)

DescribeNetworkInterface list eni

func (*ECSService) DescribeNetworkInterface2 added in v1.14.3

func (a *ECSService) DescribeNetworkInterface2(ctx context.Context, opts ...DescribeNetworkInterfaceOption) ([]*NetworkInterface, error)

DescribeNetworkInterface2 list eni

func (*ECSService) DetachNetworkInterface added in v1.14.3

func (a *ECSService) DetachNetworkInterface(ctx context.Context, eniID, instanceID, trunkENIID string) error

DetachNetworkInterface detach eni

func (*ECSService) DetachNetworkInterface2 added in v1.14.3

func (a *ECSService) DetachNetworkInterface2(ctx context.Context, opts ...DetachNetworkInterfaceOption) error

DetachNetworkInterface2 detaches an ENI using the new option-based interface.

func (*ECSService) UnAssignIpv6Addresses added in v1.14.3

func (a *ECSService) UnAssignIpv6Addresses(ctx context.Context, eniID string, ips []netip.Addr) error

UnAssignIpv6Addresses remove ip from eni return ok if 1. eni is released 2. ip is already released 3. release success

func (*ECSService) UnAssignIpv6Addresses2 added in v1.14.3

func (a *ECSService) UnAssignIpv6Addresses2(ctx context.Context, eniID string, ips []IPSet) error

UnAssignIpv6Addresses2 remove ip from eni return ok if 1. eni is released 2. ip is already released 3. release success

func (*ECSService) UnAssignPrivateIPAddresses added in v1.14.3

func (a *ECSService) UnAssignPrivateIPAddresses(ctx context.Context, eniID string, ips []netip.Addr) error

UnAssignPrivateIPAddresses remove ip from eni return ok if 1. eni is released 2. ip is already released 3. release success for primaryIP err is InvalidIp.IpUnassigned

func (*ECSService) UnAssignPrivateIPAddresses2 added in v1.14.3

func (a *ECSService) UnAssignPrivateIPAddresses2(ctx context.Context, eniID string, ips []IPSet) error

func (*ECSService) WaitForNetworkInterface added in v1.14.3

func (a *ECSService) WaitForNetworkInterface(ctx context.Context, eniID string, status string, backoff wait.Backoff, ignoreNotExist bool) (*NetworkInterface, error)

WaitForNetworkInterface wait status of eni

type EFLO added in v1.8.0

type EFLO interface {
	GetNodeInfoForPod(ctx context.Context, nodeID string) (*eflo.Content, error)

	CreateElasticNetworkInterfaceV2(ctx context.Context, opts ...CreateNetworkInterfaceOption) (*NetworkInterface, error)
	DescribeLeniNetworkInterface(ctx context.Context, opts ...DescribeNetworkInterfaceOption) ([]*NetworkInterface, error)
	AssignLeniPrivateIPAddress2(ctx context.Context, opts ...AssignPrivateIPAddressOption) ([]IPSet, error)
	UnAssignLeniPrivateIPAddresses2(ctx context.Context, eniID string, ips []IPSet) error
	WaitForLeniNetworkInterface(ctx context.Context, eniID string, status string, backoff wait.Backoff, ignoreNotExist bool) (*NetworkInterface, error)
	AttachLeni(ctx context.Context, opts ...AttachNetworkInterfaceOption) error
	DetachLeni(ctx context.Context, opts ...DetachNetworkInterfaceOption) error

	DeleteElasticNetworkInterface(ctx context.Context, eniID string) error
	UnassignLeniPrivateIPAddress(ctx context.Context, eniID, ipName string) error
	ListLeniPrivateIPAddresses(ctx context.Context, eniID, ipName, ipAddress string) (*eflo.Content, error)

	CreateHDENI(ctx context.Context, opts ...CreateNetworkInterfaceOption) (*NetworkInterface, error)
	DeleteHDENI(ctx context.Context, eniID string) error
	DescribeHDENI(ctx context.Context, opts ...DescribeNetworkInterfaceOption) ([]*NetworkInterface, error)
	AttachHDENI(ctx context.Context, opts ...AttachNetworkInterfaceOption) error
	DetachHDENI(ctx context.Context, opts ...DetachNetworkInterfaceOption) error
}

type EFLOControl added in v1.15.1

type EFLOControl interface {
	DescribeNode(ctx context.Context, opts ...DescribeNodeRequestOption) (*DescribeNodeResponse, error)
	DescribeNodeType(ctx context.Context, opts ...DescribeNodeTypeRequestOption) (*DescribeNodeTypeResponse, error)
}

type EFLOControlService added in v1.15.1

type EFLOControlService struct {
	ClientSet        credential.Client
	IdempotentKeyGen IdempotentKeyGen
	RateLimiter      *RateLimiter
	Tracer           trace.Tracer
}

func NewEFLOControlService added in v1.15.1

func NewEFLOControlService(clientSet credential.Client, rateLimiter *RateLimiter, tracer trace.Tracer) *EFLOControlService

func (*EFLOControlService) DescribeNode added in v1.15.1

func (*EFLOControlService) DescribeNodeType added in v1.15.1

type EFLOService added in v1.14.3

type EFLOService struct {
	ClientSet        credential.Client
	IdempotentKeyGen IdempotentKeyGen
	RateLimiter      *RateLimiter
	Tracer           trace.Tracer
}

func NewEFLOService added in v1.14.3

func NewEFLOService(clientSet credential.Client, rateLimiter *RateLimiter, tracer trace.Tracer) *EFLOService

func (*EFLOService) AssignLeniPrivateIPAddress2 added in v1.14.3

func (a *EFLOService) AssignLeniPrivateIPAddress2(ctx context.Context, opts ...AssignPrivateIPAddressOption) ([]IPSet, error)

func (*EFLOService) AttachHDENI added in v1.14.3

func (a *EFLOService) AttachHDENI(ctx context.Context, opts ...AttachNetworkInterfaceOption) error

func (*EFLOService) AttachLeni added in v1.14.3

func (a *EFLOService) AttachLeni(ctx context.Context, opts ...AttachNetworkInterfaceOption) error

func (*EFLOService) CreateElasticNetworkInterfaceV2 added in v1.14.3

func (a *EFLOService) CreateElasticNetworkInterfaceV2(ctx context.Context, opts ...CreateNetworkInterfaceOption) (*NetworkInterface, error)

func (*EFLOService) CreateHDENI added in v1.14.3

func (*EFLOService) DeleteElasticNetworkInterface added in v1.14.3

func (a *EFLOService) DeleteElasticNetworkInterface(ctx context.Context, eniID string) error

func (*EFLOService) DeleteHDENI added in v1.14.3

func (a *EFLOService) DeleteHDENI(ctx context.Context, eniID string) error

func (*EFLOService) DescribeHDENI added in v1.14.3

func (a *EFLOService) DescribeHDENI(ctx context.Context, opts ...DescribeNetworkInterfaceOption) ([]*NetworkInterface, error)

func (*EFLOService) DescribeLeniNetworkInterface added in v1.14.3

func (a *EFLOService) DescribeLeniNetworkInterface(ctx context.Context, opts ...DescribeNetworkInterfaceOption) ([]*NetworkInterface, error)

func (*EFLOService) DetachHDENI added in v1.14.3

func (a *EFLOService) DetachHDENI(ctx context.Context, opts ...DetachNetworkInterfaceOption) error

func (*EFLOService) DetachLeni added in v1.14.3

func (a *EFLOService) DetachLeni(ctx context.Context, opts ...DetachNetworkInterfaceOption) error

func (*EFLOService) GetNodeInfoForPod added in v1.14.3

func (a *EFLOService) GetNodeInfoForPod(ctx context.Context, nodeID string) (*eflo.Content, error)

func (*EFLOService) ListLeniPrivateIPAddresses added in v1.14.3

func (a *EFLOService) ListLeniPrivateIPAddresses(ctx context.Context, eniID, ipName, ipAddress string) (*eflo.Content, error)

func (*EFLOService) UnAssignLeniPrivateIPAddresses2 added in v1.14.3

func (a *EFLOService) UnAssignLeniPrivateIPAddresses2(ctx context.Context, eniID string, ips []IPSet) error

func (*EFLOService) UnassignLeniPrivateIPAddress added in v1.14.3

func (a *EFLOService) UnassignLeniPrivateIPAddress(ctx context.Context, eniID, ipName string) error

func (*EFLOService) WaitForLeniNetworkInterface added in v1.14.3

func (a *EFLOService) WaitForLeniNetworkInterface(ctx context.Context, eniID string, status string, backoff wait.Backoff, ignoreNotExist bool) (*NetworkInterface, error)

WaitForLeniNetworkInterface wait status of eni

type ENI added in v1.14.3

type ENI interface {
	CreateNetworkInterfaceV2(ctx context.Context, opts ...CreateNetworkInterfaceOption) (*NetworkInterface, error)
	DescribeNetworkInterfaceV2(ctx context.Context, opts ...DescribeNetworkInterfaceOption) ([]*NetworkInterface, error)
	//AttachNetworkInterface(ctx context.Context, opts ...AttachNetworkInterfaceOption) error
	AttachNetworkInterfaceV2(ctx context.Context, opts ...AttachNetworkInterfaceOption) error
	//DetachNetworkInterface(ctx context.Context, eniID, instanceID, trunkENIID string) error
	DetachNetworkInterfaceV2(ctx context.Context, opts ...DetachNetworkInterfaceOption) error
	DeleteNetworkInterfaceV2(ctx context.Context, eniID string) error
	AssignPrivateIPAddressV2(ctx context.Context, opts ...AssignPrivateIPAddressOption) ([]IPSet, error)
	UnAssignPrivateIPAddressesV2(ctx context.Context, eniID string, ips []IPSet) error
	AssignIpv6AddressesV2(ctx context.Context, opts ...AssignIPv6AddressesOption) ([]IPSet, error)
	UnAssignIpv6AddressesV2(ctx context.Context, eniID string, ips []IPSet) error
	WaitForNetworkInterfaceV2(ctx context.Context, eniID string, status string, backoff wait.Backoff, ignoreNotExist bool) (*NetworkInterface, error)
}

type IPSet added in v1.13.7

type IPSet struct {
	Primary   bool
	IPAddress string
	IPName    string
	IPStatus  string
	// Prefix is non-empty when this entry represents an IP prefix rather than a single address.
	Prefix Prefix
}

type IdempotentKeyGen added in v1.8.4

type IdempotentKeyGen interface {
	GenerateKey(paramHash string) string
	PutBack(paramHash string, uuid string)
}

type Limit added in v1.10.0

type Limit struct {
	QPS   float64
	Burst int
}

type LimitConfig added in v1.10.0

type LimitConfig map[string]Limit

func FromMap added in v1.10.0

func FromMap(in map[string]int) LimitConfig

type LimitProvider added in v1.9.6

type LimitProvider interface {
	GetLimit(client interface{}, instanceType string) (*Limits, error)
	GetLimitFromAnno(anno map[string]string) (*Limits, error)
}

func GetLimitProvider added in v1.14.3

func GetLimitProvider() LimitProvider

type Limits added in v1.8.0

type Limits struct {
	InstanceTypeID string

	// 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

	// ERdmaAdapters specifies the maximum number of erdma interfaces
	ERdmaAdapters int

	InstanceBandwidthRx int

	InstanceBandwidthTx int

	HighDenseQuantity int

	NetworkCards []NetworkCard
}

Limits specifies the IPAM relevant instance limits

func GetInstanceType added in v1.15.1

func GetInstanceType(instanceTypeInfo *ecs.InstanceType) *Limits

func (*Limits) ERDMARes added in v1.8.0

func (l *Limits) ERDMARes() int

func (*Limits) ExclusiveENIPod added in v1.8.0

func (l *Limits) ExclusiveENIPod() int

func (*Limits) MaximumTrunkPod added in v1.8.0

func (l *Limits) MaximumTrunkPod() int

func (*Limits) MultiIPPod added in v1.8.0

func (l *Limits) MultiIPPod() int

func (*Limits) SupportIPv6 added in v1.8.0

func (l *Limits) SupportIPv6() bool

func (*Limits) SupportMultiIPIPv6 added in v1.8.0

func (l *Limits) SupportMultiIPIPv6() bool

func (*Limits) TrunkPod added in v1.8.0

func (l *Limits) TrunkPod() int

type NetworkCard added in v1.13.7

type NetworkCard struct {
	Index int
}

type NetworkInterface added in v1.4.1

type NetworkInterface struct {
	Status             string    `json:"status,omitempty"`
	MacAddress         string    `json:"mac_address,omitempty"`
	NetworkInterfaceID string    `json:"network_interface_id,omitempty"`
	VPCID              string    `json:"vpc_ic,omitempty"`
	VSwitchID          string    `json:"v_switch_id,omitempty"`
	PrivateIPAddress   string    `json:"private_ip_address,omitempty"`
	PrivateIPSets      []IPSet   `json:"private_ip_sets"`
	ZoneID             string    `json:"zone_id,omitempty"`
	SecurityGroupIDs   []string  `json:"security_group_ids,omitempty"`
	ResourceGroupID    string    `json:"resource_group_id,omitempty"`
	IPv6Set            []IPSet   `json:"ipv6_set,omitempty"`
	Tags               []ecs.Tag `json:"tags,omitempty"`

	// fields for DescribeNetworkInterface
	Type                        string `json:"type,omitempty"`
	InstanceID                  string `json:"instance_id,omitempty"`
	TrunkNetworkInterfaceID     string `json:"trunk_network_interface_id,omitempty"`
	NetworkInterfaceTrafficMode string `json:"network_interface_traffic_mode"`
	DeviceIndex                 int    `json:"device_index,omitempty"`
	CreationTime                string `json:"creation_time,omitempty"`
	NetworkCardIndex            int    `json:"network_card_index,omitempty"`

	VfID *uint32 `json:"vf_id,omitempty"`

	// IPv4PrefixSets holds the IPv4 prefixes (CIDR notation) attached to this ENI.
	IPv4PrefixSets []Prefix `json:"ipv4_prefix_sets,omitempty"`
	// IPv6PrefixSets holds the IPv6 prefixes (CIDR notation) attached to this ENI.
	IPv6PrefixSets []Prefix `json:"ipv6_prefix_sets,omitempty"`
}

NetworkInterface openAPI result for ecs.CreateNetworkInterfaceResponse and ecs.NetworkInterfaceSet

func FromCreateResp added in v1.4.1

func FromDescribeResp added in v1.4.1

func FromDescribeResp(in *ecs.NetworkInterfaceSet) *NetworkInterface

type NetworkInterfaceOptions added in v1.8.4

type NetworkInterfaceOptions struct {
	Trunk                 bool
	ERDMA                 bool
	VSwitchID             string
	SecurityGroupIDs      []string
	ResourceGroupID       string
	IPCount               int
	IPv6Count             int
	IPv4PrefixCount       int
	IPv6PrefixCount       int
	Tags                  map[string]string
	InstanceID            string
	InstanceType          string
	Status                string
	NetworkInterfaceID    string
	DeleteENIOnECSRelease *bool
	SourceDestCheck       *bool

	ZoneID string
	VPCID  string
}

NetworkInterfaceOptions represents the common options for network interface operations.

type OpenAPI

type OpenAPI interface {
	GetECS() ECS
	GetVPC() VPC
	GetEFLO() EFLO
	GetEFLOController() EFLOControl
	ENI
}

type Prefix added in v1.17.1

type Prefix string

Prefix represents an IP prefix in CIDR notation (e.g. "192.168.0.0/28").

type Provider added in v1.14.3

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

func NewProvider added in v1.14.3

func NewProvider() *Provider

func (*Provider) GetLimit added in v1.14.3

func (d *Provider) GetLimit(client interface{}, instanceType string) (*Limits, error)

func (*Provider) GetLimitFromAnno added in v1.14.3

func (d *Provider) GetLimitFromAnno(anno map[string]string) (*Limits, error)

type RateLimiter added in v1.10.0

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

func NewRateLimiter added in v1.10.0

func NewRateLimiter(cfg LimitConfig) *RateLimiter

func (*RateLimiter) Wait added in v1.10.0

func (r *RateLimiter) Wait(ctx context.Context, name string) error

type SimpleIdempotentKeyGenerator added in v1.8.4

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

SimpleIdempotentKeyGenerator implements the generation and management of idempotency keys.

func NewIdempotentKeyGenerator added in v1.8.4

func NewIdempotentKeyGenerator() *SimpleIdempotentKeyGenerator

func (*SimpleIdempotentKeyGenerator) GenerateKey added in v1.8.4

func (g *SimpleIdempotentKeyGenerator) GenerateKey(paramHash string) string

GenerateKey generates an idempotency key based on the given parameter hash. multiple key is supported

func (*SimpleIdempotentKeyGenerator) PutBack added in v1.8.4

func (g *SimpleIdempotentKeyGenerator) PutBack(paramHash string, uuid string)

PutBack adds the specified idempotency key back into the cache for reuse, associating it with the given parameter hash.

type VPC added in v1.8.0

type VPC interface {
	DescribeVSwitchByID(ctx context.Context, vSwitchID string) (*vpc.VSwitch, error)
}

type VPCService added in v1.14.3

type VPCService struct {
	ClientSet        credential.Client
	IdempotentKeyGen IdempotentKeyGen
	RateLimiter      *RateLimiter
	Tracer           trace.Tracer
}

func NewVPCService added in v1.14.3

func NewVPCService(clientSet credential.Client, rateLimiter *RateLimiter, tracer trace.Tracer) *VPCService

func (*VPCService) DescribeVSwitchByID added in v1.14.3

func (a *VPCService) DescribeVSwitchByID(ctx context.Context, vSwitchID string) (*vpc.VSwitch, error)

DescribeVSwitchByID get vsw by id

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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