# Managed Object - TaskManager(vim.TaskManager)

Property of
  ServiceContent
See also
  Task, TaskDescription, TaskFilterSpec, TaskHistoryCollector, TaskInfo

## Managed Object Description

The TaskManager managed object provides an interface for creating and managing Task managed objects. Many operations are non-blocking, returning a Task managed object that can be monitored by a client application. Task managed objects may also be accessed through the TaskManager.

Properties

Name | Type | Description
--- | --- | ---
description P | TaskDescription | Locale-specific, static strings that describe Task information to users.
maxCollector P | xsd:int | Maximum number of TaskHistoryCollector data objects that can exist concurrently, per client.
recentTask* P | ManagedObjectReference[] to a Task[] | A list of Task managed objects that completed recently, that are currently running, or that are queued to run. The list contains only Task objects that the client has permission to access, which is determined by having permission to access the Task object's managed entity. The completed Task objects by default include only Task objects that completed within the past 10 minutes. When connected to vCenter Server, there is an additional default limitation that each of the completed Task objects in this list is one of the last 200 completed Task objects. This property should not be used for tracking Task completion. Generally, a ListView is a better way to monitor a specific set of Task objects. In releases after vSphere API 5.0, vSphere Servers might not generate property collector update notifications for this property. To obtain the latest value of the property, you can use PropertyCollector methods RetrievePropertiesEx or WaitForUpdatesEx. If you use the PropertyCollector.WaitForUpdatesEx method, specify an empty string for the version parameter. Any other version value will not produce any property values as no updates are generated.

*May not be present P Required privilege: System.View

Methods

Methods defined in this Managed Object
CreateCollectorForTasks, CreateTask

# CreateCollectorForTasks(createCollector)

Creates a TaskHistoryCollector, a specialized HistoryCollector that gathers TaskInfo data objects.

A TaskHistoryCollector does not persist beyond the current client session.

Required Privileges
  System.View

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the TaskManager used to make the method call.
filter | TaskFilterSpec | The specification for the task query filter.

Return Value

Type | Description
--- | ---
ManagedObjectReference to a TaskHistoryCollector | The task collector based on the filter.

Faults

Type | Description
--- | ---
InvalidArgument | Thrown if the filter is null or unknown.
InvalidState | Thrown if there are more than the maximum number of task collectors.
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:pbm="urn:pbm" name="CreateCollectorForTasks" type="pbm:CreateCollectorForTasksRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:pbm="urn:pbm" name="CreateCollectorForTasksResponse"> <complexType> <sequence> <element name="returnval" type="pbm:ManagedObjectReference"/> </sequence> </complexType> </element>

# CreateTask(createTask)

Creates a new Task, specifying the object with which the Task is associated, the type of task, and whether the task is cancelable. Use this operation in conjunction with the ExtensionManager.

Required Privileges
  Task.Create
Since
  VI API 2.5

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the TaskManager used to make the method call.
obj | ManagedObjectReference | ManagedObject with which Task will be associated
taskTypeId | xsd:string | Extension registered task type identifier for type of task being created
initiatedBy* | xsd:string | The name of the user on whose behalf the Extension is creating the task
cancelable | xsd:boolean | True if the task should be cancelable, false otherwise
parentTaskKey* | xsd:string | Key of the task that is the parent of this task Since vSphere API 4.0
activationId* | xsd:string | Activation Id is a client-provided token to link an API call with a task. When provided, the activationId is added to the TaskInfo Since vSphere API 6.0

*Need not be set

Return Value

Type | Description
--- | ---
TaskInfo | TaskInfo data object describing the new task

Faults

Type | Description
--- | ---
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:pbm="urn:pbm" name="CreateTask" type="pbm:CreateTaskRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:pbm="urn:pbm" name="CreateTaskResponse"> <complexType> <sequence> <element name="returnval" type="pbm:TaskInfo"/> </sequence> </complexType> </element>