computeresource

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2018 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseProperties

func BaseProperties(obj BaseComputeResource) (*mo.ComputeResource, error)

BaseProperties returns the base-level ComputeResource managed object for a BaseComputeResource, an interface that any base-level ComputeResource and derivative object implements.

Note that this does not return any cluster-level attributes.

func BasePropertiesFromReference

func BasePropertiesFromReference(client *govmomi.Client, ref types.ManagedObjectReference) (*mo.ComputeResource, error)

BasePropertiesFromReference combines BaseFromReference and BaseProperties to get a base-level ComputeResource managed object for a specific managed object reference.

func ClusterFromID

func ClusterFromID(client *govmomi.Client, id string) (*object.ClusterComputeResource, error)

ClusterFromID returns a ClusterComputeResource, a subclass of ComputeResource that is used for clusters.

func DefaultDevicesFromReference

func DefaultDevicesFromReference(client *govmomi.Client, ref types.ManagedObjectReference, guest string) (object.VirtualDeviceList, error)

DefaultDevicesFromReference fetches the default virtual device list for a specific compute resource from a supplied managed object reference.

func OSFamily

func OSFamily(client *govmomi.Client, ref types.ManagedObjectReference, guest string) (string, error)

OSFamily uses the compute resource's environment browser to get the OS family for a specific guest ID.

func StandaloneFromID

func StandaloneFromID(client *govmomi.Client, id string) (*object.ComputeResource, error)

StandaloneFromID locates a ComputeResource by its managed object reference ID.

Note this is for base level ComputeResource objects only, and should only be used for standalone hosts. If you are looking for a cluster, use ClusterFromID.

Types

type BaseComputeResource

type BaseComputeResource interface {
	Datastores(context.Context) ([]*object.Datastore, error)
	Destroy(context.Context) (*object.Task, error)
	Hosts(context.Context) ([]*object.HostSystem, error)
	Reconfigure(context.Context, types.BaseComputeResourceConfigSpec, bool) (*object.Task, error)
	ResourcePool(context.Context) (*object.ResourcePool, error)

	Name() string
	Properties(context.Context, types.ManagedObjectReference, []string, interface{}) error
	Reference() types.ManagedObjectReference
}

BaseComputeResource is an interface that ComputeResource and any derivative types will implement on part of having all of the methods available to ComputeResource. It also contains the Properties method from the common-level object method set.

Its use is mainly to facilitate common functionality between the two in helpers.

func BaseFromPath

func BaseFromPath(client *govmomi.Client, path string) (BaseComputeResource, error)

BaseFromPath returns a BaseComputeResource for a given path.

func BaseFromReference

func BaseFromReference(client *govmomi.Client, ref types.ManagedObjectReference) (BaseComputeResource, error)

BaseFromReference returns a BaseComputeResource for a given managed object reference.

Jump to

Keyboard shortcuts

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