govmomi – github.com/vmware/govmomi Index | Files | Directories

package govmomi

import "github.com/vmware/govmomi"

This package is the root package of the govmomi library.

The library is structured as follows:

Package vim25

The minimal usable functionality is available through the vim25 package. It contains subpackages that contain generated types, managed objects, and all available methods. The vim25 package is entirely independent of the other packages in the govmomi tree -- it has no dependencies on its peers.

The vim25 package itself contains a client structure that is passed around throughout the entire library. It abstracts a session and its immutable state. See the vim25 package for more information.

Package session

The session package contains an abstraction for the session manager that allows a user to login and logout. It also provides access to the current session (i.e. to determine if the user is in fact logged in)

Package object

The object package contains wrappers for a selection of managed objects. The constructors of these objects all take a *vim25.Client, which they pass along to derived objects, if applicable.

Package govc

The govc package contains the govc CLI. The code in this tree is not intended to be used as a library. Any functionality that govc contains that _could_ be used as a library function but isn't, _should_ live in a root level package.

Other packages

Other packages, such as "event", "guest", or "license", provide wrappers for the respective subsystems. They are typically not needed in normal workflows so are kept outside the object package.

Index

Types

type Client

type Client struct {
	*vim25.Client

	SessionManager *session.Manager
}

func NewClient

func NewClient(ctx context.Context, u *url.URL, insecure bool) (*Client, error)

NewClient creates a new client from a URL. The client authenticates with the server with username/password before returning if the URL contains user information.

func (*Client) IsVC

func (c *Client) IsVC() bool

IsVC returns true if we are connected to a vCenter

func (*Client) Login

func (c *Client) Login(ctx context.Context, u *url.Userinfo) error

Login dispatches to the SessionManager.

func (*Client) Logout

func (c *Client) Logout(ctx context.Context) error

Logout dispatches to the SessionManager.

func (*Client) PropertyCollector

func (c *Client) PropertyCollector() *property.Collector

PropertyCollector returns the session's default property collector.

func (*Client) Retrieve

func (c *Client) Retrieve(ctx context.Context, objs []types.ManagedObjectReference, p []string, dst interface{}) error

Retrieve dispatches to the Retrieve function on the default property collector.

func (*Client) RetrieveOne

func (c *Client) RetrieveOne(ctx context.Context, obj types.ManagedObjectReference, p []string, dst interface{}) error

RetrieveOne dispatches to the Retrieve function on the default property collector.

func (*Client) Wait

Wait dispatches to property.Wait.

Source Files

client.go

Directories

