lan

package
v0.3.2-test Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCreateIPFailoverInput

func GenerateCreateIPFailoverInput(ipFailovers []sdkgo.IPFailover, ip, nicID string) (*sdkgo.LanProperties, error)

GenerateCreateIPFailoverInput returns sdkgo.LanProperties based on ip, nicID and current IPFailovers

func GenerateCreateLanInput

func GenerateCreateLanInput(cr *v1alpha1.Lan) (*sdkgo.LanPost, error)

GenerateCreateLanInput returns sdkgo.LanPost based on the CR spec

func GenerateRemoveIPFailoverInput

func GenerateRemoveIPFailoverInput(ipFailovers []sdkgo.IPFailover, ip string) (*sdkgo.LanProperties, error)

GenerateRemoveIPFailoverInput returns sdkgo.LanProperties based on the ip and the current IPFailovers

func GenerateUpdateIPFailoverInput

func GenerateUpdateIPFailoverInput(ipFailovers []sdkgo.IPFailover, newIP, oldIP, nicID string) (*sdkgo.LanProperties, error)

GenerateUpdateIPFailoverInput returns sdkgo.LanProperties based on the new IP, old IP and nicID set by the user and the current IPFailovers

func GenerateUpdateLanInput

func GenerateUpdateLanInput(cr *v1alpha1.Lan) (*sdkgo.LanProperties, error)

GenerateUpdateLanInput returns sdkgo.LanProperties based on the CR spec modifications

func GetIPFailoverIPs

func GetIPFailoverIPs(lan sdkgo.Lan) []string

GetIPFailoverIPs returns all the IPFailovers IPs set on Lan

func IsIPFailoverPresent

func IsIPFailoverPresent(ipFailovers []sdkgo.IPFailover, ip, nicID string) bool

IsIPFailoverPresent returns true if the IPFailover exists in the specified Lan

func IsIPFailoverUpToDate

func IsIPFailoverUpToDate(cr *v1alpha1.IPFailover, lanIPFailovers []sdkgo.IPFailover, ipSetByUser string) bool

IsIPFailoverUpToDate returns true if the IPFailover is up-to-date or false if it does not

func IsLanUpToDate

func IsLanUpToDate(cr *v1alpha1.Lan, lan sdkgo.Lan) bool

IsLanUpToDate returns true if the Lan is up-to-date or false if it does not

Types

type APIClient

type APIClient struct {
	*clients.IonosServices
}

APIClient is a wrapper around IONOS Service

func (*APIClient) CheckDuplicateLan

func (cp *APIClient) CheckDuplicateLan(ctx context.Context, datacenterID, lanName string) (*sdkgo.Lan, error)

CheckDuplicateLan based on datacenterID, lanName

func (*APIClient) CreateLan

func (cp *APIClient) CreateLan(ctx context.Context, datacenterID string, lan sdkgo.LanPost) (sdkgo.LanPost, *sdkgo.APIResponse, error)

CreateLan based on datacenterID and Lan properties

func (*APIClient) DeleteLan

func (cp *APIClient) DeleteLan(ctx context.Context, datacenterID, lanID string) (*sdkgo.APIResponse, error)

DeleteLan based on datacenterID, lanID

func (*APIClient) GetAPIClient

func (cp *APIClient) GetAPIClient() *sdkgo.APIClient

GetAPIClient gets the APIClient

func (*APIClient) GetLan

func (cp *APIClient) GetLan(ctx context.Context, datacenterID, lanID string) (sdkgo.Lan, *sdkgo.APIResponse, error)

GetLan based on datacenterID, lanID

func (*APIClient) GetLanID

func (cp *APIClient) GetLanID(lan *sdkgo.Lan) (string, error)

GetLanID based on lan

func (*APIClient) GetLanIPFailovers

func (cp *APIClient) GetLanIPFailovers(ctx context.Context, datacenterID, lanID string) ([]sdkgo.IPFailover, error)

GetLanIPFailovers based on datacenterID, lanID

func (*APIClient) UpdateLan

func (cp *APIClient) UpdateLan(ctx context.Context, datacenterID, lanID string, lan sdkgo.LanProperties) (sdkgo.Lan, *sdkgo.APIResponse, error)

UpdateLan based on datacenterID, lanID and Lan properties

type Client

type Client interface {
	CheckDuplicateLan(ctx context.Context, datacenterID, lanName string) (*sdkgo.Lan, error)
	GetLanID(lan *sdkgo.Lan) (string, error)
	GetLan(ctx context.Context, datacenterID, lanID string) (sdkgo.Lan, *sdkgo.APIResponse, error)
	GetLanIPFailovers(ctx context.Context, datacenterID, lanID string) ([]sdkgo.IPFailover, error)
	CreateLan(ctx context.Context, datacenterID string, lan sdkgo.LanPost) (sdkgo.LanPost, *sdkgo.APIResponse, error)
	UpdateLan(ctx context.Context, datacenterID, lanID string, lan sdkgo.LanProperties) (sdkgo.Lan, *sdkgo.APIResponse, error)
	DeleteLan(ctx context.Context, datacenterID, lanID string) (*sdkgo.APIResponse, error)
	GetAPIClient() *sdkgo.APIClient
}

Client is a wrapper around IONOS Service Lan methods

Jump to

Keyboard shortcuts

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