VMware {code} Community
dmitrif
Enthusiast
Enthusiast

Event Task and Target

Hi folks,

The "Events" tab of the VI Client, columns "Task" and "Target".

Does anybody know what they are and where do I find them on the Event data object, please?

Thanks in advance.

D.
0 Kudos
3 Replies
admin
Immortal
Immortal

The Events and Tasks tab allows one to view the events or the tasks ( commands or operations) that have been invoked. The Virtual Infrastructure SDK creates a task for each command that has been invoked. The Target column represents the entity to which the invoked operation applies. e.g. If there is a vm abc which has been powered on, then the task column will have Powered on Vm Task and the Target column will display the name of the vm i.e. abc.

This information will not be available using EventData object but rather on using Task Data Object. You can get a mor to the Task Manager. The recent tasks can be viewed as it's properties. TaskManager has a property recentTask, which returns a array of task managed objects. Each Task mor has a property info. This TaskInfo Data Object, has all properties, entityName which relates to the Target in the ui, and the name property which describes the operation that created the task.

For seeing all tasks of the current client session, you may use create a createCollectorForTasks, using the mor to the TaskManager. Creates a task history collector, as a specialized history collector that provides TaskInfo objects. Please refer the VI SDK Reference Guide and Managed Object Task Manager for more details.

0 Kudos
dmitrif
Enthusiast
Enthusiast

You lost me in the middle of your third sentence :).

Could you please give me an example when an event would have "task" and "target" columns assigned.

Also please do not assume that I'm a beginner.

D.
0 Kudos
dmitrif
Enthusiast
Enthusiast

I think I've figured this out.

If an event is of the type "TaskEvent" then these two columns get assigned from the "TaskInfo" data object instance.

I suppose entity.Value is looked at as the "target", and task.Value as the "task".

I'm marking this as answered unless somebody tells me I'm wrong.

D.
0 Kudos