Documentation ¶
Index ¶
- Constants
- func IsAnyNotFoundError(err error) bool
- func IsManagedObjectNotFoundError(err error) bool
- func IsResourceInUseError(err error) bool
- func RenameObject(client *govmomi.Client, ref types.ManagedObjectReference, new string) error
- func ValidateVirtualCenter(c *govmomi.Client) error
- func VimValidateVirtualCenter(c *vim25.Client) error
- type VSphereVersion
Constants ¶
const ErrVirtualCenterOnly = "this operation is only supported on vCenter"
ErrVirtualCenterOnly is the error message that validateVirtualCenter returns.
Variables ¶
This section is empty.
Functions ¶
func IsAnyNotFoundError ¶
IsAnyNotFoundError checks to see if the fault is of any not found error type that we track.
func IsManagedObjectNotFoundError ¶
IsManagedObjectNotFoundError checks an error to see if it's of the ManagedObjectNotFound type.
func IsResourceInUseError ¶
IsResourceInUseError checks an error to see if it's of the ResourceInUse type.
func RenameObject ¶
RenameObject renames a MO and tracks the task to make sure it completes.
func ValidateVirtualCenter ¶
ValidateVirtualCenter ensures that the client is connected to vCenter.
func VimValidateVirtualCenter ¶ added in v1.5.0
VimValidateVirtualCenter ensures that the client is connected to vCenter.
This is a lower-level method that does not take the wrapped client from the higher-level govmomi object, and can be used to facilitate validation when it's not available.
Types ¶
type VSphereVersion ¶
type VSphereVersion struct { // The product name. Example: "VMware vCenter Server", or "VMware ESXi". Product string // The major version. Example: If "6.5.1" is the full version, the major // version is "6". Major int // The minor version. Example: If "6.5.1" is the full version, the minor // version is "5". Minor int // The patch version. Example: If "6.5.1" is the full version, the patch // version is "1". Patch int // The build number. This is usually a lengthy integer. This number should // not be used to compare versions on its own. Build int }
VSphereVersion represents a version number of a ESXi/vCenter server instance.
func ParseVersionFromClient ¶
func ParseVersionFromClient(client *govmomi.Client) VSphereVersion
ParseVersionFromClient returns a populated VSphereVersion from a client connection.
func (VSphereVersion) Equal ¶
func (v VSphereVersion) Equal(other VSphereVersion) bool
Equal returns true if the version is equal to the supplied version.
func (VSphereVersion) Newer ¶
func (v VSphereVersion) Newer(other VSphereVersion) bool
Newer returns true if this version's product is the same, and composite of the version and build numbers, are newer than the supplied version's information.
func (VSphereVersion) Older ¶
func (v VSphereVersion) Older(other VSphereVersion) bool
Older returns true if this version's product is the same, and composite of the version and build numbers, are older than the supplied version's information.
func (VSphereVersion) ProductEqual ¶
func (v VSphereVersion) ProductEqual(other VSphereVersion) bool
ProductEqual returns true if this version's product name is the same as the supplied version's name.
func (VSphereVersion) String ¶
func (v VSphereVersion) String() string
String implements stringer for VSphereVersion.