Gathering Data with a
TaskManager Interface
TaskManager
is a service interface that you can
also use for accessing and manipulating
Task
objects. This approach uses a
PropertyCollector
that includes
the
recentTask
property of the
TaskManager
managed object that
corresponds to the Recent Tasks pane at the bottom of the vSphere client User
Interface.
You can use the following
TaskManager
properties in your
client application.
- description–TaskDescriptionobject that includes amethodInfoproperty.methodInfocontains a key-based array thatTaskManageruses to populate the value of aTaskInfodata object’sdescriptionIdproperty with the name of the operation. Examples of two elements from this key-based array aremethodInfo["Folder.createVm"]andmethodInfo["Folder.createClusterEx"].
- recentTask– Array ofTaskmanaged object references that are queued to run, running, or completed within the past 10 minutes. On ESX/ESXi hosts that are managed by a vCenter Server, a completed task must also be one of the 200 most recent tasks to be included in the array. A vSphere Client connected to a vSphere Server displays queued, running, and completed tasks in the Recent Tasks pane.
In addition to these properties,
TaskManager
has the following
methods:
- CreateTask– Used by other methods to create a customTaskobject. Developers creating extensions can use this method to create customTaskobjects.
- CreateCollectorForTasks– Creates an object that contains all tasks from the vCenter Server database that meet specific criteria. You cannot run this method against an ESX/ESXi system. See Using a TaskHistoryCollector.
Figure 1
shows a UML class diagram for
TaskManager
and associated
objects.
TaskManager and Task Managed Objects
