viapi

package
v0.0.0-...-26687db Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
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

func IsAnyNotFoundError(err error) bool

IsAnyNotFoundError checks to see if the fault is of any not found error type that we track.

func IsManagedObjectNotFoundError

func IsManagedObjectNotFoundError(err error) bool

IsManagedObjectNotFoundError checks an error to see if it's of the ManagedObjectNotFound type.

func IsResourceInUseError

func IsResourceInUseError(err error) bool

IsResourceInUseError checks an error to see if it's of the ResourceInUse type.

func RenameObject

func RenameObject(client *govmomi.Client, ref types.ManagedObjectReference, new string) error

RenameObject renames a MO and tracks the task to make sure it completes.

func ValidateVirtualCenter

func ValidateVirtualCenter(c *govmomi.Client) error

ValidateVirtualCenter ensures that the client is connected to vCenter.

func VimValidateVirtualCenter

func VimValidateVirtualCenter(c *vim25.Client) error

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 ManagedObject

type ManagedObject interface {
	Reference() types.ManagedObjectReference
}

ManagedObject allows for working generically with managed objects.

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) AtLeast

func (v VSphereVersion) AtLeast(other VSphereVersion) bool

AtLeast returns true if this version's product is equal or greater than the one required

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.

Jump to

Keyboard shortcuts

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