session

package
v1.12.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 19 Imported by: 8

Documentation

Overview

Package session contains tools to create and retrieve a VCenter session.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear added in v1.5.2

func Clear()

Clear is meant to destroy all the cached sessions.

func IsUnidentifiedVCenterVersion added in v1.3.2

func IsUnidentifiedVCenterVersion(err error) bool

IsUnidentifiedVCenterVersion identies an error as an unidentifiedVCenterVersion error.

Types

type Feature added in v0.8.0

type Feature struct{}

Feature is a set of Features of the session.

func DefaultFeature added in v0.8.0

func DefaultFeature() Feature

DefaultFeature sets the default values for features.

type Params added in v0.8.0

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

Params are the parameters of a VCenter session.

func NewParams added in v0.8.0

func NewParams() *Params

NewParams returns an empty set of parameters with default features.

func (*Params) WithDatacenter added in v0.8.0

func (p *Params) WithDatacenter(datacenter string) *Params

WithDatacenter adds a datacenter to parameters.

func (*Params) WithFeatures added in v0.8.0

func (p *Params) WithFeatures(feature Feature) *Params

WithFeatures adds features to parameters.

func (*Params) WithServer added in v0.8.0

func (p *Params) WithServer(server string) *Params

WithServer adds a server to parameters.

func (*Params) WithThumbprint added in v0.8.0

func (p *Params) WithThumbprint(thumbprint string) *Params

WithThumbprint adds a thumbprint to parameters.

func (*Params) WithUserInfo added in v0.8.0

func (p *Params) WithUserInfo(username, password string) *Params

WithUserInfo adds userinfo to parameters.

type Session

type Session struct {
	*govmomi.Client
	Finder *find.Finder

	TagManager *tags.Manager
	// contains filtered or unexported fields
}

Session is a vSphere session with a configured Finder.

func GetOrCreate

func GetOrCreate(ctx context.Context, params *Params) (*Session, error)

GetOrCreate gets a cached session or creates a new one if one does not already exist.

func (*Session) FindByBIOSUUID

func (s *Session) FindByBIOSUUID(ctx context.Context, uuid string) (object.Reference, error)

FindByBIOSUUID finds an object by its BIOS UUID.

To avoid comments about this function's name, please see the Golang WIKI https://github.com/golang/go/wiki/CodeReviewComments#initialisms. This function is named in accordance with the example "XMLHTTP".

func (*Session) FindByInstanceUUID

func (s *Session) FindByInstanceUUID(ctx context.Context, uuid string) (object.Reference, error)

FindByInstanceUUID finds an object by its instance UUID.

func (*Session) GetVersion added in v1.3.2

func (s *Session) GetVersion() (infrav1.VCenterVersion, error)

GetVersion returns the VCenterVersion.

Jump to

Keyboard shortcuts

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