client

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderName = "nutanix"
)

Variables

This section is empty.

Functions

func GetCredentialRefForCluster

func GetCredentialRefForCluster(nutanixCluster *infrav1.NutanixCluster) (*credentialTypes.NutanixCredentialReference, error)

func GetTaskState

func GetTaskState(ctx context.Context, client *nutanixClientV3.Client, taskUUID string) (string, error)

func Retry

func Retry(initialInterval float64, maxInterval float64, numTries uint, function RetryableFunc) error

Retry retries a function up to numTries times with exponential backoff. If numTries == 0, retry indefinitely. If interval == 0, Retry will not delay retrying and there will be no exponential backoff. If maxInterval == 0, maxInterval is set to +Infinity. Intervals are in seconds. Returns an error if initial > max intervals, if retries are exhausted, or if the passed function returns an error.

func WaitForTaskCompletion

func WaitForTaskCompletion(ctx context.Context, conn *nutanixClientV3.Client, uuid string) error

Types

type NutanixClientHelper added in v0.5.2

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

func NewNutanixClientHelper added in v0.5.2

func NewNutanixClientHelper(ctx context.Context, secretInformer coreinformers.SecretInformer) (*NutanixClientHelper, error)

func (*NutanixClientHelper) GetClient added in v0.5.2

func (*NutanixClientHelper) GetClientFromEnvironment added in v0.5.2

func (n *NutanixClientHelper) GetClientFromEnvironment(nutanixCluster *infrav1.NutanixCluster) (*nutanixClientV3.Client, error)

type RetryableFunc

type RetryableFunc func(uint) (bool, error)

RetryableFunc performs an action and returns a bool indicating whether the function is done, or if it should keep retrying, and an error which will abort the retry and be returned by the Retry function. The 0-indexed attempt is passed with each call.

Jump to

Keyboard shortcuts

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