vclib

package
v0.0.0-...-f06192f Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VSphereConnection

type VSphereConnection struct {
	Client     *govmomi.Client
	RestClient *rest.Client
	Username   string
	Password   string
	Hostname   string
	Port       string
	Insecure   bool
	Config     *vsphere.VSphereConfig
}

VSphereConnection contains information for connecting to vCenter

func NewVSphereConnection

func NewVSphereConnection(username, password string, cfg *vsphere.VSphereConfig) *VSphereConnection

func (*VSphereConnection) Connect

func (connection *VSphereConnection) Connect(ctx context.Context) error

Connect makes connection to vCenter and sets VSphereConnection.Client. If connection.Client is already set, it obtains the existing user session. if user session is not valid, connection.Client will be set to the new client.

func (*VSphereConnection) Logout

func (connection *VSphereConnection) Logout(ctx context.Context) error

Logout calls SessionManager.Logout for the given connection.

func (*VSphereConnection) NewClient

func (connection *VSphereConnection) NewClient(ctx context.Context) error

Jump to

Keyboard shortcuts

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