add code to filter on entity
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-05-23 11:55:37 +10:00
parent 8f032ebb71
commit 658e386560

View File

@@ -47,6 +47,12 @@ func getEvents(eventTypes []string, entities []types.ManagedObjectReference, beg
BeginTime: types.NewTime(now.Add(begin * -1)),
},
}
if len(entities) > 0 {
fmt.Printf("getEvents setting entity '%v' to filter\n", entities[0])
filter.Entity = &types.EventFilterSpecByEntity{
Entity: entities[0],
}
}
if end != 0 {
filter.Time.EndTime = types.NewTime(now.Add(end * -1))
}