PathSynopsis
alarm
cli
cli/about
cli/alarm
cli/cluster
cli/cluster/draft
cli/cluster/draft/baseimage
cli/cluster/draft/component
cli/cluster/group
cli/cluster/module
cli/cluster/override
cli/cluster/rule
cli/cluster/vlcm
cli/datacenter
cli/datastore
cli/datastore/cluster
cli/datastore/disk
cli/datastore/maintenance
cli/datastore/vsan
cli/device
cli/device/cdrom
cli/device/clock
cli/device/floppy
cli/device/model
cli/device/pci
cli/device/scsi
cli/device/serial
cli/device/usb
cli/disk
cli/disk/metadata
cli/disk/snapshot
cli/dvs
cli/dvs/portgroup
cli/env
cli/esx
cli/events
cli/export
cli/extension
cli/fields
cli/flags
cli/folder
cli/host
cli/host/account
cli/host/autostart
cli/host/cert
cli/host/date
cli/host/esxcli
cli/host/firewall
cli/host/maintenance
cli/host/option
cli/host/portgroup
cli/host/service
cli/host/storage
cli/host/tpm
cli/host/vnic
cli/host/vswitch
cli/importx
cli/kms
cli/kms/key
cli/library
cli/library/policy
cli/library/session
cli/library/subscriber
cli/library/trust
cli/license
cli/logs
cli/ls
cli/metric
cli/metric/interval
cli/namespace
cli/namespace/cluster
cli/namespace/service
cli/namespace/service/version
cli/namespace/vmclass
cli/object
cli/option
cli/permissions
cli/pool
cli/role
cli/session
cli/sso
cli/sso/group
cli/sso/idp
cli/sso/lpp
cli/sso/service
cli/sso/user
cli/storage
cli/storage/policy
cli/tags
cli/tags/association
cli/tags/category
cli/task
cli/vapp
cli/vcsa
cli/vcsa/access
cli/vcsa/access/consolecli
cli/vcsa/access/dcui
cli/vcsa/access/shell
cli/vcsa/access/ssh
cli/vcsa/log
cli/vcsa/proxy
cli/vcsa/shutdown
cli/version
cli/vlcm
cli/vlcm/depot
cli/vlcm/depot/content
cli/vlcm/depot/content/baseimages
cli/vlcm/depot/offline
cli/vm
cli/vm/check
cli/vm/dataset
cli/vm/dataset/entry
cli/vm/disk
cli/vm/guest
cli/vm/network
cli/vm/option
cli/vm/rdm
cli/vm/snapshot
cli/vm/target
cli/volume
cli/volume/snapshot
cli/vsan
cns
cns/methods
cns/mo
cns/simulator
cns/types
cryptoPackage crypto provides access to CryptoManagerKmip methods used to manage cryptographic key providers.
eam
eam/internal
eam/methods
eam/mo
eam/object
eam/simulator
eam/types
event
examples
examples/alarms
examples/datastores
examples/events
examples/hosts
examples/networks
examples/perfmanager
examples/tasks
examples/virtualmachines
fault
findPackage find implements inventory listing and searching.
guest
guest/toolbox
history
internal
license
list
lookup
lookup/methods
lookup/simulator
lookup/types
nfc
object
ovfPackage ovf provides functionality to unmarshal and inspect the structure of an OVF file.
ovf/importer
pbm
pbm/methods
pbm/simulator
pbm/types
performance
property
session
session/cache
session/keepalive
simulatorPackage simulator is a mock framework for the vSphere API.
simulator/esxPackage esx contains SOAP responses from an ESX server, captured using `govc ...
simulator/internal
simulator/vpxPackage vpx contains SOAP responses from a vCenter server, captured using `govc ...
sms
sms/methods
sms/types
ssoadmin
ssoadmin/methods
ssoadmin/simulator
ssoadmin/types
sts
sts/internal
sts/simulator
task
testPackage test contains functions that implement common functionality between tests.
test/functional
toolbox
toolbox/hgfs
toolbox/process
toolbox/toolbox
toolbox/vix
units
vapiPackage vapi provides access to vSphere Automation APIs that are not available in the SOAP API, such as tagging and the content library.
vapi/appliance
vapi/appliance/access
vapi/appliance/access/consolecli
vapi/appliance/access/dcui
vapi/appliance/access/shell
vapi/appliance/access/ssh
vapi/appliance/logging
vapi/appliance/networking
vapi/appliance/shutdown
vapi/appliance/simulator
vapi/cis
vapi/cis/tasks
vapi/cis/tasks/simulator
vapi/cluster
vapi/cluster/internal
vapi/cluster/simulator
vapi/cryptoPackage vapi/crypto provides access to the Crypto Manager REST APIs that are not available in the SOAP API.
vapi/crypto/internal
vapi/crypto/simulator
vapi/esx
vapi/esx/settings
vapi/esx/settings/clusters
vapi/esx/settings/depots
vapi/esx/settings/simulator
vapi/internal
vapi/library
vapi/library/finder
vapi/namespace
vapi/namespace/internal
vapi/namespace/simulator
vapi/rest
vapi/simulator
vapi/tags
vapi/vcenter
vapi/vcenter/consumptiondomains
vapi/vcenter/consumptiondomains/associations
vapi/vcenter/consumptiondomains/simulator
vapi/vcenter/consumptiondomains/zones
vapi/vm
vapi/vm/dataset
vapi/vm/internal
vapi/vm/simulator
view
vim25Package vim25 provides a minimal client implementation to use with other packages in the vim25 tree.
vim25/debug
vim25/jsonPackage json implements encoding and decoding of JSON as defined in RFC 7159.
vim25/methods
vim25/mo
vim25/progress
vim25/soap
vim25/types
vim25/xmlPackage xml implements a simple XML 1.0 parser that understands XML name spaces.
vmdk
vsan
vsan/methods
vsan/mo
vsan/simulator
vsan/types
vsan/vsanfs
vsan/vsanfs/types
vslmPackage vslm provides access to the vSphere Storage Lifecycle Management service.
vslm/methods
vslm/simulator
vslm/types
Version
v0.48.1 (latest)
Published
Feb 11, 2025
Platform
linux/amd64
Imports
7 packages
Last checked
2 months ago

Tools for package owners.