vsphere

package
v0.0.0-...-b19e04c Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	// contains filtered or unexported fields
}

func (*Cluster) FQDN

func (dev *Cluster) FQDN() string

func (*Cluster) Facts

func (dev *Cluster) Facts() map[string]string

func (*Cluster) IsPoweredOn

func (dev *Cluster) IsPoweredOn() bool

func (*Cluster) Kind

func (cluster *Cluster) Kind() ResourceKind

func (*Cluster) LatestError

func (dev *Cluster) LatestError() error

func (*Cluster) MOID

func (dev *Cluster) MOID() string

func (*Cluster) Name

func (dev *Cluster) Name() string

func (*Cluster) Source

func (dev *Cluster) Source() string

type Hierarchy

type Hierarchy struct {
	// contains filtered or unexported fields
}

Hierarchy represents the structure of a vSphere in a way that suits us. It drops the folder levels to get a hierarchy with a shape like: VM -> Host -> Cluster -> Datacenter

It also indexes the device names of VMs, hosts, resource pools, clusters and datacenters.

func NewHierarchy

func NewHierarchy() *Hierarchy

func (*Hierarchy) DeviceName

func (h *Hierarchy) DeviceName(moid string) (string, bool)

func (*Hierarchy) ParentClusterName

func (h *Hierarchy) ParentClusterName(child mo.Reference) string

func (*Hierarchy) ParentDCName

func (h *Hierarchy) ParentDCName(child mo.Reference) string

func (*Hierarchy) ParentHostName

func (h *Hierarchy) ParentHostName(child mo.Reference) string

func (*Hierarchy) Refresh

func (h *Hierarchy) Refresh(ctx context.Context, clusters []*object.ClusterComputeResource, resourcePools []*object.ResourcePool, hosts []*object.HostSystem, vms []*object.VirtualMachine, vmPropsCache *propsCache[vmLightProps]) error

type HostSystem

type HostSystem struct {
	// contains filtered or unexported fields
}

func (*HostSystem) FQDN

func (dev *HostSystem) FQDN() string

func (*HostSystem) Facts

func (dev *HostSystem) Facts() map[string]string

func (*HostSystem) IsPoweredOn

func (dev *HostSystem) IsPoweredOn() bool

func (*HostSystem) Kind

func (host *HostSystem) Kind() ResourceKind

func (*HostSystem) LatestError

func (dev *HostSystem) LatestError() error

func (*HostSystem) MOID

func (dev *HostSystem) MOID() string

func (*HostSystem) Name

func (dev *HostSystem) Name() string

func (*HostSystem) Source

func (dev *HostSystem) Source() string

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager() *Manager

func (*Manager) Devices

func (m *Manager) Devices(ctx context.Context, maxAge time.Duration) []bleemeoTypes.VSphereDevice

Devices returns the list of all the vSphere devices that have been found across all the vSphere endpoints of the Manager.

func (*Manager) DiagnosticVSphere

func (m *Manager) DiagnosticVSphere(ctx context.Context, archive types.ArchiveWriter, getAssociations func(ctx context.Context, devices []bleemeoTypes.VSphereDevice) (map[string]string, error)) error

func (*Manager) EndpointsInError

func (m *Manager) EndpointsInError() map[string]bool

EndpointsInError returns the addresses of all the endpoints which couldn't be created or have errors.

func (*Manager) FindDevice

func (m *Manager) FindDevice(ctx context.Context, vSphereHost, moid string) bleemeoTypes.VSphereDevice

FindDevice returns the device from the given vSphere that has the given MOID. If the MOID happens to be that of a datastore, the device returned will be the cluster the datastore belongs to, if any. If no matching device is found, it returns nil.

func (*Manager) LastChange

func (m *Manager) LastChange(ctx context.Context) time.Time

LastChange returns the last time a change occurred in the vSphere device list, and actualize it if it has not been for 2 minutes.

func (*Manager) RegisterGatherers

func (m *Manager) RegisterGatherers(ctx context.Context, vSphereCfgs []config.VSphere, registerGatherer func(opt registry.RegistrationOption, gatherer prometheus.Gatherer) (int, error), state bleemeoTypes.State, factProvider bleemeoTypes.FactProvider)

type ResourceKind

type ResourceKind = string
const (
	KindCluster   ResourceKind = "ClusterComputeResource"
	KindDatastore ResourceKind = "Datastore"
	KindHost      ResourceKind = "HostSystem"
	KindVM        ResourceKind = "VirtualMachine"
)

type VirtualMachine

type VirtualMachine struct {
	// contains filtered or unexported fields
}

func (*VirtualMachine) FQDN

func (dev *VirtualMachine) FQDN() string

func (*VirtualMachine) Facts

func (dev *VirtualMachine) Facts() map[string]string

func (*VirtualMachine) IsPoweredOn

func (dev *VirtualMachine) IsPoweredOn() bool

func (*VirtualMachine) Kind

func (vm *VirtualMachine) Kind() ResourceKind

func (*VirtualMachine) LatestError

func (dev *VirtualMachine) LatestError() error

func (*VirtualMachine) MOID

func (dev *VirtualMachine) MOID() string

func (*VirtualMachine) Name

func (dev *VirtualMachine) Name() string

func (*VirtualMachine) Source

func (dev *VirtualMachine) Source() string

Jump to

Keyboard shortcuts

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