You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In certain cases the ManagedObjectReference alone might not be useful,
e.g. when an object is deleted.
This commit adds a new field `objectName` to the outbound JSON data
which serves as additional metadata for the receiver.
Note: ObjectName for certain vSphere objects, e.g. virtual machines, is
only unique within a folder (if applicable) as per the description
[here](https://docs.vmware.com/en/VMware-vSphere/6.7/com.vmware.vsphere.vm_admin.doc/GUID-76E73C62-A973-4839-BB67-AC1817908E6D.html).
This added field should be treated as metadata and not for requests
against vCenter (use `ManagedObjectReference` instead).
Signed-off-by: Michael Gasch <[email protected]>
Copy file name to clipboardExpand all lines: pkg/events/events.go
+12-3Lines changed: 12 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -22,12 +22,14 @@ import (
22
22
// OutboundEvent is the JSON object sent to subscribed functions
23
23
// If the ManagedObjectReference for an event cannot be retrieved, it will be nil and thus not marshaled into the JSON OutboundEvent
24
24
// It's the receivers responsibility to check whether managedObjectReference key is present in the JSON message payload
25
+
// ObjectName is the name of the object as it appears in vCenter - uniqueness is only guaranteed at the folder level, if applicable, where this object resides
// Get the ManagedObjectReference by converting the event into a concrete event
105
107
// If we don't find a MoRef in the event, *ref will be nil and not marshaled in the OutboundEvent making it easy for the subscribed function to validate the JSON payload
0 commit comments