event

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHistoryCollector

func NewHistoryCollector(ctx context.Context, mgr *event.Manager, entity types.ManagedObjectReference, filters ...Filter) (*event.HistoryCollector, error)

NewHistoryCollector creates a new event collector for the specified entity. By default, events for the entity and all (indirect) children (if any) are retrieved and event collection starts at "now".

func ToCloudEvent added in v0.2.4

func ToCloudEvent(source string, be types.BaseEvent, extensions map[string]string) (ce.Event, error)

ToCloudEvent transforms the vSphere event into a CloudEvent. The full vSphere event is JSON-encoded and available in the data field. Extensions sets the map keys and values as CloudEvent extensions. Optional, i.e. can be nil. If specified, extensions must contain valid CloudEvent extensions.

Types

type Details

type Details struct {
	Class string
	Type  string
}

Details contains the type and class of an event received from vCenter supported event classes: event, eventex, extendedevent.

Class to type mapping: event: retrieved from event Class, e.g.VmPoweredOnEvent eventex: retrieved from EventTypeId extendedevent: retrieved from EventTypeId

func GetDetails

func GetDetails(event types.BaseEvent) Details

GetDetails retrieves the underlying vSphere event class and name for the given BaseEvent, e.g. VmPoweredOnEvent (event) or com.vmware.applmgmt.backup.job.failed.event (extendedevent)

type Filter

type Filter func(f *types.EventFilterSpec) error

Filter is a filter applied to the event filter spec. See vSphere API documentation for Details on the specific fields.

func WithEventTypeID

func WithEventTypeID(ids []string) Filter

WithEventTypeID limits the set of collected events to those specified types

func WithMaxCount

func WithMaxCount(count uint32) Filter

WithMaxCount specifies the maximum number of returned events

func WithRecursion

WithRecursion specifies whether events should be received only for the specified object, including its direct children or all children

func WithTime

func WithTime(time *types.EventFilterSpecByTime) Filter

WithTime filters events based on time

func WithUsername

func WithUsername(u *types.EventFilterSpecByUsername) Filter

WithUsername filters events based on username

Jump to

Keyboard shortcuts

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