vsphere

package
v0.0.0-...-2f24cf4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	// Initialize all necessary objects to send API calls to vSphere
	Init(ctx context.Context, url, username, password, clusterName string, datacenterName string, insecure bool) error

	// RetrieveCounters retrieves vSphere cluster metric list that are available for user
	RetrieveCounters(ctx context.Context) ([]types.PerfCounterInfo, error)

	// Get all datastores for cluster
	RetrieveDatastores(ctx context.Context) ([]mo.Datastore, error)

	// Get all hosts for cluster
	RetrieveHosts(ctx context.Context) ([]mo.HostSystem, error)

	// Find all VMs for given host
	RetrieveVMs(ctx context.Context, host mo.HostSystem) ([]mo.VirtualMachine, error)

	// Call performance query to retrieve perf data
	PerfQuery(ctx context.Context, querySpecs []types.PerfQuerySpec) (*types.QueryPerfResponse, error)

	// Clear API retrieve cache
	ClearCache()
}

API - vSphere API interface for testing purposes

type Collector

type Collector struct {
	GovmomiResources *govmomiClient
}

Collector implements plugin interface GovomiResources contains methods to retrieve data from vSphereAPI

func New

func New(isTest bool) *Collector

New returns instance of VsphereCollector

func (*Collector) CollectMetrics

func (c *Collector) CollectMetrics(mts []plugin.Metric) ([]plugin.Metric, error)

CollectMetrics collects requested metrics

func (*Collector) GetConfigPolicy

func (c *Collector) GetConfigPolicy() (plugin.ConfigPolicy, error)

GetConfigPolicy retrieves config for the plugin

func (*Collector) GetMetricTypes

func (c *Collector) GetMetricTypes(cfg plugin.Config) ([]plugin.Metric, error)

GetMetricTypes returns available metrics

Jump to

Keyboard shortcuts

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