# Managed Object - EventManager(vim.event.EventManager)

Property of
  ServiceContent
See also
  Event, EventArgDesc, EventDescription, EventFilterSpec, EventHistoryCollector, ManagedEntity, TaskInfo
Since
  2.0

## Managed Object Description

This managed object type provides properties and methods for event management support. Event objects are used to record significant state changes of managed entities.

Properties

Name | Type | Description
--- | --- | ---
description P | EventDescription | Static descriptive strings used in events.
latestEvent* P | Event | The latest event that happened on the VirtualCenter server.
maxCollector P | xsd:int | For each client, the maximum number of event collectors that can exist simultaneously.

*May not be presentP Required privilege: System.View

Methods

Methods defined in this Managed Object
CreateCollectorForEvents, LogUserEvent, PostEvent, QueryEvents, RetrieveArgumentDescription

# CreateCollectorForEvents(createCollector)

Creates an event history collector, which is a specialized history collector that provides Event objects.

Event collectors do not persist beyond the current client session.

Required Privileges
  System.View

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the EventManager used to make the method call.
filter P | EventFilterSpec | The event query filter. Since 2.0

P Required privilege: filter

Return Value

Type | Description
--- | ---
ManagedObjectReference to a EventHistoryCollector | The event collector based on the filter.

Faults

Type | Description
--- | ---
InvalidState | Thrown if there are more than the maximum number of event 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:vim25="urn:vim25" name="CreateCollectorForEvents" type="vim25:CreateCollectorForEventsRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vim25="urn:vim25" name="CreateCollectorForEventsResponse"> <complexType> <sequence> <element name="returnval" type="vim25:ManagedObjectReference"/> </sequence> </complexType> </element>

# LogUserEvent(logUserEvent)

Logs a user defined event against a particular managed entity.

Required Privileges
  None

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the EventManager used to make the method call.
entity P | ManagedObjectReference to a ManagedEntity | The entity against which the event is logged. The entity must be the root folder, a DataCenter, a VirtualMachine, a HostSystem, or a ComputeResource. Since 2.0
msg P | xsd:string | The message to be logged. Since 2.0

PRequired privilege - see tooltip for details

Return Value

Type | Description
--- | ---
None

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:vim25="urn:vim25" name="LogUserEvent" type="vim25:LogUserEventRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vim25="urn:vim25" name="LogUserEventResponse"> <complexType/> </element>

# PostEvent(postEvent)

Posts the specified event, optionally associating it with a task.

The event being posted should have the following info in it:

- The ManagedEntity on which the event is being posted should be set in the appropriate EntityEventArgument field of the base Event class. It is OK to not set any entity, in which case the event is treated as an event about the system.
- Some Event fields (key, chainId, createdTime) are mandatory because of the nature of the structure, but any caller-supplied values will be overwritten by the system.

If the event being posted is to be associated with an existing Task, the appropriate TaskInfo needs to be passed in. This task can either be one returned from a vSphere API operation or an extension task created by calling TaskManager#createTask.

Required Privileges
  Global.LogEvent
Since
  VI API 2.5

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the EventManager used to make the method call.
eventToPost P | Event | Fully-specified event to post Since VI API 2.5
taskInfo* P | TaskInfo | optional task associated with the event Since VI API 2.5

*Need not be set PRequired privilege - see tooltip for details

Return Value

Type | Description
--- | ---
None

Faults

Type | Description
--- | ---
InvalidEvent | no longer thrown by this API
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:vim25="urn:vim25" name="PostEvent" type="vim25:PostEventRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vim25="urn:vim25" name="PostEventResponse"> <complexType/> </element>

# QueryEvents(QueryEvent)

Returns the events in specified filter. Returns empty array when there are not any events qualified.

Required Privileges
  System.View

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the EventManager used to make the method call.
filter P | EventFilterSpec | The events qualified. Since 2.0

P Required privilege: filter

Return Value

Type | Description
--- | ---
Event[] | The events matching the filter.

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:vim25="urn:vim25" name="QueryEvents" type="vim25:QueryEventsRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vim25="urn:vim25" name="QueryEventsResponse"> <complexType> <sequence> <element name="returnval" type="vim25:Event" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> </element>

# RetrieveArgumentDescription(retrieveArgumentDescription)

Retrieves the argument meta-data for a given Event type

Required Privileges
  System.View
Since
  vSphere API 4.0

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the EventManager used to make the method call.
eventTypeId P | xsd:string | Since vSphere API 4.0

P Required privilege: eventTypeId

Return Value

Type | Description
--- | ---
EventArgDesc[] |

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:vim25="urn:vim25" name="RetrieveArgumentDescription" type="vim25:RetrieveArgumentDescriptionRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vim25="urn:vim25" name="RetrieveArgumentDescriptionResponse"> <complexType> <sequence> <element name="returnval" type="vim25:EventArgDesc" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> </element>