govplus

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorNoClient   = errors.New("no vCenter client, no session has been opened")
	ErrorNotVC      = errors.New("endpoint does not look like a vCenter")
	ErrorURLParsing = errors.New("error parsing URL for vcenter")
	ErrorURLNil     = errors.New("vcenter URL should not be nil")
)

Common raised errors

Functions

func ClientIsActive

func ClientIsActive(ctx context.Context, c *govmomi.Client) bool

ClientIsActive returns true if the vCenter soap session is active

func CloseClient

func CloseClient(ctx context.Context, c *govmomi.Client)

CloseClient closes govmomi client

func CloseRestClient

func CloseRestClient(ctx context.Context, rc *rest.Client)

CloseRestClient closes vSphere rest client

func IsHardQueryError

func IsHardQueryError(err error) (bool, error)

IsHardQueryError returns false if error is light and we may continue quering

func NewClient

func NewClient(
	ctx context.Context,
	u *url.URL,
	t *tls.ClientConfig,
) (*govmomi.Client, error)

NewClient creates a vSphere vim25.Client (ie inventory queries)

func NewRestClient

func NewRestClient(
	ctx context.Context,
	u *url.URL,
	t *tls.ClientConfig,
	c *govmomi.Client,
) (*rest.Client, error)

NewRestClient creates a vSphere rest.Client (ie tags queries)

func PaseURL

func PaseURL(vcenterURL, user, pass string) (*url.URL, error)

PaseURL parses vcenter URL params

func RestClientIsActive

func RestClientIsActive(ctx context.Context, rc *rest.Client) bool

RestClientIsActive returns true if the vCenter rest session is active

Types

This section is empty.

Jump to

Keyboard shortcuts

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