Documentation
¶
Index ¶
- func TestConnection(p common.Poller) (err error)
- type ExternalPoller
- type InternalCollector
- func (i *InternalCollector) GetActivePollerURLs() (urls []string)
- func (i *InternalCollector) PollPollerById(id string) (errs []error)
- func (i *InternalCollector) RefreshPollers()
- func (i *InternalCollector) Run()
- func (i *InternalCollector) SetBackend(backend db.Backend)
- func (i *InternalCollector) StopPollersByURL(urls []string)
- type InternalPoller
- type Poller
- func (p *Poller) Configure(c common.Poller)
- func (p *Poller) Connect(ctx *context.Context) (err error)
- func (p *Poller) GetClusters() (clList []common.Cluster, err error)
- func (p *Poller) GetDVS() (list []common.VSwitch, err error)
- func (p *Poller) GetDVSPortgroups() (list []common.Portgroup, err error)
- func (p *Poller) GetDatacenters() (dcList []common.Datacenter, err error)
- func (p *Poller) GetDatastores() (list []common.Datastore, err error)
- func (p *Poller) GetEsxi() (esxiList []common.Esxi, pNics []common.PNic, vSwitches []common.VSwitch, ...)
- func (p *Poller) GetFolders() (list []common.Folder, err error)
- func (p *Poller) GetPollResults() (r pollResults, errors []error)
- func (p *Poller) GetResourcepools() (list []common.ResourcePool, err error)
- func (p *Poller) GetVcenter() (vcenter common.VCenter, err error)
- func (p *Poller) GetVirtualMachines() (VMs []common.VirtualMachine, vDisks []common.VDisk, vNICs []common.VNic, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestConnection ¶
TestConnection will test if we can successfully log into the provided vcenter server
Types ¶
type ExternalPoller ¶
type ExternalPoller struct { Poller // contains filtered or unexported fields }
ExternalPoller extends Poller with functionality relevant to sending results to a vSummary API server over http(s).
func GetExternalPollersFromConfig ¶
func GetExternalPollersFromConfig() (externalPollers []*ExternalPoller)
GetExternalPollersFromConfig returns preconfigured list of ExternalPoller(s) found in config
func NewExternalPoller ¶
func NewExternalPoller(c common.Poller) (e *ExternalPoller)
NewExternalPoller returns a ExternalPoller based from a common.Poller
func (*ExternalPoller) Daemonize ¶
func (e *ExternalPoller) Daemonize()
Daemonize is a blocking loop which continues to PollThenSend indefinitely
func (*ExternalPoller) PollThenSend ¶
func (e *ExternalPoller) PollThenSend() (errs []error)
PollThenSend will poll all endpoints then send results to vSummary API server
func (*ExternalPoller) SendPollResults ¶
func (e *ExternalPoller) SendPollResults(r pollResults) (err []error)
SendPollResults will attempt to send the polling results to the vSummary API server
func (*ExternalPoller) SetApiUrl ¶
func (e *ExternalPoller) SetApiUrl(u string) (err error)
SetEndpoint sets the vSummary API server url unless it's invalid
type InternalCollector ¶
type InternalCollector struct { ActivePollers []*InternalPoller // contains filtered or unexported fields }
internal poller that contains a list of pollers as well as a backend db
var BuiltInCollector InternalCollector
BuiltInCollector is a package-wide instance of InternalCollector
func NewEmptyInternalCollector ¶
func NewEmptyInternalCollector() *InternalCollector
NewEmptyInternalCollector returns an empty InternalCollector
func (*InternalCollector) GetActivePollerURLs ¶
func (i *InternalCollector) GetActivePollerURLs() (urls []string)
GetActivePollerURLs returns a list of active pollers by URL
func (*InternalCollector) PollPollerById ¶
func (i *InternalCollector) PollPollerById(id string) (errs []error)
PollPollerById executes a poll to a matching internal poller by id
func (*InternalCollector) RefreshPollers ¶
func (i *InternalCollector) RefreshPollers()
RefreshPollers gets a list of pollers from backend database then populates internalPoller list of ActivePollers with it.
func (*InternalCollector) Run ¶
func (i *InternalCollector) Run()
Run is a blocking loop. This should only be executed once. refreshing of the pollers is also handled in this function.
func (*InternalCollector) SetBackend ¶
func (i *InternalCollector) SetBackend(backend db.Backend)
SetBackend allows InternalCollector to connect to backend database
func (*InternalCollector) StopPollersByURL ¶
func (i *InternalCollector) StopPollersByURL(urls []string)
StopPollersByURL will stop active pollers that match the list of URLs
type InternalPoller ¶
type InternalPoller struct { Poller // contains filtered or unexported fields }
InternalPoller extends Poller with functionality relevant to storing results to a backend directly (not over the vSummary API server).
func NewEmptyInternalPoller ¶
func NewEmptyInternalPoller() *InternalPoller
NewInternalPoller returns a empty InternalPoller
func NewInternalPoller ¶
func NewInternalPoller(c common.Poller) (i *InternalPoller)
NewInternalPoller returns a InternalPoller based from a common.Poller
func (*InternalPoller) Daemonize ¶
func (i *InternalPoller) Daemonize()
Daemonize is a blocking loop which continues to PollThenStore until the channel is closed or poller is marked as disabled.
func (*InternalPoller) PollThenStore ¶
func (i *InternalPoller) PollThenStore() (errs []error)
PollThenStore will poll all endpoints then store results to backend db
func (*InternalPoller) SetBackend ¶
func (i *InternalPoller) SetBackend(backend db.Backend)
SetBackend allows internalPoller to connect to backend database
func (*InternalPoller) StopPolling ¶
func (i *InternalPoller) StopPolling()
StopPolling sends the signal to stop the loop in Deamonize
func (*InternalPoller) StorePollResults ¶
func (i *InternalPoller) StorePollResults(r pollResults) (err []error)
StorePollResults will send results directly to backend db and not to vsummary API server
type Poller ¶
Poller can poll a single endpoint
func (*Poller) GetDVSPortgroups ¶
func (*Poller) GetDatacenters ¶
func (p *Poller) GetDatacenters() (dcList []common.Datacenter, err error)
func (*Poller) GetDatastores ¶
func (*Poller) GetPollResults ¶
GetPollResults will return pollResults along with all errors encountered during the polling
func (*Poller) GetResourcepools ¶
func (p *Poller) GetResourcepools() (list []common.ResourcePool, err error)
func (*Poller) GetVirtualMachines ¶
func (p *Poller) GetVirtualMachines() (VMs []common.VirtualMachine, vDisks []common.VDisk, vNICs []common.VNic, err error)
this function returns VMs vDisks vNICs since they are all part of VirtualMachine managedObject