govmomi
packagemoduleThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
README¶
govmomi
A Go library for interacting with VMware vSphere APIs (ESXi and/or vCenter Server).
In addition to the vSphere API client, this repository includes:
Compatibility
vSphere 7.0 and higher.
Documentation
The APIs exposed by this library closely follow the API described in theVMware vSphere API Reference Documentation. Refer to the documentation to become familiar with the upstream API.
The code in thegovmomi
package is a wrapper for the code that is generated from the vSphere API description. It primarily provides convenience functions for working with the vSphere API. Seegodoc.org for documentation.
Installation
Binaries and Docker Images forgovc
andvcsim
Installation instructions, released binaries, and Docker images are documented in the respective README files ofgovc
andvcsim
.
Discussion
Collaborate with the community using GitHubdiscussions and GitHubissues.
Status
Changes to the API are subject tosemantic versioning.
Refer to theCHANGELOG for version to version changes.
Related Projects
License
govmomi is available under theApache 2 License.
Name
Pronounced:go·v·mom·e
Follows pyvmomi and rbvmomi: language prefix + the vSphere acronym "VM Object Management Infrastructure".
Documentation¶
Overview¶
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 allavailable methods. The vim25 package is entirely independent of the otherpackages in the govmomi tree -- it has no dependencies on its peers.
The vim25 package itself contains a client structure that ispassed around throughout the entire library. It abstracts a session and itsimmutable state. See the vim25 package for more information.
Package session¶
The session package contains an abstraction for the session manager that allowsa 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. Theconstructors of these objects all take a *vim25.Client, which they pass alongto derived objects, if applicable.
Package govc¶
The govc package contains the govc CLI. The code in this tree is not intendedto be used as a library. Any functionality that govc contains that _could_ beused 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 forthe respective subsystems. They are typically not needed in normal workflows soare kept outside the object package.
Index¶
- type Client
- 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, ...) error
- func (c *Client) RetrieveOne(ctx context.Context, obj types.ManagedObjectReference, p []string, ...) error
- func (c *Client) Wait(ctx context.Context, obj types.ManagedObjectReference, ps []string, ...) error
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typeClient¶
funcNewClient¶
NewClient creates a new client from a URL. The client authenticates with theserver with username/password before returning if the URL contains user information.
func (*Client)PropertyCollector¶
PropertyCollector returns the session's default property collector.
func (*Client)Retrieve¶
func (c *Client) Retrieve(ctxcontext.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(ctxcontext.Context, objtypes.ManagedObjectReference, p []string, dst interface{})error
RetrieveOne dispatches to the Retrieve function on the default property collector.
Directories¶
Path | Synopsis |
---|---|
Package crypto provides access to CryptoManagerKmip methods used to manage cryptographic key providers. | Package crypto provides access to CryptoManagerKmip methods used to manage cryptographic key providers. |
Package find implements inventory listing and searching. | Package find implements inventory listing and searching. |
govcmodule | |
Package ovf provides functionality to unmarshal and inspect the structure of an OVF file. | Package ovf provides functionality to unmarshal and inspect the structure of an OVF file. |
Package simulator is a mock framework for the vSphere API. | Package simulator is a mock framework for the vSphere API. |
esx Package esx contains SOAP responses from an ESX server, captured using `govc ... | Package esx contains SOAP responses from an ESX server, captured using `govc ... |
vpx Package vpx contains SOAP responses from a vCenter server, captured using `govc ... | Package vpx contains SOAP responses from a vCenter server, captured using `govc ... |
sms | |
Package test contains functions that implement common functionality between tests. | Package test contains functions that implement common functionality between tests. |
Package vapi provides access to vSphere Automation APIs that are not available in the SOAP API, such as tagging and the content library. | Package vapi provides access to vSphere Automation APIs that are not available in the SOAP API, such as tagging and the content library. |
crypto Package vapi/crypto provides access to the Crypto Manager REST APIs that are not available in the SOAP API. | Package vapi/crypto provides access to the Crypto Manager REST APIs that are not available in the SOAP API. |
vcsimmodule | |
Package vim25 provides a minimal client implementation to use with other packages in the vim25 tree. | Package vim25 provides a minimal client implementation to use with other packages in the vim25 tree. |
json Package json implements encoding and decoding of JSON as defined in RFC 7159. | Package json implements encoding and decoding of JSON as defined in RFC 7159. |
xml Package xml implements a simple XML 1.0 parser that understands XML name spaces. | Package xml implements a simple XML 1.0 parser that understands XML name spaces. |
Package vslm provides access to the vSphere Storage Lifecycle Management service. | Package vslm provides access to the vSphere Storage Lifecycle Management service. |