Documentation ¶
Index ¶
- type Cluster
- func (dev *Cluster) FQDN() string
- func (dev *Cluster) Facts() map[string]string
- func (dev *Cluster) IsPoweredOn() bool
- func (cluster *Cluster) Kind() ResourceKind
- func (dev *Cluster) LatestError() error
- func (dev *Cluster) MOID() string
- func (dev *Cluster) Name() string
- func (dev *Cluster) Source() string
- type Hierarchy
- func (h *Hierarchy) DeviceName(moid string) (string, bool)
- func (h *Hierarchy) ParentClusterName(child mo.Reference) string
- func (h *Hierarchy) ParentDCName(child mo.Reference) string
- func (h *Hierarchy) ParentHostName(child mo.Reference) string
- func (h *Hierarchy) Refresh(ctx context.Context, clusters []*object.ClusterComputeResource, ...) error
- type HostSystem
- func (dev *HostSystem) FQDN() string
- func (dev *HostSystem) Facts() map[string]string
- func (dev *HostSystem) IsPoweredOn() bool
- func (host *HostSystem) Kind() ResourceKind
- func (dev *HostSystem) LatestError() error
- func (dev *HostSystem) MOID() string
- func (dev *HostSystem) Name() string
- func (dev *HostSystem) Source() string
- type Manager
- func (m *Manager) Devices(ctx context.Context, maxAge time.Duration) []bleemeoTypes.VSphereDevice
- func (m *Manager) DiagnosticVSphere(ctx context.Context, archive types.ArchiveWriter, ...) error
- func (m *Manager) EndpointsInError() map[string]bool
- func (m *Manager) FindDevice(ctx context.Context, vSphereHost, moid string) bleemeoTypes.VSphereDevice
- func (m *Manager) LastChange(ctx context.Context) time.Time
- func (m *Manager) RegisterGatherers(ctx context.Context, vSphereCfgs []config.VSphere, ...)
- type ResourceKind
- type VirtualMachine
- func (dev *VirtualMachine) FQDN() string
- func (dev *VirtualMachine) Facts() map[string]string
- func (dev *VirtualMachine) IsPoweredOn() bool
- func (vm *VirtualMachine) Kind() ResourceKind
- func (dev *VirtualMachine) LatestError() error
- func (dev *VirtualMachine) MOID() string
- func (dev *VirtualMachine) Name() string
- func (dev *VirtualMachine) Source() string
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) IsPoweredOn ¶
func (dev *Cluster) IsPoweredOn() bool
func (*Cluster) Kind ¶
func (cluster *Cluster) Kind() ResourceKind
func (*Cluster) LatestError ¶
func (dev *Cluster) LatestError() error
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) ParentClusterName ¶
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) IsPoweredOn ¶
func (dev *HostSystem) IsPoweredOn() bool
func (*HostSystem) Kind ¶
func (host *HostSystem) Kind() ResourceKind
func (*HostSystem) LatestError ¶
func (dev *HostSystem) LatestError() error
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 ¶
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 ¶
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) IsPoweredOn ¶
func (dev *VirtualMachine) IsPoweredOn() bool
func (*VirtualMachine) Kind ¶
func (vm *VirtualMachine) Kind() ResourceKind
func (*VirtualMachine) LatestError ¶
func (dev *VirtualMachine) LatestError() error