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 ¶
- type Client
- func NewClient(ctx context.Context, u *url.URL, insecure bool) (*Client, error)
- func (c *Client) IsVC() bool
- func (c *Client) Login(ctx context.Context, u *url.Userinfo) error
- func (c *Client) Logout(ctx context.Context) error
- func (c *Client) PropertyCollector() *property.Collector
- func (c *Client) Retrieve(ctx context.Context, objs []types.ManagedObjectReference, p []string, dst interface{}) error
- func (c *Client) RetrieveOne(ctx context.Context, obj types.ManagedObjectReference, p []string, dst interface{}) error
- func (c *Client) Wait(ctx context.Context, obj types.ManagedObjectReference, ps []string, f func([]types.PropertyChange) bool) error
Types ¶
type Client ¶
func NewClient ¶
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 ¶
IsVC returns true if we are connected to a vCenter
func (*Client) Login ¶
Login dispatches to the SessionManager.
func (*Client) Logout ¶
Logout dispatches to the SessionManager.
func (*Client) PropertyCollector ¶
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 ¶
func (c *Client) Wait(ctx context.Context, obj types.ManagedObjectReference, ps []string, f func([]types.PropertyChange) bool) error
Wait dispatches to property.Wait.
Source Files ¶
Directories ¶
- Version
- v0.48.1 (latest)
- Published
- Feb 11, 2025
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 2 months ago –
Tools for package owners.