VMware Cloud Community
ullbergm
Enthusiast
Enthusiast
Jump to solution

Get-View eventManager equivalent

Anyone know what the vCO equivalent of "Get-View eventManager" would be?

Using Onyx it looks like it translates to:

// ------- RetrieveProperties -------

var specSet = System.getModule("com.vmware.onyx").array(VcPropertyFilterSpec, 1);
specSet[0] = new VcPropertyFilterSpec();
specSet[0].propSet = System.getModule("com.vmware.onyx").array(VcPropertySpec, 1);
specSet[0].propSet[0] = new VcPropertySpec();
specSet[0].propSet[0].type = "EventManager";
specSet[0].propSet[0].all = true;
specSet[0].objectSet = System.getModule("com.vmware.onyx").array(VcObjectSpec, 1);
specSet[0].objectSet[0] = new VcObjectSpec();
specSet[0].objectSet[0].obj = Server.findForType("VC:EventManager", managedObject.vimHost.id + "/EventManager");;

managedObject.retrieveProperties(specSet);  // PropertyCollector

But I'm not sure which object "managedObject" refers to in that last line.

Thanks,

Magnus

Check out my orchestration blog here: http://ullberg.us/orchestrate/
Reply
0 Kudos
1 Solution

Accepted Solutions
mslavov
VMware Employee
VMware Employee
Jump to solution

Hi Magnus,

Actually Onyx shows you the hard way of getting it.

The easiest way to get the eventManager is through the "VC:SdkConnection" object, there is the property of the object called "eventManager". The "VC:SdkConnection" type can be specified as an input parameter of a workflow, or you can get a reference to an object of this type by accessing the sdkConnection property of any vCenter managed object (like VirtualMachine, HostSystem, etc.)

Thanks,

Milko

View solution in original post

Reply
0 Kudos
2 Replies
mslavov
VMware Employee
VMware Employee
Jump to solution

Hi Magnus,

Actually Onyx shows you the hard way of getting it.

The easiest way to get the eventManager is through the "VC:SdkConnection" object, there is the property of the object called "eventManager". The "VC:SdkConnection" type can be specified as an input parameter of a workflow, or you can get a reference to an object of this type by accessing the sdkConnection property of any vCenter managed object (like VirtualMachine, HostSystem, etc.)

Thanks,

Milko

Reply
0 Kudos
ullbergm
Enthusiast
Enthusiast
Jump to solution

Thanks, that is much easier Smiley Happy

Check out my orchestration blog here: http://ullberg.us/orchestrate/
Reply
0 Kudos